Interface Message.SectionsConverter<I,O>

Type Parameters:
I - the input type (body section value type from the AMQP implementation)
O - the output type (application-specific converted type)
Enclosing interface:
Message
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface Message.SectionsConverter<I,O>
Functional interface for converting multiple AMQP body section values.

This converter is used with Message.body(SectionsConverter) to process all body sections from an AMQP 1.0 message. According to the AMQP 1.0 specification, a message body can contain multiple sections of the same type, and this converter provides access to all of them.

Multi-Section Scenarios:

  • Multiple Data sections - List of byte[] arrays, typically concatenated
  • Multiple AmqpSequence sections - List of List<?> objects
  • Single AmqpValue section - List with one element of the AmqpValue type

The converter receives all section values as a list, allowing applications to aggregate, concatenate, or otherwise process complex multi-section message bodies that exceed the capabilities of single-section processing.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(List<I> sections)
    Convert the given list of AMQP body section values to the desired output type.
  • Method Details

    • convert

      O convert(List<I> sections)
      Convert the given list of AMQP body section values to the desired output type.

      The list contains all body sections from the message in their original order. For Data sections, this typically means multiple byte[] arrays. For AmqpSequence sections, this means multiple List<?> objects. For AmqpValue sections, this typically contains a single element.

      Parameters:
      sections - the list of body section values from the AMQP message
      Returns:
      the converted value