Class AdapterUtils

java.lang.Object
org.springframework.kafka.listener.adapter.AdapterUtils

public final class AdapterUtils extends Object
Utilities for listener adapters.
Since:
2.5
Author:
Gary Russell
  • Field Details

    • PARSER_CONTEXT

      public static final ParserContext PARSER_CONTEXT
      Parser context for runtime SpEL using ! as the template prefix.
      Since:
      2.2.15
  • Method Details

    • buildConsumerRecordMetadataFromArray

      @Nullable public static Object buildConsumerRecordMetadataFromArray(Object... data)
      Build a ConsumerRecordMetadata from the first ConsumerRecord in data, if any.
      Parameters:
      data - the data array.
      Returns:
      the metadata or null if data does not contain a ConsumerRecord.
    • buildConsumerRecordMetadata

      @Nullable public static ConsumerRecordMetadata buildConsumerRecordMetadata(Object data)
      Build a ConsumerRecordMetadata from data which must be a ConsumerRecord.
      Parameters:
      data - the record.
      Returns:
      the metadata or null if data is not a ConsumerRecord.
    • getDefaultReplyTopicExpression

      public static String getDefaultReplyTopicExpression()
      Return the default expression when no SendTo value is present.
      Returns:
      the expression.
      Since:
      2.2.15