sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

How to submit message offset asynchronously based on kafka protocol

Open yanmxa opened this issue 2 years ago • 3 comments
trafficstars

There is a scenario base on Kafka protocol binding and I'm not sure how to use the sdk to achieve it:

When the cloudevent client receives an event, it returns the NACK response to tell Kafka not to commit the message offset. And also forwards the event to the backend program, when the backend program has completely consumed the event, then submits the offset of the message partition.


If I can't use cloudevents client to submit message offset directly, how can I get the message partition and offset from the cloud event? so that the other progress can use the kafka client to submit this offset once the message is consumed successfully.

yanmxa avatar Feb 17 '23 02:02 yanmxa

@yanmxa is this still an issue/open question?

embano1 avatar Jul 28 '23 19:07 embano1

Yes.

If it is based on this saram protocol, it seems a bit difficult to achieve asynchronous message confirmation. So I referred using the confluent protocol, https://github.com/cloudevents/sdk-go/issues/918, which can be combined with the cloudevents client to do that.

yanmxa avatar Aug 07 '23 01:08 yanmxa

Another popular one is https://github.com/twmb/franz-go.

@duglin how are we thinking about different implementations of open protocols, such as Kafka? It might be a bit of maintenance headache on the long-term to support multiple implementations of the same transport API. But I can understand the reasons as outlined by @yanmxa. Do we want to just provide one "reference" implementation, add multiple, or switch?

embano1 avatar Aug 09 '23 06:08 embano1

Resolved by this PR: https://github.com/cloudevents/sdk-go/pull/988

yanmxa avatar Mar 31 '24 11:03 yanmxa