Interface BatchMessageConverter

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.util.List<org.apache.kafka.clients.producer.ProducerRecord<?,​?>> fromMessage​(org.springframework.messaging.Message<?> message, java.lang.String defaultTopic)
      Convert a message to a producer record.
      default RecordMessageConverter getRecordMessageConverter()
      Return the record converter used by this batch converter, if configured, or null.
      org.springframework.messaging.Message<?> toMessage​(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>> records, Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,​?> consumer, java.lang.reflect.Type payloadType)
      Convert a list of ConsumerRecord to a Message.
    • Method Detail

      • toMessage

        @NonNull
        org.springframework.messaging.Message<?> toMessage​(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,​?>> records,
                                                           @Nullable
                                                           Acknowledgment acknowledgment,
                                                           org.apache.kafka.clients.consumer.Consumer<?,​?> consumer,
                                                           java.lang.reflect.Type payloadType)
        Convert a list of ConsumerRecord to a Message.
        Parameters:
        records - the records.
        acknowledgment - the acknowledgment.
        consumer - the consumer.
        payloadType - the required payload type.
        Returns:
        the message.
      • fromMessage

        java.util.List<org.apache.kafka.clients.producer.ProducerRecord<?,​?>> fromMessage​(org.springframework.messaging.Message<?> message,
                                                                                                java.lang.String defaultTopic)
        Convert a message to a producer record.
        Parameters:
        message - the message.
        defaultTopic - the default topic to use if no header found.
        Returns:
        the producer records.
      • getRecordMessageConverter

        @Nullable
        default RecordMessageConverter getRecordMessageConverter()
        Return the record converter used by this batch converter, if configured, or null.
        Returns:
        the converter or null.
        Since:
        2.1.5