Question

I am using spring3 and spring-amqp for sending the messages from my web application to rabbitmq server.

Currently I am able to send the plain text to rabbitmq server. But now I want to send my custom java object as json to the server.

After googling I just found we can do it using JsonMessageConverter . But I didn't get any useful url for explaining the required steps.

Any reference/url will be appreciated.

Was it helpful?

Solution

See the reference documentation (including how to use the JsonMessageConverters.

And if you are using the namespace to define the template, it's

    <rabbit:template id="amqpTemplate" connection-factory="connectionFactory" 
           message-converter="aJsonMCBean"/>

OTHER TIPS

You can try to do it using Jackson. See this tutorial for example. Other alternatives:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top