Skip to content
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

Add protobuf MessageConverter #24087

Closed
wants to merge 1 commit into from

Conversation

@parviz-93
Copy link
Contributor

parviz-93 commented Nov 26, 2019

PR for #24022.

Should I add this converter to ...?

  • SimpAnnotationMethodMessageHandler
  • AbstractMessageBrokerConfiguration
  • MessageBrokerBeanDefinitionParser

I found that other converters are used in these classes.

Copy link
Contributor

rstoyanchev left a comment

Protobuf 2 is more than 5 years old, so for this converter being added I think we should focus on Protobuf 3+ along with the official protobuf-java-util. In other words eliminate anything related to protobuf-java-format.

/cc @sdeleuze @jhoeller for comment.

@parviz-93

This comment has been minimized.

Copy link
Contributor Author

parviz-93 commented Nov 27, 2019

if we want eliminate anything related to protobuf-java-forma and support official protobuf-java-util, do we need ProtobufFormatSupport interface ?

methodCache.put(clazz, method);
}
return (Message.Builder) method.invoke(clazz);
} catch (Exception ex) {

This comment has been minimized.

Copy link
@rstoyanchev

rstoyanchev Nov 27, 2019

Contributor

Correct the braces throughout, please :)

This comment has been minimized.

Copy link
@parviz-93

parviz-93 Nov 28, 2019

Author Contributor

Sorry. it is my first contribution to spring. thanks for correcting me

@rstoyanchev

This comment has been minimized.

Copy link
Contributor

rstoyanchev commented Nov 27, 2019

Indeed we could simplify a bit by removing ProtobufFormatSupport, but I would still keep ProtobufJavaUtilSupport as is so that it's easy to compare to ProtobufHttpMessageConverter which we have to maintain in parallel.

@parviz-93

This comment has been minimized.

Copy link
Contributor Author

parviz-93 commented Nov 28, 2019

I’m doing new commits so that you can see what I fixed, at the end I’ll collect in one commit.

@rstoyanchev

This comment has been minimized.

Copy link
Contributor

rstoyanchev commented Nov 28, 2019

This looks much better. Feel free to squash the commits, I'm only looking for the end result.

In terms of your other question about where to add the converter to, I'd say in AbstractMessageBrokerConfiguration and MessageBrokerBeanDefinitionParser (i.e. the Java and XML config).

@parviz-93 parviz-93 force-pushed the parviz-93:#24022-protobuf branch from 6a1b36f to 7a16cff Nov 28, 2019
@sbrannen sbrannen changed the title #24022 - added protobuf MessageConverter Add protobuf MessageConverter Nov 29, 2019
rstoyanchev added a commit that referenced this pull request Nov 29, 2019
@rstoyanchev

This comment has been minimized.

Copy link
Contributor

rstoyanchev commented Nov 29, 2019

@parviz-93 thanks so much for your contribution and following through with the changes! This is now merged in. I ended up making a few further changes, adding a sub-class of the protobuf converter (just like in spring-web) because if it all came in one converter, the JSON format support wouldn't be optional. As a consequence I also decided to pull out the automatic registration in Java and XML config.

@parviz-93

This comment has been minimized.

Copy link
Contributor Author

parviz-93 commented Nov 29, 2019

Thank you very much for your help and advice.

@parviz-93 parviz-93 deleted the parviz-93:#24022-protobuf branch Nov 30, 2019
@onlybytes

This comment has been minimized.

Copy link

onlybytes commented Nov 30, 2019

This was quick. Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.