Message-associated Metadata Values are now of type JsonElement after v5 update
See original GitHub issueHey! It’s me again (:
Just stumbled upon a bug in the library, which was introduced with v5. I assume this is related to the migration from Newtonsoft.Json
to System.Text.Json
.
Despite Messages/SyncRequests Metadata
being of type Dictionary<string, object>
, these object
s actually seem to be JsonElement
s.
While previously we could simply cast them to the desired type straight away (for example using (string)
), we are now forced to cast them to JsonElement
first, then to do something like .GetString()
if we are expecting a string
:
string commandName = ((JsonElement)message.Metadata["cmd"]).GetString()!;
I doubt this is intended (since it didn’t work that way before the migration), and if it is then it surely would be clearer to have them as JsonElement
straight away, instead of object
.
Issue Analytics
- State:
- Created 10 months ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Reactive Messaging RabbitMQ Connector Reference ...
The connector converts incoming RabbitMQ Messages into Reactive Messaging Message<T> instances. The payload type T depends on the value of the RabbitMQ received ......
Read more >RabbitMQ - SmallRye Reactive Messaging
The connector converts incoming RabbitMQ Messages into Reactive Messaging Message<T> instances. The payload type T depends on the value of the RabbitMQ received ......
Read more >data-specification/hapi-dev/HAPI-data-access-spec- ...
Server attributes are described using keyword-value pairs, with the required and optional keywords described in the following table. About Object. Name, Type ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Likewise Matt, much appreciated! Cheers
Sounds good to me.
Well, I guess we’re (finally) done then!
Thanks a ton for your work on all of this, Joel. It was a pleasure (: