How to properly consume kafka messages concurrently #1925
Unanswered
fernando-torres-blip-ai
asked this question in
Q&A
Replies: 1 comment
-
Unfortunately, Kafka doesn't support general concurrent message consuming. You should commit offset one by one, in the concurrent case you can't recognize the correct offset position if any error occured. So, you should scale Kafka consumers by partitions - single consumer per partition. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to scale up my kafka processing which is basically multiple asynchronous IO operations (requests). I understand that i can use multiple workers, but this is an leads to an uncessary usage of resource. I wonder if it is possible to make better usage of asyncio with faststream.
If im not doing something wrong, the subscriber below will process 1 message at time.
Log:
I wish something just like fastapi's endpoints works. The below view will accepet multiple requests concurrently.
I made the implementation below, but it leads to missing the manual Ack controllablility.
Which should be the correct implementation to work with async concurrency and kafka ?
Beta Was this translation helpful? Give feedback.
All reactions