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

kafka-panache-reactive-quickstart fails after #27802 #27873

Closed
rsvoboda opened this issue Sep 12, 2022 · 10 comments
Closed

kafka-panache-reactive-quickstart fails after #27802 #27873

rsvoboda opened this issue Sep 12, 2022 · 10 comments
Labels
Milestone

Comments

@rsvoboda
Copy link
Member

rsvoboda commented Sep 12, 2022

Describe the bug

kafka-panache-reactive-quickstart fails after #27802 got merged, CC @ozangunalp

#27802 is breaking change and there is no information in https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.13

Proposal:

  • update Migration-Guide-2.13
  • indicate which class could use @ActivateRequestContext to fix the trouble
    (Assuming that we really need @ActivateRequestContext)

Error I receive is

2022-09-12 15:39:32,734 ERROR [io.sma.rea.mes.provider] (vert.x-eventloop-thread-4) SRMSG00201: Error caught while processing a message: javax.enterprise.context.ContextNotActiveException: RequestScoped context was not active when trying to obtain a bean instance for a client proxy of PRODUCER_METHOD bean [class=io.quarkus.hibernate.reactive.runtime.ReactiveSessionProducer, id=37346551fd6c9e87c80f25842d68c2d902107673]
	- you can activate the request context for a specific method using the @ActivateRequestContext interceptor binding
	at io.quarkus.arc.impl.ClientProxies.getDelegate(ClientProxies.java:53)

I can get the test passing when I adjust https://github.com/quarkusio/quarkus-quickstarts/blob/main/kafka-panache-reactive-quickstart/src/main/java/org/acme/panache/PriceStorage.java#L15 but the QS is small so it was easy to find the right class and method to annotate

--- a/kafka-panache-reactive-quickstart/src/main/java/org/acme/panache/PriceStorage.java
+++ b/kafka-panache-reactive-quickstart/src/main/java/org/acme/panache/PriceStorage.java
@@ -6,12 +6,14 @@ import io.smallrye.reactive.messaging.annotations.Blocking;
 import org.eclipse.microprofile.reactive.messaging.Incoming;

 import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.control.ActivateRequestContext;
 import javax.transaction.Transactional;

 @ApplicationScoped
 public class PriceStorage {

     @Incoming("prices")
+    @ActivateRequestContext
     Uni<Void> store(int priceInUsd) {
         Price price = new Price();
         price.value = priceInUsd;

Expected behavior

Tests pass

Actual behavior

Tests fail

How to Reproduce?

Output of uname -a or ver

macOS Monterey

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus main

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@rsvoboda rsvoboda added the kind/bug Something isn't working label Sep 12, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 12, 2022

@cescoffier
Copy link
Member

It's actually a bug fix. It was not really working... it was using the request scope from the application startup.

@rsvoboda
Copy link
Member Author

I'm not proposing to revert it;)

I want to have it documented in migration guide as it's a breaking change

And if possible to indicate which class could use @ActivateRequestContext so the end users can fix their code a bit faster

@rsvoboda
Copy link
Member Author

rsvoboda commented Sep 12, 2022

(I will proceed with QS fix in the meantime)

PR: quarkusio/quarkus-quickstarts#1174

@rsvoboda rsvoboda changed the title kafka-panache-reactive-quickstart fails after https://github.com/quarkusio/quarkus/pull/27802 kafka-panache-reactive-quickstart fails after #27802 Sep 12, 2022
@cescoffier
Copy link
Member

I've asked Ozan to add a note (it should have been done while merging)

@ozangunalp
Copy link
Contributor

I've missed that.
@rsvoboda thanks for the heads up, I'll update the migration guide accordingly.

Too bad the error message doesn't mention the channel name. I'll also look into it.

@ozangunalp
Copy link
Contributor

@rsvoboda
Copy link
Member Author

rsvoboda commented Sep 14, 2022

When is 3.20.0 planned for release? And will it make it into Quarkus 2.13 branch?

When closing issue we should probably set milestone, first 2 items are covered for 2.13.
So should be the milestone set to 2.13? @cescoffier can you give a hint?

@ozangunalp
Copy link
Contributor

I'll try to open the version bump PR this week for 3.19.0 but it doesn't include the last item.
3.20.0 should follow shortly. But I don't know which Quarkus milestone it'll correspond.

@cescoffier
Copy link
Member

That issue should be closed.
3.20.0 log fix is nice to have, but not something required.

@rsvoboda rsvoboda added this to the 2.13.0.Final milestone Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants