testcontainers-go
testcontainers-go copied to clipboard
feat(kafka): additional advertised listeners/broker addresses for kafka
What does this PR do?
- Add additional kafka listeners to support more networking configurations
- Add additional kafka advertised listeners for the above
- Add new methods for retrieving brokers based on different hostnames
Why is it important?
- kafka likes to know the exact address where it can be reached
- the current ad. listeners returns
localhost:<random port> localhostis not a valid address to kafka when running within another docker container
This change is intended to support more complicated testing setups where the test code is running itself is another docker container, thus needs kafka to advertise a connection string other than localhost.
Related issues
- Alternate implementation to https://github.com/testcontainers/testcontainers-go/pull/2894
- supersedes #2490
How to test this PR
- Unit tests adding in PR
- Examples added in PR