ammachado opened a new pull request, #30469: URL: https://github.com/apache/camel/pull/30469
JIRA: https://issues.apache.org/jira/browse/CAMEL-27231 ## Problem `VertxMqttConsumerTest.reportsWhyItCannotConnectUntilItDoes` is flaky. `VertxMqttConsumer.doStart()` acquires the connection (which starts connecting) before it adds its failure listener. When the broker refuses the first connect fast, the failure only reaches the log. `report()` then treats every later identical failure as a duplicate, so the consumer's exception handler never hears of it. ## Fix `VertxMqttConnection.addFailureListener` now runs on the connection's context, in order with `report()`, and tells the new listener of the current failure. `removeFailureListener` runs on the same context so it cannot overtake the add. No failure is missed or reported twice. A consumer joining a shared connection that is already failing now also hears that failure once. ## Tests New `VertxMqttConnectionTest.aListenerAddedAfterTheFirstFailureHearsOfItOnce` is deterministic and errors without the fix. `VertxMqttConnectionTest` and `VertxMqttConsumerTest` pass (3 consecutive runs). _Claude Code on behalf of ammachado_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
