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
Conversation
d711343
to
c698376
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...essaging/src/main/java/org/springframework/messaging/converter/ProtobufMessageConverter.java
Show resolved
Hide resolved
...essaging/src/main/java/org/springframework/messaging/converter/ProtobufMessageConverter.java
Show resolved
Hide resolved
...essaging/src/main/java/org/springframework/messaging/converter/ProtobufMessageConverter.java
Show resolved
Hide resolved
...essaging/src/main/java/org/springframework/messaging/converter/ProtobufMessageConverter.java
Show resolved
Hide resolved
...ging/src/test/java/org/springframework/messaging/converter/ProtobufMessageConverterTest.java
Show resolved
Hide resolved
if we want eliminate anything related to protobuf-java-forma and support official |
methodCache.put(clazz, method); | ||
} | ||
return (Message.Builder) method.invoke(clazz); | ||
} catch (Exception ex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the braces throughout, please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. it is my first contribution to spring. thanks for correcting me
Indeed we could simplify a bit by removing |
I’m doing new commits so that you can see what I fixed, at the end I’ll collect in one commit. |
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 |
6a1b36f
to
7a16cff
Compare
@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. |
Thank you very much for your help and advice. |
This was quick. Thanks a lot |
PR for #24022.
Should I add this converter to ...?
SimpAnnotationMethodMessageHandler
AbstractMessageBrokerConfiguration
MessageBrokerBeanDefinitionParser
I found that other converters are used in these classes.