Interface ReplyingKafkaOperations<K,​V,​R>

  • Type Parameters:
    K - the key type.
    V - the outbound data type.
    R - the reply data type.
    All Known Implementing Classes:
    AggregatingReplyingKafkaTemplate, ReplyingKafkaTemplate

    public interface ReplyingKafkaOperations<K,​V,​R>
    Request/reply operations.
    Since:
    2.1.3
    Author:
    Gary Russell
    • Method Detail

      • waitForAssignment

        default boolean waitForAssignment​(java.time.Duration duration)
                                   throws java.lang.InterruptedException
        Wait until partitions are assigned, e.g. when auto.offset.reset=latest. When using manual assignment, the duration must be greater than the container's pollTimeout property.
        Parameters:
        duration - how long to wait.
        Returns:
        true if the partitions have been assigned.
        Throws:
        java.lang.InterruptedException - if the thread is interrupted while waiting.
        Since:
        2.8.8
      • sendAndReceive

        default RequestReplyMessageFuture<K,​V> sendAndReceive​(org.springframework.messaging.Message<?> message)
        Send a request message and receive a reply message with the default timeout.
        Parameters:
        message - the message to send.
        Returns:
        a RequestReplyMessageFuture.
        Since:
        2.7
      • sendAndReceive

        default RequestReplyMessageFuture<K,​V> sendAndReceive​(org.springframework.messaging.Message<?> message,
                                                                    @Nullable
                                                                    java.time.Duration replyTimeout)
        Send a request message and receive a reply message.
        Parameters:
        message - the message to send.
        replyTimeout - the reply timeout; if null, the default will be used.
        Returns:
        a RequestReplyMessageFuture.
        Since:
        2.7
      • sendAndReceive

        default <P> RequestReplyTypedMessageFuture<K,​V,​P> sendAndReceive​(org.springframework.messaging.Message<?> message,
                                                                                     org.springframework.core.ParameterizedTypeReference<P> returnType)
        Send a request message and receive a reply message.
        Type Parameters:
        P - the reply payload type.
        Parameters:
        message - the message to send.
        returnType - a hint to the message converter for the reply payload type.
        Returns:
        a RequestReplyMessageFuture.
        Since:
        2.7
      • sendAndReceive

        default <P> RequestReplyTypedMessageFuture<K,​V,​P> sendAndReceive​(org.springframework.messaging.Message<?> message,
                                                                                     java.time.Duration replyTimeout,
                                                                                     org.springframework.core.ParameterizedTypeReference<P> returnType)
        Send a request message and receive a reply message.
        Type Parameters:
        P - the reply payload type.
        Parameters:
        message - the message to send.
        replyTimeout - the reply timeout; if null, the default will be used.
        returnType - a hint to the message converter for the reply payload type.
        Returns:
        a RequestReplyMessageFuture.
        Since:
        2.7
      • sendAndReceive

        RequestReplyFuture<K,​V,​R> sendAndReceive​(org.apache.kafka.clients.producer.ProducerRecord<K,​V> record)
        Send a request and receive a reply with the default timeout.
        Parameters:
        record - the record to send.
        Returns:
        a RequestReplyFuture.
      • sendAndReceive

        RequestReplyFuture<K,​V,​R> sendAndReceive​(org.apache.kafka.clients.producer.ProducerRecord<K,​V> record,
                                                             java.time.Duration replyTimeout)
        Send a request and receive a reply.
        Parameters:
        record - the record to send.
        replyTimeout - the reply timeout; if null, the default will be used.
        Returns:
        a RequestReplyFuture.
        Since:
        2.3