You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The IPAddress class doesn't play nice with serialization (which is why I chose it as an example). When I want to serialize this to JSON I use a JsonConverter:
I have searched online and looked thru the github issues / discussions. Unless I'm blind I couldn't find an answer.
(Yes, I know I could store the IP as string in the message in the first place, that's not the point though)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Suppose I have a message
ClientRegistered
:The
IPAddress
class doesn't play nice with serialization (which is why I chose it as an example). When I want to serialize this to JSON I use a JsonConverter:This works (live demo here):
Output:
Now, how would I configure my producers/consumers to use this JsonConverter?
I have searched online and looked thru the github issues / discussions. Unless I'm blind I couldn't find an answer.
(Yes, I know I could store the IP as string in the message in the first place, that's not the point though)
Beta Was this translation helpful? Give feedback.
All reactions