Skip to content

MessagePack protocol preview.1 (5.10.0 + AspNetCore 1.6.0)

Pre-release
Pre-release

Choose a tag to compare

@Daniel-Svensson Daniel-Svensson released this 17 Jun 04:09
· 1 commit to main since this release
7f76a94

AspNetCore 1.6.0

  • Added MessagePack wire-format support (application/vnd.msgpack) via #591

Enable MessagePack on the server

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenRiaServices()
    .AddMessagePackSerialization();

Optionally pass a custom Nerdbank.MessagePack.MessagePackSerializer to add converters or a custom comparer provider:

builder.Services.AddOpenRiaServices()
    .AddMessagePackSerialization(opt =>
    {
        opt.Serializer = new Nerdbank.MessagePack.MessagePackSerializer()
        {
            // custom converters / comparer provider
        };
    });

Client (OpenRiaServices.Client.DomainClients.Http)

  • Added MessagePackHttpDomainClientFactory — a DomainClientFactory that communicates with the server using MessagePack over HTTP

Enable MessagePack on the client

DomainContext.DomainClientFactory =
    new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory);

Optionally pass a custom serializer:

var serializer = new MessagePackSerializer()
{
    // custom converters / comparer provider
};

DomainContext.DomainClientFactory =
    new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory, serializer);

For performance benchmark data see PR #591.

What's Changed