Closed marrrschine closed 4 years ago
Can I change this to just application/json?
The value is set by the serializer, so if you replace the serializer you can set it to whatever you want.
Only thing to consider, is whether the serializer is able to reliably DEserialize messages from byte[]
to a message object without the encoding info.... but I guess you just want to default to UTF-8?
For my scenario I can default to UTF-8, yes.
In my opinion, the content_encoding property of a message is in charge of that. I am a little irritated why both, the content_type and the content_encoding property are stringed together in the content_type:
Is that what you ment I could achieve by replacing the serializer?
Ah! In this case, what you're dissatisfied with, is how Rebus' RabbitMQ transport maps the rbs2-content-type
header to RabbitMQ's built-in header fields, because it simply puts the same value there.
It never occurred to me that RabbitMQ has separate headers for type and encoding, but since this is the case I believe it would make sense to change how Rebus sets those headers.
Since Rebus does not use RabbitMQ's header properties when receiving incoming messages (it uses its own header), it would be a straightforward change to these few lines.
fixed in Rebus.RabbitMq 5.2.0, which is on Nuget.org now 🙂
Hi! First at all, awesome project!
I'm using Rebus and Rebus.RabbitMq (5.1.3) with .NET Core 2.2. One question concerning the
content_type
of a rmq message, which isapplication/json;charset=utf-8
by default. Can I change this to justapplication/json
? Thanks!