Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add @Priority annotations to container request/response #139

Merged
merged 2 commits into from
Feb 23, 2016

Conversation

jplock
Copy link
Member

@jplock jplock commented Feb 21, 2016

Ensure the container request is executed first (Priority 0) and the container response is executed last (also Priority 0)

See https://jersey.java.net/documentation/latest/filters-and-interceptors.html#d0e10117 for more details

Resolves #134

@janolaveide
Copy link

What about the client filters ? Same here surely ?

@jplock
Copy link
Member Author

jplock commented Feb 21, 2016

@janolaveide I wasn't sure if you could set them on the client filters. I'll add them anyway.

@@ -37,6 +37,11 @@
<version>1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious.. this matches servlet 2.5, right? If so, maybe make a comment that it does (so that someone changing below doesn't invalidate this)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or if it has nothing to do with any of the dependencies here, ignore my comment :P

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's related. I had to add this dependency to get access to the @Priority annotation as it wasn't available in any of the other dependencies.

@codefromthecrypt
Copy link
Member

is there any way to test this? (ex show it prevents a bug)

@jplock
Copy link
Member Author

jplock commented Feb 23, 2016

I'm trying to think how we could test this. We'd need to create a set of filters that would inspect the zipkin information show how to ensure its being included in the request I'd imagine.

@janolaveide
Copy link

Not sure what you want to test, testing that it actually executes first ? I haven't looked at the actual test cases you have in brave, but in my manual testing I add a time-consuming filter with priority > 1 and verifies that brave timing reflects this.

@codefromthecrypt
Copy link
Member

sounds sufficiently tricky to automatically test at the moment. Thanks for manual testing.

codefromthecrypt pushed a commit that referenced this pull request Feb 23, 2016
Add @priority annotations to container request/response
@codefromthecrypt codefromthecrypt merged commit 6ce4ce0 into openzipkin:master Feb 23, 2016
@jplock jplock deleted the jp-gh134 branch February 23, 2016 12:40
@kristofa
Copy link
Member

kristofa commented Mar 6, 2016

This change is released as part of brave 3.5.0

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

Successfully merging this pull request may close these issues.

4 participants