public abstract class AbstractMessageSenderEndpoint extends AbstractMessageEndpoint implements MessageSenderEndpoint
MessageEndpoint endpoint
of a Message Channel with support for message translation
.
and interception
.
Constructor and Description |
---|
AbstractMessageSenderEndpoint(java.lang.String channelName,
MessageInterceptorRegistry interceptorRegistry,
MessageTranslator<TextMessage> messageTranslator)
Constructor used to create a new MessageEndpoint.
|
Modifier and Type | Method and Description |
---|---|
protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> |
doSend(TextMessage message) |
protected java.util.concurrent.CompletableFuture<java.lang.Void> |
doSendBatch(java.util.stream.Stream<TextMessage> batch) |
EndpointType |
getEndpointType()
|
<T> java.util.concurrent.CompletableFuture<java.lang.Void> |
send(Message<T> message)
Sends a
Message to the message channel. |
<T> java.util.concurrent.CompletableFuture<java.lang.Void> |
sendBatch(java.util.stream.Stream<Message<T>> batch)
Sends a stream of messages to the message channel as one or more batches, if
batches are supported by the infrastructure.
|
getChannelName, getInterceptorChain, intercept
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChannelName, getInterceptorChain, intercept
public AbstractMessageSenderEndpoint(@Nonnull java.lang.String channelName, @Nonnull MessageInterceptorRegistry interceptorRegistry, @Nonnull MessageTranslator<TextMessage> messageTranslator)
channelName
- the name of the underlying channel / stream / queue / message log.interceptorRegistry
- registry used to determine message interceptors
for this
endpoint.messageTranslator
- the MessageTranslator used to translate message payloads as expected by the
consumers
.public final <T> java.util.concurrent.CompletableFuture<java.lang.Void> send(@Nonnull Message<T> message)
Message
to the message channel.send
in interface MessageSenderEndpoint
T
- type of the message's payloadmessage
- the message to sendpublic final <T> java.util.concurrent.CompletableFuture<java.lang.Void> sendBatch(@Nonnull java.util.stream.Stream<Message<T>> batch)
sendBatch
in interface MessageSenderEndpoint
T
- the type of the message payloadbatch
- a stream of messages that is sent in batched mode, if supported@Nonnull public final EndpointType getEndpointType()
MessageEndpoint
getEndpointType
in interface MessageEndpoint
protected java.util.concurrent.CompletableFuture<java.lang.Void> doSendBatch(@Nonnull java.util.stream.Stream<TextMessage> batch)
protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> doSend(@Nonnull TextMessage message)