Interface KafkaConnection


public interface KafkaConnection
Used to send messages to a Kafka connection.
  • Method Details

    • publishToTopicAsync

      CompletableFuture<Void> publishToTopicAsync(String topic, String id, byte[] message)
      Publish a message to a Kafka broker configured through an ActiveCaching connector with a default timeout of 5 seconds.
      Parameters:
      topic - the topic to publish the message to.
      id - the ID (kafka Key) of the message.
      message - the message to publish.
      Returns:
      a CompletableFuture of type Void that will complete when the message has been delivered to the kafka connector. If the message cannot be delivered, CompletableFuture.completeExceptionally(Throwable) will be called with the reason.
    • publishToTopicAsync

      CompletableFuture<Void> publishToTopicAsync(String topic, String id, byte[] message, Duration timeout)
      Publish a message to a Kafka broker configured through an ActiveCaching connector with a configured timeout.
      Parameters:
      topic - the topic to publish the message to.
      id - the ID (kafka Key) of the message.
      message - the message to publish.
      timeout - the timeout.
      Returns:
      a CompletableFuture of type Void that will complete when the message has been delivered to the kafka connector. If the message cannot be delivered, CompletableFuture.completeExceptionally(Throwable) will be called with the reason.