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

NPE when using batchHandler #279

Open
Strainy opened this issue Nov 25, 2024 · 1 comment · May be fixed by #281
Open

NPE when using batchHandler #279

Strainy opened this issue Nov 25, 2024 · 1 comment · May be fixed by #281
Labels

Comments

@Strainy
Copy link

Strainy commented Nov 25, 2024

Version

v4.5.9

Context

I'm running into the following NPE when specifying a batchHandler on the consumer. Seems like it's still necessary to specify a no-op handler()... even if you just need to use the batchHandler?

java.lang.NullPointerException: Cannot invoke "io.vertx.core.Handler.handle(Object)" because "handler" is null
	at io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl.lambda$tracedHandler$11(KafkaReadStreamImpl.java:251)
	at io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl.lambda$run$10(KafkaReadStreamImpl.java:240)
	at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:328)
	at io.vertx.core.impl.DuplicatedContext.emit(DuplicatedContext.java:164)
	at io.vertx.core.impl.ContextInternal.emit(ContextInternal.java:200)
	at io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl.run(KafkaReadStreamImpl.java:240)
	at io.vertx.kafka.client.consumer.impl.KafkaReadStreamImpl.lambda$schedule$8(KafkaReadStreamImpl.java:194)
	at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
	at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:252)
	at io.vertx.core.impl.ContextInternal.lambda$runOnContext$0(ContextInternal.java:50)
	at io.vertx.core.impl.WorkerExecutor.lambda$execute$0(WorkerExecutor.java:68)
	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)

Do you have a reproducer?

You can see the error logged in the tracing tests if you switch the handler to batchHandler without also specifying a handler, for example:
Strainy@e1030fa

Steps to reproduce

Just use batchHandler without an individual record handler.

Extra

N/A

@Strainy Strainy added the bug label Nov 25, 2024
@Strainy Strainy linked a pull request Nov 27, 2024 that will close this issue
@Strainy
Copy link
Author

Strainy commented Nov 27, 2024

Got a fix for the issue here 🙏
#281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant