Package de.otto.synapse.endpoint.sender
Class AbstractMessageSenderEndpoint
java.lang.Object
de.otto.synapse.endpoint.AbstractMessageEndpoint
de.otto.synapse.endpoint.sender.AbstractMessageSenderEndpoint
- All Implemented Interfaces:
MessageEndpoint,MessageSender,MessageSenderEndpoint
public abstract class AbstractMessageSenderEndpoint
extends AbstractMessageEndpoint
implements MessageSenderEndpoint
Sender-side
MessageEndpoint endpoint of a Message Channel with support for message translation.
and interception.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMessageSenderEndpoint(String channelName, MessageInterceptorRegistry interceptorRegistry, MessageTranslator<TextMessage> messageTranslator) Constructor used to create a new MessageEndpoint. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CompletableFuture<Void>doSend(TextMessage message) protected CompletableFuture<Void>doSendBatch(Stream<TextMessage> batch) final EndpointTypefinal CompletableFuture<Void>Sends aMessageto the message channel.final CompletableFuture<Void>Sends a stream of messages to the message channel as one or more batches, if batches are supported by the infrastructure.Methods inherited from class de.otto.synapse.endpoint.AbstractMessageEndpoint
getChannelName, getInterceptorChain, interceptMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.otto.synapse.endpoint.MessageEndpoint
getChannelName, getInterceptorChain, intercept
-
Field Details
-
BATCH_SENDER_TIMEOUT
public static final int BATCH_SENDER_TIMEOUT- See Also:
-
-
Constructor Details
-
AbstractMessageSenderEndpoint
public AbstractMessageSenderEndpoint(@Nonnull String channelName, @Nonnull MessageInterceptorRegistry interceptorRegistry, @Nonnull MessageTranslator<TextMessage> messageTranslator) Constructor used to create a new MessageEndpoint.- Parameters:
channelName- the name of the underlying channel / stream / queue / message log.interceptorRegistry- registry used to determinemessage interceptorsfor this endpoint.messageTranslator- the MessageTranslator used to translate message payloads as expected by theconsumers.
-
-
Method Details
-
send
Sends aMessageto the message channel.- Specified by:
sendin interfaceMessageSender- Parameters:
message- the message to send- Returns:
- a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.
-
sendBatch
Sends a stream of messages to the message channel as one or more batches, if batches are supported by the infrastructure. If not, the messages are send one by one.- Specified by:
sendBatchin interfaceMessageSender- Parameters:
batch- a stream of messages that is sent in batched mode, if supported- Returns:
- a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.
-
getEndpointType
Description copied from interface:MessageEndpoint- Specified by:
getEndpointTypein interfaceMessageEndpoint- Returns:
- EndpointType
-
doSendBatch
-
doSend
-
getMessageFormat
-