vert-x3 / vertx-kafka-client

Reactive Kafka Client for Vert.x
Apache License 2.0
84 stars 82 forks source link

KafkaWriteStream uses the caller context to execute internal worker tasks. #226

Closed vietj closed 2 years ago

vietj commented 2 years ago

The implementation of KafkaWriteStream caches a Vert.x context to interact with the Kafka producer. This same context is used in order to serialize producer interactions.

It is desirable to rely instead on the caller Vert.x context, so that producer interactions uses the caller context instead of the cached context.

The KafkaWriteStream implementation changes now to use the caller Vert.x context and provide a task queue to serialize producer interactions instead of relying on the internal task queue of the previously cached context.

ppatierno commented 2 years ago

I tried these changes in relation to this PR on the Strimzi Kafka bridge https://github.com/strimzi/strimzi-kafka-bridge/pull/633 Anyway before merging I would like to have a feedback from @alesj as well.

alesj commented 2 years ago

Anyway before merging I would like to have a feedback from @alesj as well.

@ppatierno just tested as well, and it works for me too -- single instance of Producer + multiple sends + each send trace has 2 related spans

ppatierno commented 2 years ago

@vietj this fix seems to work for us.Thanks! Could you merge it in order to be sure to have it delivered in the Vert.x 4.3.3 release please?