Class ProtobufHttpMessageWriter

java.lang.Object
org.springframework.http.codec.EncoderHttpMessageWriter<com.google.protobuf.Message>
org.springframework.http.codec.protobuf.ProtobufHttpMessageWriter
All Implemented Interfaces:
HttpMessageWriter<com.google.protobuf.Message>

public class ProtobufHttpMessageWriter extends EncoderHttpMessageWriter<com.google.protobuf.Message>
HttpMessageWriter that can write a protobuf Message and adds X-Protobuf-Schema, X-Protobuf-Message headers and a delimited=true parameter is added to the content type if a flux is serialized.

For HttpMessageReader, just use new DecoderHttpMessageReader(new ProtobufDecoder()).

Since:
5.1
Author:
Sebastien Deleuze
See Also:
  • Constructor Details

    • ProtobufHttpMessageWriter

      public ProtobufHttpMessageWriter()
      Create a new ProtobufHttpMessageWriter with a default ProtobufEncoder.
    • ProtobufHttpMessageWriter

      public ProtobufHttpMessageWriter(Encoder<com.google.protobuf.Message> encoder)
      Create a new ProtobufHttpMessageWriter with the given encoder.
      Parameters:
      encoder - the Protobuf message encoder to use
  • Method Details