-
Notifications
You must be signed in to change notification settings - Fork 287
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
Transaction support #289
Comments
Yes, I'd love to see this! I haven't thought at all about what the API would need to look like. The right place to start is probably a proposal for/prototype of the API. |
Looking at librdkafka and some of its wrappers for other languages (python, go, .net) I think the way to go would be to add:
fn init_transactions<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()> {}
fn begin_transaction(&self) -> KafkaResult<()> {}
fn send_offsets_to_transaction<T: Into<Timeout>>(
&self,
offsets: &TopicPartitionList,
metadata: &ConsumerGroupMetadata,
timeout: T) -> KafkaResult<()> {}
fn commit_transaction<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()> {}
fn abort_transaction<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()> {} Maybe it would make sense to make some of these
fn group_metadata(&self) -> ConsumerGroupMetadata {}
What do you think? |
That looks wonderful to me! Agreed that you'd want those methods to be |
After taking a closer look at error handling: librdkafka has a new error type, Some ways I can think of to handle this:
Can't say I like one of them in particular. How would you approach error handling in this situation? Do you see other possible solutions? |
Oh, hrm. I think I like (1) the best. Unfortunate that we'll need to break backwards compatibility, but I don't see any other way to prevent the names of these error types from being massively confusing. I think just add Hopefully in a few librdkafka releases it becomes more clear how they intend to use this new complex error type in other APIs, and we can think about redesigning rust-rdkafka's error handling to be a bit more user friendly. The big |
Co-authored-by: Robert Ignat <robert.ignat91@gmail.com> Closes fede1024#289. Closes fede1024#293.
Co-authored-by: Robert Ignat <robert.ignat91@gmail.com> Closes fede1024#289. Closes fede1024#293.
Now that librdkafka supports transactions, are there any plans to make them available in rust-rdkafka as well?
I need to use transactions in a read-process-write scenario and would be happy to help with the implementation.
The text was updated successfully, but these errors were encountered: