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

Provide ContainerRequestContext to decorateResponse #135

Open
hypnoce opened this issue Jan 5, 2020 · 10 comments · May be fixed by #136
Open

Provide ContainerRequestContext to decorateResponse #135

hypnoce opened this issue Jan 5, 2020 · 10 comments · May be fixed by #136

Comments

@hypnoce
Copy link
Contributor

hypnoce commented Jan 5, 2020

There are scenarios where information held in the ContainerRequestContext need to be accessed in the decorateResponse method (properties, uriInfo...).
Do you see any value into adding the ContainerRequestContext in the decorateResponse response arguments ?
Thanks

hypnoce pushed a commit to hypnoce/java-jaxrs that referenced this issue Jan 5, 2020
@pavolloffay
Copy link
Collaborator

Can you please describe your use-case/ what information is needed to be accessed from ContainerRequestContext?

@hypnoce
Copy link
Contributor Author

hypnoce commented Jan 6, 2020

I'm trying to get the path parameters through the URI info as well as some properties that were set using requestContext.setProperty(). I could create another filter and make sure it's priority comes just after the ServerTracingFilter priority. But using the span decorator is a more robust method.

@pavolloffay
Copy link
Collaborator

Why decorateRequest does not work

void decorateRequest(ContainerRequestContext requestContext, Span span);

it is passing in the ContainerRequestContext

@hypnoce
Copy link
Contributor Author

hypnoce commented Jan 7, 2020

There are some information injected in the request via setProperty that I need to access after the query is processed. Also I need to know the status code as well as the uriinfo at the same time.

@hypnoce
Copy link
Contributor Author

hypnoce commented Jan 13, 2020

Hey @pavolloffay any news on this ? Thanks.

@pavolloffay
Copy link
Collaborator

This is pity because we have just released 1.0 and this is breaking change.

We will have to overload the response method and deprecate the old one.

@hypnoce
Copy link
Contributor Author

hypnoce commented Jan 13, 2020

Indeed.
If we could use default method in interface, we could have made the transition smoother without breaking the API. Is it intended to be java 1.6 ?
Thanks

@pavolloffay
Copy link
Collaborator

It's already released. We build this against java 1.7.

@hypnoce
Copy link
Contributor Author

hypnoce commented Jan 13, 2020

A sorry yes I meant java8.

@pavolloffay
Copy link
Collaborator

That should be fine, it's backward compatible.

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

Successfully merging a pull request may close this issue.

2 participants