Package de.otto.synapse.endpoint.sender
Class DelegateMessageSenderEndpoint
java.lang.Object
de.otto.synapse.endpoint.sender.DelegateMessageSenderEndpoint
- All Implemented Interfaces:
MessageEndpoint,MessageSender,MessageSenderEndpoint
-
Constructor Summary
ConstructorsConstructorDescriptionDelegateMessageSenderEndpoint(String channelName, Class<? extends Selector> selector, MessageFormat messageFormat, List<MessageSenderEndpointFactory> factories) -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the channel.Returns theInterceptorChainof theMessageEndpoint.intercept(TextMessage message) Intercepts a message using all registered interceptors and returns the resulting message.Send a singleMessageto the channel.Send a batch ofmessagesto the channel.
-
Constructor Details
-
DelegateMessageSenderEndpoint
public DelegateMessageSenderEndpoint(@Nonnull String channelName, @Nonnull Class<? extends Selector> selector, @Nonnull MessageFormat messageFormat, List<MessageSenderEndpointFactory> factories)
-
-
Method Details
-
getChannelName
Description copied from interface:MessageEndpointReturns the name of the channel.The channel name corresponds to the name of the underlying stream, queue or message log.
- Specified by:
getChannelNamein interfaceMessageEndpoint- Returns:
- name of the channel
-
getMessageFormat
-
getInterceptorChain
Description copied from interface:MessageEndpointReturns theInterceptorChainof theMessageEndpoint.- Specified by:
getInterceptorChainin interfaceMessageEndpoint- Returns:
- InterceptorChain
-
getEndpointType
Description copied from interface:MessageEndpoint- Specified by:
getEndpointTypein interfaceMessageEndpoint- Returns:
- EndpointType
-
intercept
Description copied from interface:MessageEndpointIntercepts a message using all registered interceptors and returns the resulting message.The interceptors are called in order. The result of one interceptor is propagated to the next interceptor in the chain, until the end of the chain is reached, or one interceptor has returned null.
If
nullis returned, the message must be dropped by theAbstractMessageEndpoint.Every interceptor may transform the message, or may take additional actions like, for example, logging, monitoring or other things.
- Specified by:
interceptin interfaceMessageEndpoint- Parameters:
message- the message to intercept- Returns:
- the (possibly modified) message, or null if the message should be dropped.
-
send
Description copied from interface:MessageSenderSend a singleMessageto the channel.- Specified by:
sendin interfaceMessageSender- Parameters:
message- the message- Returns:
- a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.
-
sendBatch
Description copied from interface:MessageSenderSend a batch ofmessagesto the channel.- Specified by:
sendBatchin interfaceMessageSender- Parameters:
batch- the batch of messages- Returns:
- a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.
-