Class MessagingMessageConverterAdapter
java.lang.Object
org.springframework.amqp.support.converter.MessagingMessageConverter
org.springframework.amqp.support.converter.MessagingMessageConverterAdapter
- All Implemented Interfaces:
MessageConverter,InitializingBean
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 Summary
ConstructorsConstructorDescriptionMessagingMessageConverterAdapter(@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. -
Method Summary
Modifier and TypeMethodDescriptionextractPayload(Message message) Extract the payload of the specifiedMessage.@Nullable MethodbooleanbooleanMethods inherited from class org.springframework.amqp.support.converter.MessagingMessageConverter
afterPropertiesSet, fromMessage, getHeaderMapper, setHeaderMapper, setPayloadConverter, toMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.amqp.support.converter.MessageConverter
toMessage
-
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
-
extractPayload
Description copied from class:MessagingMessageConverterExtract the payload of the specifiedMessage.- Overrides:
extractPayloadin classMessagingMessageConverter- Parameters:
message- the AMQP Message to extractpayload.- Returns:
- the extracted
payload.
-