I am using the Quarkus Kafka extension, but not in the intended way, as I need to connect to multiple different Kafka brokers to transfer messages between them - which the extension doesn't support. As such I am using the plain Kafka API to connect to these brokers. For this, I have set up multiple configuration properties which have the "bootstrap.servers" for each broker I need to connect to:
my-app.broker-one-properties."bootstrap.servers"=kafkaone.example.com:9092
my-app.broker-two-properties."bootstrap.servers"=kafkatwo.example.com:9092
This all works fine, however for my automated tests, I would actually like to the Quarkus Kafka devservices to start up a RedPanda container before running my tests (https://quarkus.io/guides/kafka#kafka-dev-services). The extension starts a RedPanda at a random port which is what I want. For tests it is ok to use the same instance for all brokers, so I would like to use "bootstrap.servers" from the devservices during test.
I tried something like:
%test.my-app.broker-one-properties."bootstrap.servers"=${kafka.bootstrap.servers}
%test.my-app.broker-two-properties."bootstrap.servers"=${kafka.bootstrap.servers}
in the hope that I could get the correct configuration into my own service this way but this doesn't seem to work this way. So how could I find out which port the devservices are using to feed this to my own configuration?