-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
docs: Added transaction to kafka bindings as a first draft #257
base: master
Are you sure you want to change the base?
docs: Added transaction to kafka bindings as a first draft #257
Conversation
In principle, I agree with the objective here - knowing if a producer is using transactions is important information, and would be good to include somewhere in the spec. As for the specifics of where to put this, I feel that - as a description of a producer behaviour - it would be better to put this information in the operation binding (rather than the channel binding where you have proposed it). This is just my personal opinion though - I'm interested to see what others think. |
Throwing in my 2 cents: I agree that knowing whether or not a particular channel is transactional, or used in a transactional way is important. From the POV
It looks like the proposal addresses case 1, which is simpler and a good start in this area. In my personal opinion, this belongs in the receiver operation binding. i.e. the AsyncAPI document says this application should read only committed transactions from the referenced channel. Rather than saying this channel may contain aborted transactions. Additionally, I wonder if this fits better with how problem 2 may be solved, which I would propose as a new action alongside send / receive. To describe a specific single operation the application should perform using two channels. Interested to hear what others think about this area |
So, are you proposing that the transacional options should contain field like "read_committed: true"? I'm not sure if this is necessary, because this is the result of using transaction and can be concluded from the fact of using transaction itself. Regarding mapping more channels within transactions options, I was thinking about that but could not think of a good solution. This would require mapping on API root level, otherwise all channels would have to be mapped several times on each channel itself. And this also does not solve the cross-api transactions, which are possible. |
The way I see it, the AysncAPI document exists as a set of instructions for how a client application should behave. and in this case we are dealing with the issue of a channel containing non commited messages (due to a transaction) and that because of this the consumer should be told whether it should read only commited messages or whether it should accept uncommitted ones. This is a choice for the client that we should enable document writers to be specific about, it may be that they want the client to read non commited messages from this topic for some reason for example. Additionally I am not sure how we can include I guess the way I am thinking about it is this (written as much for my own clarity as anything else): There are three relevant client operations for this problem:
|
You are right, I though initially that consumer should always read only committed messages but it could be other case also. But than in the end, the binding could be as simple as: opeartions
operationName:
bindings:
kafka:
transaction:
transactional: true
readCommitted: true |
Is the extra field |
Hmm, it would be implicitly true therefore maybe this one is not needed. |
Description
Information about transacional topic is important from the consumer perspective as it requires appropriate properties being setup on its side (isolation.level='read_committed'). Moreover, property like commit.interval.ms might affect latency on consumer side. This is why I propose adding transaction configuration object to kafka bindings. I'm curious about your opinion on that topic.