Class MessagingMessageConverterAdapter

java.lang.Object
org.springframework.amqp.support.converter.MessagingMessageConverter
org.springframework.amqp.support.converter.MessagingMessageConverterAdapter
All Implemented Interfaces:
MessageConverter, InitializingBean

public class MessagingMessageConverterAdapter extends MessagingMessageConverter
The MessagingMessageConverter extension for message listeners with flexible method signature.

If the inbound message has no type information and the configured message converter supports it, this converter attempts to infer the conversion type from the method signature and populates the MessageProperties.setInferredArgumentType(Type) before calling extractPayload(org.springframework.amqp.core.Message) of super class.

If an instance is created without the bean method to infer the type from, it acts as a super class.

Since:
4.1
Author:
Gary Russell, Artem Bilan
  • Constructor Details

    • MessagingMessageConverterAdapter

      public MessagingMessageConverterAdapter(@Nullable Object bean, @Nullable Method method, boolean batch, Class<?>... providedArgumentTypes)
      Construct an instance based on the bean and its method to infer the payload type.
      Parameters:
      bean - the bean for method.
      method - the method to infer the payload type.
      batch - if the method is a batch listener.
      providedArgumentTypes - additional argument types to consider as provided without conversion.
  • Method Details

    • isMessageList

      public boolean isMessageList()
    • isAmqpMessageList

      public boolean isAmqpMessageList()
    • getMethod

      public @Nullable Method getMethod()
    • extractPayload

      public Object extractPayload(Message message)
      Description copied from class: MessagingMessageConverter
      Extract the payload of the specified Message.
      Overrides:
      extractPayload in class MessagingMessageConverter
      Parameters:
      message - the AMQP Message to extract payload.
      Returns:
      the extracted payload.