Elegant way to check if HTTP request is active #45196
Unanswered
PrzemyslawMotala
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm looking for an elegant way to check if HTTP request is active in Quarkus. I'm currently using this code (with quarkus-undertow):
But this solution is not very clean - I have to catch an
IllegalStateException: UT000048: No request is currently active
to verify if the request is active. In Weld it was possible to check this via a solution provided in https://stackoverflow.com/questions/49403718/clean-way-of-injecting-checking-for-presence-of-a-httpservletrequest-with-cdi-fr with use ofcontext instanceof HttpRequestContext
.Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions