O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring a message converter

At the precise time a message is received by the listener, two change steps happen. In the initial step, the incoming AMQP message is changed over to a Spring messaging Message using MessageConverter. In the second step, when the target method is executed, the payload of the message is changed over to the parameter type if necessary. By default, in the initial step, MessageConverter is utilized as Spring AMQP SimpleMessageConverter that handles the transformation to String and java.io.Serializable.

In the second step, by default, GenericMessageConverter is used for conversion. We have used Jackson2JsonMessageConverter in the following code:

@Beanpublic MessageConverter messageConverter() { return new Jackson2JsonMessageConverter(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required