Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to extract bootstrap servers after mock servers are created #689

Closed
CodechCFA opened this issue Oct 1, 2021 · 2 comments
Closed

Comments

@CodechCFA
Copy link

CodechCFA commented Oct 1, 2021

Description

librdkafka allows creating mock brokers for testing purposes by passing test.mock.num.brokers as a configuration parameter. The problem is we need the bootstrap server addresses it creates in order to produce to them or consume from them but this library provides no way to extract them.

How to reproduce

kafkaProducer, err := kafka.NewProducer(&kafka.ConfigMap{"test.mock.num.brokers": 3})

consumer, err := kafka.NewConsumer(&kafka.ConfigMap{"bootstrap.servers":   ?})
@edenhill
Copy link
Contributor

edenhill commented Oct 4, 2021

Right, we would need to add a Go function for rd_kafka_mock_cluster_bootstraps().

@SourceFellows
Copy link
Contributor

I created a "fix"/pull request for something like that: #729

We use the implementation to do "isolated integration testing" for our application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants