I have been using MassTransit and really like it. However, by default, it wraps all RabbitMQ payloads/messages with some JSON specific to MassTransit. This makes it difficult to exchange messages with non-.NET services. I know that JSON can be parsed by any language, but MassTransit is a .NET-only thing, and in my non-.NET services, I'd like to avoid having to add special logic to handle messages generated by MassTransit.
Is it possible to serialize JSON messages using MassTransit that don't go through the "MessageEnvelope" interface to establish better interoperability with non-MassTransit services? Or would doing this break most/all the MassTransit functionality?
It is described in the documentation.
You won't be able to avoid having some special logic to consume MT messages since the format of messages is pre-defined.
This is a minimal message:
{
"destinationAddress": "rabbitmq://localhost/input_queue",
"headers": {},
"message": {
"value": "Some Value",
"customerId": 27
},
"messageType": [
"urn:message:MassTransit.Tests:ValueMessage"
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With