Skip to content

Spring REST @MVC: Add support for google Protocol Buffers resource representation format [SPR-5807] #10477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jun 5, 2009 · 4 comments
Assignees
Labels
has: votes-jira Issues migrated from JIRA with more than 10 votes at the time of import in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 5, 2009

Keith Donald opened SPR-5807 and commented

Google Protocol buffers provide a mature, high-performant binary data exchange protocol that can be used a an alternative to JSON and XML to connect systems over a REST interface. Benchmarks outlined by by Orbitz and Sears at JavaOne 2009 have shown that marshaling using protocol buffers is up to 7 to 10 times faster than JSON. This would make them a good, lightweight choice for Java-to-Java remoting over HTTP/REST.

This ticket should investigate adding support for Google protocol buffers on the server-side side with Spring @MVC, and on the client-side with REST-template possibly with some sort of dynamic proxy layer on top.

See http://code.google.com/apis/protocolbuffers/ for the Google Protocol Buffers project home page.


Affects: 3.0 M3

Issue Links:

Referenced from: commits b56703e

15 votes, 21 watchers

@spring-projects-issues
Copy link
Collaborator Author

Mingfai Ma commented

+1, maybe implement the Protocol Buffer transport for Spring Remoting / HTTP Invoker first.

@spring-projects-issues
Copy link
Collaborator Author

Alex Antonov commented

Added a pull-request for the Converter implementation (might need some tweaking to better fit the Spring programming model) - #577

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Moving to RC2 since we didn't get enough time to integrate with our build system.

@spring-projects-issues
Copy link
Collaborator Author

Brian Clozel commented

I've cleaned a bit the protobuf PR, and 3 questions remain:

Supported media types

I'm wondering if we should also support *+json / *+xml or if custom mediatypes don't make sense in that case

Content-Length HTTP response header

I've deleted the getContentLength method implementation because:

  • it requires to serialize twice the same message - this is a performance issue
  • we're doing the same thing anyway for Jackson and other message converters
  • I did not find anything saying that Protobuf implementations don't support chunked encoding
  • using a ShallowEtagFilter is a known workaround for this

Gradle build

I've checked in message classes generated by the protoc - I know this is a bad practice, but I'm trying here not to introduce some hard system requirement for all contributors. I've created a profile that can be used to re-generate those. I know that Alex Antonov's gradle protobuf plugin can write those generated files in another folder, but it looks like Gradle got confused with inputs/ouputs when trying to write those directly in our src folder. In any case, Alex Antonov and robwinch, maybe do you have ideas to make this part of the gradle build look better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: votes-jira Issues migrated from JIRA with more than 10 votes at the time of import in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants