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

Closed
Strainy opened this issue Nov 25, 2024 · 5 comments · Fixed by #281
Closed

NPE when using batchHandler #279

Strainy opened this issue Nov 25, 2024 · 5 comments · Fixed by #281
Assignees
Labels
Milestone

Comments

@Strainy
Copy link
Contributor

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
Copy link
Contributor Author

Strainy commented Nov 27, 2024

Got a fix for the issue here 🙏
#281

@tsegismont tsegismont added this to the 4.5.12 milestone Jan 2, 2025
@tsegismont
Copy link
Contributor

Fixed by f02269a

@tsegismont
Copy link
Contributor

I had to revert the commits in both the main and the 4.x branches because the build was failing.

@Strainy would you mind creating the PR again ? I hope the test suite can catch the failure

@tsegismont tsegismont reopened this Jan 3, 2025
@Strainy
Copy link
Contributor Author

Strainy commented Jan 6, 2025

@tsegismont #284 🙏

@tsegismont tsegismont self-assigned this Jan 6, 2025
@tsegismont
Copy link
Contributor

Fixed by #286

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.

3 participants