Interface MessageSender

All Known Subinterfaces:
MessageSenderEndpoint
All Known Implementing Classes:
AbstractMessageSenderEndpoint, DelegateMessageSenderEndpoint, TeeMessageSender

public interface MessageSender
Endpoint that is used by an application to send messages to a messaging channel.

Message Endpoint

See Also:
EIP: Message Endpoint
  • Method Summary

    Modifier and Type Method Description
    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.
  • Method Details

    • send

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

      java.util.concurrent.CompletableFuture<java.lang.Void> sendBatch​(@Nonnull java.util.stream.Stream<? extends Message<?>> batch)
      Send a batch of messages to the channel.
      Parameters:
      batch - the batch of messages
      Returns:
      a CompletableFuture that can be used for logging, error handling, waiting for completion, etc.