【问题标题】:Connecting Lagom to external Kafka Server (on Confluent Cloud)将 Lagom 连接到外部 Kafka 服务器(在 Confluent Cloud 上)
【发布时间】:2021-11-14 20:23:26
【问题描述】:

我需要将 Lagom 1.6/Java/Sbt 应用程序连接到 Confluent Cloud Kafka 集群。 从 Confluent 我有以下配置:

bootstrap.servers=xxxx.us-west1.gcp.confluent.cloud:9092
security.protocol=SASL_SSL
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule   required username='{{ CLUSTER_API_KEY }}'   password='{{ CLUSTER_API_SECRET }}';
sasl.mechanism=PLAIN
# Required for correctness in Apache Kafka clients prior to 2.6
client.dns.lookup=use_all_dns_ips

# Best practice for Kafka producer to prevent data loss
acks=all

我将在 Lagom 中的何处以及如何配置它?

【问题讨论】:

标签: apache-kafka confluent-platform lagom


【解决方案1】:

我确实设法在我的 application.conf 中连接了以下配置(感谢@Robin Moffatt)。

lagom.broker.kafka.service-name = ""
lagom.broker.kafka.brokers = "xxxx.us-west1.gcp.confluent.cloud:9092"

akka.kafka.consumer.kafka-clients {
    
    bootstrap.servers="xxxx.us-west1.gcp.confluent.cloud:9092"
    security.protocol="SASL_SSL"
    sasl.jaas.config="org.apache.kafka.common.security.plain.PlainLoginModule   required username='API_KEY'   password='API_SECRET';"
    sasl.mechanism="PLAIN"
    client.dns.lookup="use_all_dns_ips"
}

akka.kafka.producer.kafka-clients {
    
    bootstrap.servers="xxxx.us-west1.gcp.confluent.cloud:9092"
    security.protocol="SASL_SSL"
    sasl.jaas.config="org.apache.kafka.common.security.plain.PlainLoginModule   required username='API_KEY'   password='API_SECRET';"
    sasl.mechanism="PLAIN"
    client.dns.lookup="use_all_dns_ips"
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-26
    • 2021-08-14
    • 2017-08-30
    • 1970-01-01
    相关资源
    最近更新 更多