Test log cluttered with "Connection to node -1 ... could not be established. Broker may not be available."
See original GitHub issueDescription Test logs are full of warnings like this:
WARN: [AdminClient clientId=...-8cd9c56a-1348-4528-87a8-265035d94965-admin] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
WARN: [Producer clientId=...-8cd9c56a-1348-4528-87a8-265035d94965-StreamThread-1-producer] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
I have tests which only use TopologyTestDriver, so there is no need to instantiate Kafka. Furthermore I cannot “unset” kafka-streams.bootstrap-servers.
Is there any way to get rid of those messages?
I’ve seen I could use KafkaTestResource, but I think it would be better to have a way to prevent it completely.
Thanks, Antonio
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Kafka + Zookeeper: Connection to node -1 could not be ...
If running Kafka Client in docker ( docker-compose) and getting "Broker may not be available". Solution is to add this to docker-compose.yml
Read more >Documentation - Apache Kafka
When disabled, broker does not perform any down-conversion and instead sends an UNSUPPORTED_VERSION error to the client. Dynamic broker configuration options ...
Read more >Inference Service fail to re-establish a connection to Kafka - IBM
NetworkClient: [Producer clientId=producer-1] Connection to node 0 (/10.254.23.10:9092) could not be established. Broker may not be available.
Read more >Service for Data Streaming - NTNU Open
1 Introduction. 1 ... Temporary system failure should not lead to loss of data ... broker, enabling actual tests over the internet with...
Read more >Why the Hell Would I Use Node.js? A Case-by-case Tutorial
Node.js can solve I/O scaling, but was not created to compute scaling problems. ... Node's real-time, two-way connections—where the client and server can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@cescoffier How has this been fixed? I’m using the latest version of Quarkus with the
quarkus-kafka-streams
dependency, and my logs are still full of these warnings when I’m running unit tests with theTopologyTestDriver
. Do I need to configure something to make those go away?I think this may have been closed by mistake, as it’s quarkus-kstream extension question/issue.
Anyway I’ve found a solution for this: simply inject a mock of KafkaStreams - a class that extends KafkaStreams and overrides start() to do nothing. The bean being singleton scope, it has to be done via QuarkusTestProfile CDI alternatives.Actually it would require a change in extension to not initialize a new KafkaStreams if one is provided via test profile.