spring boot rabbitmq MappingJackson2MessageConverter custom object conversion

后端 未结 2 1295
忘掉有多难
忘掉有多难 2020-12-15 10:43

I\'m trying to create a simple spring boot app with spring boot that \"produce\" messages to a rabbitmq exchange/queue and another sample spring boot app that \"consume\" th

2条回答
  •  情书的邮戳
    2020-12-15 11:19

    Have not done this myself but it seems like you need to register the appropriate conversions by setting up a RabbitTemplate. Take a look at section 3.1.8 in this Spring documentation. I know it is configured using the AMQP classes but if the messaging class you are mentioning is compatible there is no reason you can't substitute it. Looks like this reference explains how you might do it using Java configuration rather than XML. I have not really used Rabbit so I don't have any personal experience but I would love to hear what you find out.

提交回复
热议问题