Package io.micronaut.jms.listener
Class MessageHandlerAdapter<T>
java.lang.Object
io.micronaut.jms.listener.MessageHandlerAdapter<T>
- Type Parameters:
T
- the type that the underlyingMessageHandler
can handle
- All Implemented Interfaces:
jakarta.jms.MessageListener
Decorator for converting between
MessageListener
and
MessageHandler
. Will attempt to deserialize the given Message
to an object of type <T>
and then provide that to the delegate
handler.- Since:
- 1.0.0
- Author:
- Elliott Pope
-
Constructor Summary
ConstructorDescriptionMessageHandlerAdapter
(MessageHandler<T> delegate, Class<T> clazz) MessageHandlerAdapter
(MessageHandler<T> delegate, Class<T> clazz, Deserializer deserializer) -
Method Summary
-
Constructor Details
-
MessageHandlerAdapter
- Parameters:
delegate
- the underlying handler to delegate to.clazz
- the parameter class of thedelegate
.
-
MessageHandlerAdapter
- Parameters:
delegate
- the underlying handler to delegate to.clazz
- the parameter class of thedelegate
.deserializer
- theDeserializer
to be used to convert theMessage
to a plain Java object
-
-
Method Details
-
onMessage
public void onMessage(jakarta.jms.Message message) - Specified by:
onMessage
in interfacejakarta.jms.MessageListener
-