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.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
send(Message<?> message)
Send a single
Message to the channel. |
java.util.concurrent.CompletableFuture<java.lang.Void> |
sendBatch(java.util.stream.Stream<? extends Message<?>> batch)
Send a batch of
messages to the channel. |
public DelegateMessageSenderEndpoint(@Nonnull
java.lang.String channelName,
@Nonnull
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 java.util.concurrent.CompletableFuture<java.lang.Void> send(@Nonnull
Message<?> message)
MessageSenderMessage to the channel.send in interface MessageSendermessage - the messagepublic java.util.concurrent.CompletableFuture<java.lang.Void> sendBatch(@Nonnull
java.util.stream.Stream<? extends Message<?>> batch)
MessageSendermessages to the channel.sendBatch in interface MessageSenderbatch - the batch of messages