Skip to content

MessagePack support #30

@Som-Som-CC

Description

@Som-Som-CC

MessagePack (a.k.a. msgpack) is a great data interchange format. It is often cited as binary JSON. Flexible like JSON, but more efficient. Not as snappy as Protocol Buffers/gRPC, but more flexible and still fast.

The aim of this enhancement:

  • As a client send request payload as JSON, in the meanwhile add Accept header indicating the server that the client supports msgpack, if client.MsgPack(true) was called.
  • As a client be able to process msgpack responses, if MIME type is application/msgpack.
  • As a server be able to decode msgpack payload, if MIME type is application/msgpack.
  • As a server prefer sending response encoded as msgpack, if Accept header indicates support. Otherwise use JSON.

Go standard JSON library uses "json" tagging. The msgpack package chosen must be able to use that tagging for smooth interworking.

sequenceDiagram
note over C: MessagePack discovery phase
C->>S: POST: CT:application/json, Accept:application/msgpack,application/json, body=JSON
S->>C: 201: CT=application/msgpack, body=msgpack
note over C: MessagePack is known to be supported
C->>S: PUT: CT:application/msgpack, Accept:application/msgpack,application/json, body=msgpack
S->>C: 200: CT=application/msgpack, body=msgpack

Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions