vert-x3 / vertx-kafka-client

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

Shared producer(s) closed ahead of time if vertx is being shut down #269

Open flukschander opened 3 months ago

flukschander commented 3 months ago

Version

4.X

Context

When creating a shared producer from a Verticle it should stay alive (aka not closed) till the Verticle close(..) method finished. Currently shared producers register a shutdown hook with VertxInternal directly and therefore the producer is closed ahead of time.

Do you have a reproducer?

Testcase (and PR) here

Steps to reproduce

  1. initiate vertx instance
  2. deploy verticle
  3. within verticle create shared consumer
  4. close vertx
  5. within the stop(Promise<Void> stopPromise) method of the verticle wait a few milliseconds to simulate finish processing currently in-flight-messages and try to send a message before completing the stop-promise
  6. observer error messages