public class DelegateMessageSenderEndpoint extends java.lang.Object implements MessageSenderEndpoint
| Constructor and Description |
|---|
DelegateMessageSenderEndpoint(java.lang.String channelName,
java.lang.Class<? extends Selector> selector,
MessageFormat messageFormat,
java.util.List<MessageSenderEndpointFactory> factories) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getChannelName()
Returns the name of the channel.
|
EndpointType |
getEndpointType()
|
InterceptorChain |
getInterceptorChain()
Returns the
InterceptorChain of the MessageEndpoint. |
MessageFormat |
getMessageFormat() |
TextMessage |
intercept(TextMessage message)
Intercepts a message using all registered interceptors and returns the resulting message.
|
<T> java.util.concurrent.CompletableFuture<java.lang.Void> |
send(Message<T> message)
Send a single
Message to the channel. |
<T> java.util.concurrent.CompletableFuture<java.lang.Void> |
sendBatch(java.util.stream.Stream<Message<T>> batch)
Send a batch of
messages to the channel. |
public DelegateMessageSenderEndpoint(@Nonnull
java.lang.String channelName,
@Nullable
java.lang.Class<? extends Selector> selector,
@Nonnull
MessageFormat messageFormat,
java.util.List<MessageSenderEndpointFactory> factories)
@Nonnull public java.lang.String getChannelName()
MessageEndpointThe channel name corresponds to the name of the underlying stream, queue or message log.
getChannelName in interface MessageEndpoint@Nonnull public MessageFormat getMessageFormat()
@Nonnull public InterceptorChain getInterceptorChain()
MessageEndpointInterceptorChain of the MessageEndpoint.getInterceptorChain in interface MessageEndpoint@Nonnull public EndpointType getEndpointType()
MessageEndpointgetEndpointType in interface MessageEndpoint@Nullable public TextMessage intercept(@Nonnull TextMessage message)
MessageEndpointThe 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 null is returned, the message must be dropped by the AbstractMessageEndpoint.
Every interceptor may transform the message, or may take additional actions like, for example, logging, monitoring or other things.
intercept in interface MessageEndpointmessage - the message to interceptpublic <T> java.util.concurrent.CompletableFuture<java.lang.Void> send(@Nonnull
Message<T> message)
MessageSenderMessage to the channel.send in interface MessageSenderT - the type of the message payloadmessage - the messagepublic <T> java.util.concurrent.CompletableFuture<java.lang.Void> sendBatch(@Nonnull
java.util.stream.Stream<Message<T>> batch)
MessageSendermessages to the channel.sendBatch in interface MessageSenderT - the type of the message payloadbatch - the batch of messages