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 fails with mutiple emitters on same channel #38054

Closed
mocenas opened this issue Jan 5, 2024 · 2 comments · Fixed by #38059
Closed

Kafka fails with mutiple emitters on same channel #38054

mocenas opened this issue Jan 5, 2024 · 2 comments · Fixed by #38059
Assignees
Labels
area/kafka kind/bug Something isn't working
Milestone

Comments

@mocenas
Copy link
Contributor

mocenas commented Jan 5, 2024

Describe the bug

Using kafka and avro. When creating more than one emitter per channel, it will fail to start, because of "different configuration for emitters", see exception below.

MovieResourceTest.testHelloEndpoint » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.smallrye.reactivemessaging.deployment.SmallRyeReactiveMessagingProcessor#build threw an exception: jakarta.enterprise.inject.spi.DeploymentException: Emitter configuration for channel `movies` is different than previous configuration : QuarkusEmitterConfiguration{name='movies', emitterType=io.quarkus.smallrye.reactivemessaging.runtime.EmitterFactoryForLiteral@7dd87975, overflowBufferStrategy=BUFFER, overflowBufferSize=-1, broadcast=false, numberOfSubscriberBeforeConnecting=-1}
	at io.quarkus.smallrye.reactivemessaging.deployment.SmallRyeReactiveMessagingProcessor.build(SmallRyeReactiveMessagingProcessor.java:302)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
	at java.base/java.lang.Thread.run(Thread.java:840)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Although the emitters are declared exactly same:

@Channel("movies")
Emitter<Movie> emitter;

@Channel("movies")
Emitter<Movie> emitter2;

Removing one of these, makes the app work fine.

Expected behavior

Two emitters for same channel should cause no problem. It is even exampled in the docs https://quarkus.io/blog/reactive-messaging-emitter/#overflow-management

Actual behavior

Adding more than one emitter to the outgoing channel causes the app to fail to deploy. It is no matter if the two emitters are in same class / resource or not.

How to Reproduce?

I've created a reproducer on https://github.com/mocenas/quarkus-kafka-reproducer.
Install locally quarkus and run tests on it.

Output of uname -a or ver

No response

Output of java -version

opendjk 17.0.9

Quarkus version or git rev

999-SNAPSHOT rev. 2e6fe10

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

No response

Additional information

Quarkus version 3.6.4 is not affected by this. Only 999-SNAPSHOT is. I cannot pinpoint exact PR which caused this, but we started to see this failure in daily tests between 2-3 of January 2024.

@mocenas mocenas added the kind/bug Something isn't working label Jan 5, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 5, 2024

/cc @alesj (kafka), @cescoffier (kafka), @ozangunalp (kafka)

@ozangunalp ozangunalp self-assigned this Jan 5, 2024
@ozangunalp
Copy link
Contributor

Thanks for the reproducer, indeed it looks like a bug.

The check was introduced because you cannot declare multiple emitters with different configurations.
The overflow management section just gives a couple examples of overflow configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants