-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Updating ServerInterceptors.java to support different marshallers for Request and Response messages. #9877
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
Conversation
|
|
…s.java to support different marshallers for Request and Response messages.
…d unnecessary code that deals with bytes-string conversion.
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.
I expect in the future we'd want to have null
marshaller mean "don't replace that marshaller." But that can be added in the future because this NPE's now in that case.
That style of test isn't my favorite, but it is mirroring the existing test for this, so is fair.
Note for posterity: the encryption case here is a bit awkward because reflection and other tooling won't know about the shenanigans. There's ways to work around some of that, but they'd introduce some of their own interesting behavior. So I think the encryption case here is "a successful hack that may work well in limited situations." But it isn't something I'd expect to be supported in other languages or to encourage widely. So I'm not condoning this use-case, really, but would rather this than abusing Compressor. I'm okay with this API though because it does make sense to be able to change the marshaller for request separately from response. Especially in the case where you only want to replace one (which falls into the But I also think this API should be extremely rarely used. |
@YifeiZhuang, friendly ping. |
Updating ServerInterceptors to support different marshallers for requests and responses.
See #9870 for more details.