Skip to content

Commit

Permalink
Add MessagePack formatter and resolver for OrleansExtension
Browse files Browse the repository at this point in the history
Added a new MessagePack formatter and resolver to support serialization in OrleansExtension.
  • Loading branch information
0xF6 committed Dec 4, 2024
1 parent b4badf0 commit 5ddda48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Argon.Api/Features/Orleanse/OrleansExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace Argon.Features;

using ActualLab.Serialization;
using Env;
using MessagePack.Formatters;
using MessagePack.Resolvers;
using Orleans.Clustering.Kubernetes;
using Orleans.Configuration;
Expand All @@ -17,7 +18,8 @@ public static WebApplicationBuilder AddOrleans(this WebApplicationBuilder builde
{
var options = MessagePackSerializerOptions.Standard
.WithResolver(CompositeResolver.Create(
DynamicEnumAsStringResolver.Instance,
DynamicEnumAsStringResolver.Instance,
EitherFormatterResolver.Instance,
StandardResolver.Instance));
MessagePackSerializer.DefaultOptions = options;
builder.Services.AddSerializer(x => x.AddMessagePackSerializer(null, null, MessagePackSerializer.DefaultOptions));
Expand Down

0 comments on commit 5ddda48

Please sign in to comment.