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

IServerInterceptor.incomingRequestPreHandled gets called twice when serving single request #532

Closed
mattiuusitalo opened this Issue Dec 27, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@mattiuusitalo

mattiuusitalo commented Dec 27, 2016

We are using hapi-fhir-jpaserver-base/2.1 currently. When a request is handled, first this happens.
image

After ProfileInterceptor handles the request it goes to resource providers which call all the registered IServerInterceptors again, like so:
image

Our code is based on the JPA server example. Is this normal? How can we avoid our IServerInterceptors processing the same requests twice?

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Jan 9, 2017

Owner

Hi @mattiuusitalo : Thanks for reporting!

I was able to reproduce this in a unit test.. A few things:

  • Do you have your interceptor registered with both the RestfulServer and the DaoConfig, or just the DaoConfig? If you have it against both, you'll always get a double call. I should probably make this clear in the documentation. Will fix.
  • Even if you only have the interceptor registered against the RestfulServer you'll still get a double call if your client performs a FHIR transaction operation. Will fix.
Owner

jamesagnew commented Jan 9, 2017

Hi @mattiuusitalo : Thanks for reporting!

I was able to reproduce this in a unit test.. A few things:

  • Do you have your interceptor registered with both the RestfulServer and the DaoConfig, or just the DaoConfig? If you have it against both, you'll always get a double call. I should probably make this clear in the documentation. Will fix.
  • Even if you only have the interceptor registered against the RestfulServer you'll still get a double call if your client performs a FHIR transaction operation. Will fix.

jamesagnew added a commit that referenced this issue Jan 10, 2017

@mattiuusitalo

This comment has been minimized.

Show comment
Hide comment
@mattiuusitalo

mattiuusitalo Jan 10, 2017

We are registering the interceptors with RestfulServer.registerInterceptor method. As far as I know they are only registered against the Restfulserver.

mattiuusitalo commented Jan 10, 2017

We are registering the interceptors with RestfulServer.registerInterceptor method. As far as I know they are only registered against the Restfulserver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment