You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Trying the last quarkus version 0.20.0 I found an issue with quarkus-smallrye-reactive-messaging-amqp that actually looks like could affect to smallrye-reactive-messaging-kafka and smallrye-reactive-messaging-mqtt too.
The issue happens at startup time (I only tried hotspot, nothing of native-image) when you inject a @Stream and in the same class you @Observes StartupEvent you get an error saying the stream can't be found eventhough having a correct configuration in the application.properties file.
My investigation makes me think the problem is in io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingLifecycle which observes StartupEvent too, so then what could be happening is that io.smallrye.reactive.messaging.extension.StreamProducer which depends on io.smallrye.reactive.messaging.ChannelRegistry doesn't know of any registered publisher or subscriber because the MediatorManager isn't initializated because my StartupEvent listener executes before the one in SmallRyeReactiveMessagingLifecycle.
The first solution that comes to my mind is to change the event that SmallRyeReactiveMessagingLifecycle listen's to another one but I don't actually know what event could be used. Another solution could be to prioritize somehow the execution of the events in listeners from quarkus extensions
Expected behavior
Application successfully starts
Actual behavior
This error appears when trying to run the application
at io.smallrye.reactive.messaging.extension.StreamProducer.getPublisher(StreamProducer.java:68)
at io.smallrye.reactive.messaging.extension.StreamProducer.producePublisher(StreamProducer.java:38)
at io.smallrye.reactive.messaging.extension.StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.create(StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.zig:110)
at io.smallrye.reactive.messaging.extension.StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.get(StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.zig:333)
at io.smallrye.reactive.messaging.extension.StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.get(StreamProducer_ProducerMethod_producePublisher_78a82f199fc91074cdfbd65c72662644b3754ad7_Bean.zig:57)
at io.quarkus.arc.CurrentInjectionPointProvider.get(CurrentInjectionPointProvider.java:50)
at org.acme.quarkus.sample.PriceConverter_Bean.create(PriceConverter_Bean.zig:222)
at org.acme.quarkus.sample.PriceConverter_Bean.create(PriceConverter_Bean.zig:28)
famarting
changed the title
Reactive Messaging - bug injecting @Stream in a class which @Observes StartupEvent
Reactive Messaging - bug injecting @Stream in a class with @Observes StartupEvent
Aug 1, 2019
Describe the bug
Trying the last quarkus version
0.20.0
I found an issue withquarkus-smallrye-reactive-messaging-amqp
that actually looks like could affect tosmallrye-reactive-messaging-kafka
andsmallrye-reactive-messaging-mqtt
too.The issue happens at startup time (I only tried hotspot, nothing of native-image) when you inject a
@Stream
and in the same class you@Observes StartupEvent
you get an error saying the stream can't be found eventhough having a correct configuration in the application.properties file.My investigation makes me think the problem is in
io.quarkus.smallrye.reactivemessaging.runtime.SmallRyeReactiveMessagingLifecycle
which observesStartupEvent
too, so then what could be happening is thatio.smallrye.reactive.messaging.extension.StreamProducer
which depends onio.smallrye.reactive.messaging.ChannelRegistry
doesn't know of any registered publisher or subscriber because theMediatorManager
isn't initializated because my StartupEvent listener executes before the one inSmallRyeReactiveMessagingLifecycle
.The first solution that comes to my mind is to change the event that
SmallRyeReactiveMessagingLifecycle
listen's to another one but I don't actually know what event could be used. Another solution could be to prioritize somehow the execution of the events in listeners from quarkus extensionsExpected behavior
Application successfully starts
Actual behavior
This error appears when trying to run the application
To Reproduce
I have a fork of the amqp-quickstart with small modifications to reproduce the issue
https://github.com/famartinrh/quarkus-quickstarts/tree/master/amqp-quickstart
Just run the quickstart and see the application fails to start
Environment (please complete the following information):
uname -a
orver
:Linux localhost.localdomain 5.1.18-200.fc29.x86_64 #1 SMP Mon Jul 15 16:09:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
java -version
:openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
The text was updated successfully, but these errors were encountered: