0

I need send message between C# Microservices with EasyNetQ and Java with Spring Amqp.

The problem is the properties message , the Type from Spring Boot Amqp is in property __type__ headers container while in EasynetQ is expected from outher properties named type.

Could anyone tell me what i need to customize to let comunicate them as well?

Spring Amqp :
    "Headers":{"__TypeId__":"com.fastdeliveryservice.service.Info"}

   EasynetQ: 
      "type" : "com.fastdeliveryservice.service.Info"
Strom
  • 129
  • 1
  • 2
  • 8

1 Answers1

0

You can customize the Jackson2JsonMessageConverter by configuring its Jackson2JavaTypeMapper with a customized one. Subclass the DefaultJackson2JavaTypeMapper and override the getClassIdFieldName() method to return type instead of __TypeId__.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • hi i did it but it's still inside "headers" array instead out of it , sibilling other proprierties like reply_to: etc. Other question , it's possibile to ovveride the ""com.fastdeliveryservice.service.Info" namespace? – Strom Sep 27 '17 at 14:14
  • Ah; sorry - missed that; you can use a `MessagePostProcessor` to set the `type` property for outgoing messages and a similar one to copy the type to the typeId header for inbound messages (in `afterReceivePostProcessors`). Alternatively, customize the message converter to use the `type` property. – Gary Russell Sep 27 '17 at 14:50
  • Thanks. I did it! There a Field Type not setted so i used it! – Strom Sep 28 '17 at 07:45