簡體   English   中英

將 sasl.jaas.config 添加到 payara 上的 Kafka MDB

[英]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。 我正在嘗試如上所述,但不起作用。

謝謝

Eclipse 中的語法錯誤

我遇到了同樣的問題,似乎其他人也為雲連接器項目做出了貢獻,這是拉取請求-> 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM