Class AbstractMessageSenderEndpoint

    • Constructor Detail

      • AbstractMessageSenderEndpoint

        public AbstractMessageSenderEndpoint​(@Nonnull
                                             java.lang.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 determine message interceptors for this endpoint.
        messageTranslator - the MessageTranslator used to translate message payloads as expected by the consumers.
    • Method Detail

      • send

        public final java.util.concurrent.CompletableFuture<java.lang.Void> send​(@Nonnull
                                                                                 Message<?> message)
        Sends a Message to the message channel.
        Specified by:
        send in interface MessageSender
        Parameters:
        message - the message to send
        Returns:
        a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.
      • sendBatch

        public final java.util.concurrent.CompletableFuture<java.lang.Void> sendBatch​(@Nonnull
                                                                                      java.util.stream.Stream<? extends Message<?>> batch)
        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:
        sendBatch in interface MessageSender
        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.
      • doSendBatch

        protected java.util.concurrent.CompletableFuture<java.lang.Void> doSendBatch​(@Nonnull
                                                                                     java.util.stream.Stream<TextMessage> batch)
      • doSend

        protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> doSend​(@Nonnull
                                                                                         TextMessage message)