-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ServiceTransportType.Persistent in Management SDK breaks enum serialization #1219
Comments
Could you provide the version of Management SDK and the function app project? |
I cannot share the entire project file but here's an excerpt. We're running on .NET Core 3.1.
|
the json serializer is changed to System.Text.Json in function v3 and .Net Core 3.1, please use:
|
I'm not using output binding but
But for the Persistent transport there is some more low-level SignalR stuff happening in the SDK so it's not clear how to control serialization for this case, because I don't see any JSON serialization there. |
Persistent transport reuse |
Yeah, for now we switched back to Transient mode. It'd be great to get JSON configuration exposed moving forward. Looking forward to it! |
Hi @wanlwanl any updates on progress of message serialization settings? |
@SebastianBienert We have added a method to customize the message serialization for both two modes. But the method is not public now. Will make it public for the next release. |
I'm using Management SDK in Azure Function to send messages back to our SignalR clients. Recently we switched to
ServiceTransportType.Persistent
(websocket) in the SDK to improve performance, but then messages arriving on the client side had Enums serialized as integers rather than strings, despite our Newtonsoft.Json settings. When usingServiceTransportType.Transient
transport everything was working fine and our JSON settings were properly respected.Please note since there is no way to configure Newtonsoft.Json in
ServiceManagerBuilder
currently, we are configuring it globally in functionStartup
class in the following manner:This has worked perfectly find with 'transient' transport, so for example the below enum:
was serialized as
"SignalLost"
, but after switching to 'persistent' transport it's serialized as0
.The text was updated successfully, but these errors were encountered: