Spring-boot: Support CBOR codec for RSocket

Created on 13 May 2019  路  1Comment  路  Source: spring-projects/spring-boot

As of spring-projects/spring-framework#22767, Spring Framework supports CBOR as a codec for single values. This binary format is a good candidate for default inclusion with the RSocket starter.

Hey @sdeleuze @rstoyanchev

  1. is this codec ready for such a commitment on both client and server for RSocket? It seems that it's not the case yet for WebFlux (see spring-projects/spring-framework/issues#20513).

  2. Right now, Jackson+JSON is the default codec configured as an RSocket strategy.
    Looking at the current behavior in DefaultRSocketRequesterBuilder, it seems that the requester is choosing automatically the first concrete media type. Should Spring Boot consider auto-configuring a single codec then (i.e. should we remove JSON and have CBOR instead)?

enhancement

Most helpful comment

Discussed this with the Spring Framework team and:

  1. this codec is ready for production use; the single value support is fine for RSocket, since the protocol itself is splitting elements with payload frames
  2. RSocket is well suited for binary formats, so I've configured this codec ahead of the JSON one. Developers can always use the RSocketRequester.Builder to select the MimeType of their choice.

>All comments

Discussed this with the Spring Framework team and:

  1. this codec is ready for production use; the single value support is fine for RSocket, since the protocol itself is splitting elements with payload frames
  2. RSocket is well suited for binary formats, so I've configured this codec ahead of the JSON one. Developers can always use the RSocketRequester.Builder to select the MimeType of their choice.
Was this page helpful?
0 / 5 - 0 ratings