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
@ThreadContextConfig does not work in Quarkus #22645
Comments
@manovotn do you think you can try to make that work in Quarkus? IIRC it used to work in SR as a CDI extension, which wasn't supported in ArC at the time. Perhaps that's changed, or we can find other ways to make it work? |
Yea, this wasn't possible back then but should be doable now. We just didn't get to it since. I won't be able to jump onto this right away but can add it to my TODO list. The logic implementing this for pure MP is inside SmallryeContextCdiExtension so we'll need to add an equivalent using Quarkus tooling. The crux of it is that we need to read all the injection points which have Ccing @Ladicek and @mkouba just in case one of them feels like implementing this before I can get to it :) |
OT: I wonder if we could add an |
Btw. the javadoc mentions using |
This won't work in Quarkus as it's not implemented same as the original annotation. This is because
@rvansa almost spot on - the javadoc of |
@mkouba I created area/context-propagation . I'll let you add the rules you want here: https://github.com/quarkusio/quarkus/blob/main/.github/quarkus-bot.yml . Even if you don't add a pattern for the title, it's still useful to have the bot ping the appropriate persons when we add the label and remove the needs-triage one. |
@manovotn Thanks, so I got the failure because the I personally find a bit confusing the I'd have @ThreadContextConfig(...)
public interface MyCustomThreadContext extends ThreadContext {} |
Yes
That seems like an oversight, I don't really see any realistic usage for that.
This feature is not within the scope of MP specification so we can change it. I simply implemented this as a nice to have feature that optionally enables sharing of instances but to have it in CDI-friendly way, this was probably the best I could come up with back in the day. |
I will look into implementing this |
Describe the bug
While it is documented in https://quarkus.io/guides/context-propagation annotating
does not work - the annotation seems to be ignored and all context is propagated.
Expected behavior
This annotation should work as documented in the guide https://quarkus.io/guides/context-propagation , e.g. not propagate transaction context when this is supposed to be cleared.
Actual behavior
All contexts are propagated.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.3.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Workaround exists:
The text was updated successfully, but these errors were encountered: