what is the correct way to handle kafka messages asynchronously #2353
-
We currently have one Kafka consumer and we want to handle the events asynchronously. We have attempted to use the following method signature:
However, it seems that the processing is still happening synchronously. In other words, the second batch only starts processing after the first batch is finished. I have also tried change the signature to
but I got the following error
Do you have any suggestions on how to address this? Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
cescoffier
Oct 30, 2023
Replies: 1 comment 2 replies
-
You need to use @Blocking(ordered=false) // Make sure you use the smallrye one
@Incoming("...")
void process(KafkaRecordBatch<Void, Something> records) {
// ...
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
cuichenli
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to use
@Blocking
, withordered=false
: