0
votes

I'm trying to connect my spring-boot application with multiple kafka resources which has different sicurity configurations. First kafka source has default PLAINTEXT security protocol, while the second source has SASL_PLAINTEXT.

So I need to configure multiple consumers:

  1. for kafka instance with PLAINTEXT protocol
  2. for kafka instance with SASL_PLAINTEXT protocol and sasl.mechanism & sasl.jaas.config

Is there any whay to achive this wia java confguration? I've found sutable config classes https://kafka.apache.org/24/javadoc/org/apache/kafka/common/config/SaslConfigs.html https://kafka.apache.org/24/javadoc/org/apache/kafka/clients/admin/AdminClientConfig.html

but I have no idea how to use it for multiple kafka source configuration.

Thanks for help.

1

1 Answers

0
votes

Spring Boot will only auto-configure one set of producer and consumer factories; if you need multiple then you need to configure both sets yourself (just configuring the second one will disable Boot's auto configuration).

https://docs.spring.io/spring-kafka/docs/2.5.5.RELEASE/reference/html/#connecting