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

Using @Transactional on a method annotated with @Incoming should add @Blocking if not present #21795

Closed
cescoffier opened this issue Nov 29, 2021 · 9 comments · Fixed by #21889
Assignees
Labels
Milestone

Comments

@cescoffier
Copy link
Member

Description

When a method annotated with @Incoming is also annotated with @Transactional, it should automatically add @Blocking is no blocking annotations (from SmallRye common and Reactive Messaging) are used.

Implementation ideas

  1. Detect that configuration
  2. Add the annotation
  3. Implement tests
  4. Document
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 29, 2021

@cescoffier cescoffier self-assigned this Nov 29, 2021
@geoand
Copy link
Contributor

geoand commented Nov 30, 2021

Didn't @stuartwdouglas have something like this as well?

@stuartwdouglas
Copy link
Member

It was specific to RESTEasy Reactive

@geoand
Copy link
Contributor

geoand commented Dec 1, 2021

Ah, OK

@mkouba
Copy link
Contributor

mkouba commented Dec 1, 2021

It was specific to RESTEasy Reactive

Maybe this should be implemented in the quarkus-narayana-jta instead? It would not hurt to add @Blocking on every method annotated with @Transactional, or?

@cescoffier
Copy link
Member Author

+1 to @mkouba proposal. It would cover most cases.

@stuartwdouglas
Copy link
Member

How would we actually implement that though, as @Blocking is processed by lots of different extensions.

@cescoffier
Copy link
Member Author

That is a good point. Even if it adds the @Blocking annotation it would need to update the index before the other extensions look for the beans. I think, for now, we would need to do it in each individual extension.

@mkouba
Copy link
Contributor

mkouba commented Dec 2, 2021

How would we actually implement that though, as @Blocking is processed by lots of different extensions.

All those extensions can leverage the ArC transformers API, i.e. instead of looking at the index consumer the io.quarkus.arc.deployment.TransformedAnnotationsBuildItem and then analyze the result of TransformedAnnotationsBuildItem.getAnnotations(AnnotationTarget).

CC @cescoffier

@quarkus-bot quarkus-bot bot added this to the 2.6 - main milestone Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants