Class AbstractMessageReceiverEndpoint
- java.lang.Object
-
- de.otto.synapse.endpoint.AbstractMessageEndpoint
-
- de.otto.synapse.endpoint.receiver.AbstractMessageReceiverEndpoint
-
- All Implemented Interfaces:
MessageEndpoint,MessageReceiverEndpoint
- Direct Known Subclasses:
AbstractMessageLogReceiverEndpoint
public class AbstractMessageReceiverEndpoint extends AbstractMessageEndpoint implements MessageReceiverEndpoint
Receiver-sideMessageEndpoint endpointof a Message Channel
-
-
Constructor Summary
Constructors Constructor Description AbstractMessageReceiverEndpoint(java.lang.String channelName, MessageInterceptorRegistry interceptorRegistry, org.springframework.context.ApplicationEventPublisher eventPublisher)
-
Method Summary
Modifier and Type Method Description EndpointTypegetEndpointType()MessageDispatchergetMessageDispatcher()Returns the MessageDispatcher that is used to dispatch messages.protected voidpublishEvent(MessageReceiverStatus status, java.lang.String message, ChannelDurationBehind durationBehind)voidregister(MessageConsumer<?> messageConsumer)Registers a MessageConsumer at the receiver endpoint.-
Methods inherited from class de.otto.synapse.endpoint.AbstractMessageEndpoint
getChannelName, getInterceptorChain, intercept
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.otto.synapse.endpoint.MessageEndpoint
getChannelName, getInterceptorChain, intercept
-
-
-
-
Constructor Detail
-
AbstractMessageReceiverEndpoint
public AbstractMessageReceiverEndpoint(@Nonnull java.lang.String channelName, @Nonnull MessageInterceptorRegistry interceptorRegistry, @Nullable org.springframework.context.ApplicationEventPublisher eventPublisher)
-
-
Method Detail
-
register
public final void register(MessageConsumer<?> messageConsumer)
Registers a MessageConsumer at the receiver endpoint.consumershave to be thread safe as they might be called from multiple threads in parallel (e.g. for kinesis streams there is one thread per shard).- Specified by:
registerin interfaceMessageReceiverEndpoint- Parameters:
messageConsumer- registered EventConsumer
-
getMessageDispatcher
@Nonnull public final MessageDispatcher getMessageDispatcher()
Returns the MessageDispatcher that is used to dispatch messages.- Specified by:
getMessageDispatcherin interfaceMessageReceiverEndpoint- Returns:
- MessageDispatcher
-
getEndpointType
@Nonnull public final EndpointType getEndpointType()
Description copied from interface:MessageEndpoint- Specified by:
getEndpointTypein interfaceMessageEndpoint- Returns:
- EndpointType
-
publishEvent
protected void publishEvent(@Nonnull MessageReceiverStatus status, @Nullable java.lang.String message, @Nullable ChannelDurationBehind durationBehind)
-
-