Class ProtobufHttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<com.google.protobuf.Message>
org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter
All Implemented Interfaces:
HttpMessageConverter<com.google.protobuf.Message>
Direct Known Subclasses:
ProtobufJsonFormatHttpMessageConverter

public class ProtobufHttpMessageConverter extends AbstractHttpMessageConverter<com.google.protobuf.Message>
An HttpMessageConverter that reads and writes com.google.protobuf.Messages using Google Protocol Buffers.

To generate Message Java classes, you need to install the protoc binary.

This converter supports by default "application/x-protobuf" and "text/plain" with the official "com.google.protobuf:protobuf-java" library. The "application/json" format is also supported with the "com.google.protobuf:protobuf-java-util" dependency. See ProtobufJsonFormatHttpMessageConverter for a configurable variant.

This converter requires Protobuf 3 or higher as of Spring Framework 6.1.

Since:
4.1
Author:
Alex Antonov, Brian Clozel, Juergen Hoeller, Sebastien Deleuze
See Also: