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.

有帮助吗?

解决方案

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"/>

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top