glazkovalex / Rebus.Kafka

Apache Kafka transport for Rebus
MIT License
16 stars 6 forks source link

Manually commiting in Rebus with Kafka #4

Closed mookid8000 closed 4 years ago

mookid8000 commented 4 years ago

Hi there, just want to direct your attention towards this question 👇

https://stackoverflow.com/questions/60834095/manually-commiting-in-rebus-with-kafka

🙂

glazkovalex commented 4 years ago

Hello, @mookid8000! I answered that question: If you are not satisfied with the default option EnableAutoCommit = true, you can set its value, as well as all other parameters for the producer and consumer in the configuration parameters. EnableAutoCommit = false, How this is done is shown in this example of using transport "Rebus.Kafka": https://github.com/glazkovalex/Rebus.Kafka/blob/master/Examples/Scaleout.Producer/Program.cs

Notice that the current version of the transport with disabled autoCommit, receives five messages and after processing moves the pointer. In other words, if the service is interrupted with autoCommit disabled, the service can re-process up to five messages when restarting. The number of these re-processed messages can be changed in future versions of the transport "Rebus.Kafka".

glazkovalex commented 6 months ago

Rebus.Kafka version 3.0.1 now supports RetryStrategy - automatic retries and error handling. Confirmations of receipt of messages are now sent not after they are received, but only after successful processing of messages or sending them to the error topic.