I've got a spring boot app, working with a kafka (let's say kafka#1) Now i have a case, when i need to connect to kafka server of an external service (kafka#2) and tomorrow another external service's kafka should be added.
Each of kafka#1, kafka#2, kafka#3 has separate topics. I've managed tod find that topic where a simple thing is adviced - add all servers into bootstrap.servers
property, separated by comma.
I'm a little worried about server-to-topic mappings - i don't think that it's right that kafka can "ask" all servers about all topics...
What is the right approach for this?
In point of the app, mho, it would be better to have multiple configs, for example:
kafka1.properties
kafka2.properties
kafka3.properties
. Then i could create kafka beans with apropriate settings (consumer container factories & factories) and define the required factories at @KafkaListener listeners. So i could avoid any unnescessary server-topic mapping problems...
Or maybe that's odd and i just need to add bootstrap.servers at a single config file kafka.properties
and don't worry? Couldn't find any information about that...