When updating the topicsConfig resource, the KafkaProducer is created synchronously on the Vert.x event loop thread. If Kafka brokers are unreachable due to network issues, firewall settings, or DNS problems, the producer creation blocks, causing the entire application to become unresponsive.
Root Cause:
In KafkaProducerRepository.addKafkaProducer(), KafkaProducer.create(vertx, config) is called directly without wrapping it in vertx.executeBlocking(). The call chain from config resource change notification runs entirely on the event loop:
ConfigurationResourceManager (event bus consumer)
→ KafkaHandler.resourceChanged()
→ KafkaHandler.initializeKafkaConfiguration()
→ KafkaProducerRepository.addKafkaProducer()
→ KafkaProducer.create() ← blocking call on event loop
Impact:
- Complete application freeze when topicsConfig is updated and Kafka brokers are unreachable
- All HTTP requests hang until the Kafka client times out (which can take minutes)
- No graceful degradation or error handling
Suggested Fix:
Wrap KafkaProducer.create() in vertx.executeBlocking() to offload potentially blocking operations to a worker thread
When updating the topicsConfig resource, the KafkaProducer is created synchronously on the Vert.x event loop thread. If Kafka brokers are unreachable due to network issues, firewall settings, or DNS problems, the producer creation blocks, causing the entire application to become unresponsive.
Root Cause:
In KafkaProducerRepository.addKafkaProducer(), KafkaProducer.create(vertx, config) is called directly without wrapping it in vertx.executeBlocking(). The call chain from config resource change notification runs entirely on the event loop:
ConfigurationResourceManager (event bus consumer)
→ KafkaHandler.resourceChanged()
→ KafkaHandler.initializeKafkaConfiguration()
→ KafkaProducerRepository.addKafkaProducer()
→ KafkaProducer.create() ← blocking call on event loop
Impact:
Suggested Fix:
Wrap KafkaProducer.create() in vertx.executeBlocking() to offload potentially blocking operations to a worker thread