[英]Configuration of 'sasl.jaas.config' when you have 2 separate topics, each having separate connection key?
[英]Adding sasl.jaas.config to Kafka MDB on payara
@MessageDriven(name = "KafkaMDB", activationConfig = { @ActivationConfigProperty(propertyName = "bootstrapServersConfig", propertyValue = "ab-cde-xyz-stage.crb.axxxxx.net:9093"), @ActivationConfigProperty(propertyName = "clientId" , propertyValue = "sp-document-processor"), @ActivationConfigProperty(propertyName = "groupIdConfig", propertyValue = "AMPSEM.consumerGroup.v1"), @ActivationConfigProperty(propertyName = "topics", propertyValue = "teat.topic.any。 v2"), @ActivationConfigProperty(propertyName = "autoOffsetReset", propertyValue = "earliest"),
@ActivationConfigProperty(propertyName = "autoCommitInterval", propertyValue = "100"),
@ActivationConfigProperty(propertyName = "retryBackoff", propertyValue = "1000"),
@ActivationConfigProperty(propertyName = "keyDeserializer", propertyValue = "org.apache.kafka.common.serialization.StringDeserializer"),
@ActivationConfigProperty(propertyName = "valueDeserializer", propertyValue = "org.apache.kafka.common.serialization.StringDeserializer"),
@ActivationConfigProperty(propertyName = "pollInterval", propertyValue = "30000"),
@ActivationConfigProperty(propertyName = "additionalProperties", propertyValue = "ssl.truststore.location=/u01/oracle/application/config/ext/pp.tenant.truststore.jks," + "ssl.truststore.password=12345,ssl. keystore.location= /u01/oracle/application/config/ext/pp.tenant.sr.keystore.jks,ssl.keystore.password=12345," + "sasl.mechanism=SCRAM-SHA-256,security.protocol= SASL_SSL,**sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username\="pp.ampsem.v1" password\="12345**"") })
谁能帮我将 sasl.jass.config 属性添加到我使用 Payara MDB 创建的 KafkaConsumer。 我正在尝试如上所述,但不起作用。
谢谢
我遇到了同样的问题,似乎其他人也为云连接器项目做出了贡献,这是拉取请求-> https://github.com/payara/Cloud-Connectors/pull/97
问题的出现是因为 sasl.jaas.config 参数中的“=”符号,这用于从 kafka 连接器中的值拆分属性。
通过将变量值用单引号括起来,整个字符串被获取,并且 sasl.jaas.config 字符串可以加载到系统中。
@MessageDriven(name = "KafkaMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "additionalProperties", propertyValue = "sasl.jaas.config='org.apache.kafka.common.security.plain.PlainLoginModule required username=${sasl.jaas.connection.string} password=${sasl.jaas.connection.secret};'"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.