Package de.otto.synapse.consumer
Class MethodInvokingMessageConsumer<T>
- java.lang.Object
-
- de.otto.synapse.consumer.MethodInvokingMessageConsumer<T>
-
- Type Parameters:
T- The expected type of the message's payload
- All Implemented Interfaces:
MessageConsumer<T>,java.util.function.Consumer<Message<T>>
public class MethodInvokingMessageConsumer<T> extends java.lang.Object implements MessageConsumer<T>
-
-
Constructor Summary
Constructors Constructor Description MethodInvokingMessageConsumer(java.lang.String keyPattern, java.lang.Class<T> payloadType, java.lang.Object instance, java.lang.reflect.Method method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Message<T> message)java.util.regex.PatternkeyPattern()Returns the pattern ofMessage.getKey()() message keys} accepted by this consumer.java.lang.Class<T>payloadType()Returns the expected payload type ofmessagesconsumed by this MessageConsumer.
-
-
-
Constructor Detail
-
MethodInvokingMessageConsumer
public MethodInvokingMessageConsumer(java.lang.String keyPattern, java.lang.Class<T> payloadType, java.lang.Object instance, java.lang.reflect.Method method)
-
-
Method Detail
-
payloadType
@Nonnull public java.lang.Class<T> payloadType()
Returns the expected payload type ofmessagesconsumed by this MessageConsumer.- Specified by:
payloadTypein interfaceMessageConsumer<T>- Returns:
- payload type
-
keyPattern
@Nonnull public java.util.regex.Pattern keyPattern()
Returns the pattern ofMessage.getKey()() message keys} accepted by this consumer.- Specified by:
keyPatternin interfaceMessageConsumer<T>- Returns:
- Pattern
-
-