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
Issue 116 - Header Propagation Part 2 #149
Conversation
Signed-off-by: Andy McCright <j.andrew.mccright@gmail.com>
|
Issue tracker reference: |
1 similar comment
|
Issue tracker reference: |
| * {@link DefaultClientHeadersFactoryImpl} will be used. This implementation will simply propagate headers (specified via MP Config property) | ||
| * from an inbound JAX-RS request (if applicable) to the outbound request. | ||
| * <p> | ||
| * If a ClientHeadersFactory listed is not found on the classpath, it is ignored. |
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.
Why do we want to ignore factory classes that are not available on classpath?
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.
That line is intended to describe an error path behavior. For example, if a user has a rest client interface like:
@RegisterClientHeaders(MyMissingHeaderFactory.class)
public interface MyServiceWithMissingHeaderFactory { ...
and MyMissingHeaderFactory is not packaged with the app - and the implementation cannot find/load it - then the behavior would be to continue the request without invoking the default client headers factory. Ideally the implementation would also log a warning.
We could change this behavior so that if the class is missing, then we would throw a deployment exception - preventing the rest client instance from being created? I am fine either way.
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 haven't looked at implementing it yet but I think from the user perspective it would be better if it failed with an exception. It should speed up spotting the problem.
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.
Sounds good. I'll update and submit a new commit with this change.
|
@andymc12 I don't fully understand what does "TCK does not test JAX-RS header propagation" mean. |
Sure - it just means that the TCK tests a custom implementation of the the The test case that I used in CXF has not been merged yet, but you can see it in my branch at: Thanks! |
Also adding test for custom ClientHeadersFactory. Signed-off-by: Andy McCright <j.andrew.mccright@gmail.com>
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.
Think it looks good, maybe just change copyright year to 2019?
Signed-off-by: Andy McCright <j.andrew.mccright@gmail.com>
|
Good catch @kenfinnigan ! I've updated the copyright dates to be 2019. Thanks for the review! |
This should complete issue #116 - it adds the
@RegisterClientHeadersannotation (by default this will propagate all opted-in JAX-RS headers specified via MP Config property) and theClientHeadersFactoryinterface that a user could implement to generate headers themselves.It includes TCK tests and spec updates. Note that the TCK does not test JAX-RS header propagation (it does test custom
ClientHeadersFactoryimplementations) - the reason for this is because that would add dependencies on a JAX-RS server implementation - and would complicate the test environment. I have verified that my local CXF implementation will propagate JAX-RS headers (using CXF in Jetty as the JAX-RS server).Signed-off-by: Andy McCright j.andrew.mccright@gmail.com