Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MassTransit pulling messages from external system

How can MassTransit pull messages from a RabbitMQ when the messages were sent from a different message sending source(RabbitMQ Client in this case)?

The messages share the same C# message contract and serialized as json.

The current error I receive is masstransit parsing error...

like image 767
Alex Avatar asked Oct 20 '22 17:10

Alex


1 Answers

MassTransit uses a number of conventions and there are additional details you that would probably need to add to the payload if publishing from a non-MassTransit publisher. If you're getting a parsing error you are probably missing the messageType information below.

Payload:

{
  "destinationAddress": "rabbitmq://localhost/<exchange>",
  "headers": {},
  "message": {
    "property": "value"
  },
  "messageType": [    
    "urn:message:<TYPE>",
    "urn:message:<PARENT_TYPE>"
  ],
  "sourceAddress": "rabbitmq://localhost/queue"
}
like image 180
BTC Avatar answered Nov 02 '22 11:11

BTC