airtai / faststream

FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis.
https://faststream.airt.ai/latest/
Apache License 2.0
2.52k stars 128 forks source link

consumer method: how to commit messages manually? #467

Closed Felix-neko closed 1 year ago

Felix-neko commented 1 year ago

Hi folks! And thank you for your great project.

I want to read messages from Kafka topic (wrapping my message processor with consumes decorator).

But I want not just to auto-commit messages, but to commit them manually -- and only if the message processing was correct (when my extra function that was processing their internal data did not throw any exception).

How can it be done? How can I commit messages manually -- and only when I really want to commit them?


Best, Felix

sternakt commented 1 year ago

Hi!

Unfortunately, the manual commit mechanism is not yet available in FastKafka. It is in the plan to be done at one point, but I cannot tell exactly when this will be implemented, sorry for not having more detailed news and for the wait.