rebus-org / Rebus

:bus: Simple and lean service bus implementation for .NET
https://mookid.dk/category/rebus
Other
2.31k stars 361 forks source link

System.Collections.Generic.KeyNotFoundException: Could not find the key 'rbs2-content-type' when deserializing messages. #690

Closed MaikuMori closed 6 years ago

MaikuMori commented 6 years ago

I've been trying some strange combination of microservices with different targets (netstandard2, mono-net471, net471)

There seems to be a bug with mono and/or netstandard2.

Correct me if I'm wrong but I believe it's here:

https://github.com/rebus-org/Rebus/blob/master/Rebus/Serialization/Json/JsonSerializer.cs#L76

There is a chance that the header is not defined, but here it's being read in any case:

https://github.com/rebus-org/Rebus/blob/master/Rebus/Serialization/Json/JsonSerializer.cs#L95

mookid8000 commented 6 years ago

oh, good catch! – I'll fix it right away....

(btw I assume it's Rebus 5.0.0-b06 you're using.... it'll be fixed in 5.0.0-b07 in a few minutes)

mookid8000 commented 6 years ago

I caught some more conditional compilation issues introduced when I added .NET Core 2 as a target.... it's out in 5.0.0-b08

Thanks for raising this issue 👍

MaikuMori commented 6 years ago

Awesome!

sune-monrad commented 4 years ago

Could it be that this issue still exists in 5.2? seems that knuth is still throwing an error when rbs2-content-type is not present in the header. rbs2-msg-id is available.

mookid8000 commented 4 years ago

Could you post a full stacktrace with the error, you're experiencing?

That would help a lot 🙂