question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test log cluttered with "Connection to node -1 ... could not be established. Broker may not be available."

See original GitHub issue

Description 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pantaorancommented, Sep 7, 2022

@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 the TopologyTestDriver. Do I need to configure something to make those go away?

0reactions
rquiniocommented, Apr 26, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found