Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time

Routing Metadata Extension

This extension specification is currently incubating. While incubating the version is 0.


When two system are communicating via RSocket, there are often logical divisions in the messages that are sent from the requester to the responder. These logical divisions can often be implemented by the responder as "routes" for messages to be sent to. This extension specification provides an interoperable structure for metadata payloads to contain routing information. It is designed such that an arbitrary collection of tags (strings) can be used by the responder to route messages and any individual tag (or all included tags) can be ignored.

Metadata Payload

This metadata type is intended to be used per stream, and not per connection nor individual payloads and as such it MUST only be used in frame types used to initiate interactions. This includes REQUEST_FNF, REQUEST_RESPONSE, REQUEST_STREAM, and REQUEST_CHANNEL. The Metadata MIME Type is message/x.rsocket.routing.v0.

Metadata Contents

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    |  Tag Length   |              Tag                             ...
    |  Tag Length   |              Tag                             ...
  • Tag Payload: Any number of complete tag payloads.
    • Tag Length: (8 bits = max value 2^8-1 = 255) Unsigned 8-bit integer of Tag Length in bytes.
    • Tag: UTF-8 encoded Token used for routing. The string MUST NOT be null terminated. Examples include URI path-style routes (/person/1, /address), dot-separated convention ("person.1"), or any other format (ios-client, android-client).