java - Azure 事件中心与 Spring Cloud Stream Kafka 的连接问题

标签 java azure apache-kafka spring-cloud-stream azure-eventhub

我们将 Azure 事件中心与 Kafka 集成选项结合使用。我们的服务基于Java、Spring Boot、Spring Cloud Stream。它们部署在 Azure AKS 上。我们已在群集的虚拟网络上为 Azure 事件中心启用服务终结点。

大多数时候,一切正常。

生产者有时无法发布到 Kafka。我们会丢失消息,这通常对于整体数据一致性至关重要。

发生这种情况时,我们会在日志中看到一些错误(为了便于阅读,我已将它们分解为多行):

日志中的第一个示例:

2019-02-21 22:11:04.681 WARN 1 --- [ad | producer-2]
o.a.k.clients.producer.internals.Sender : [Producer clientId=producer-2]
Got error produce response with correlation id 6 on topic-partition _topic-name_-1,
retrying (4 attempts left). Error: NETWORK_EXCEPTION

第二个例子:

org.apache.kafka.common.errors.TimeoutException:
Expiring 1 record(s) for _topic-name_-1:
30096 ms has passed since batch creation plus linger time

消费者偶尔也会遇到连接问题:

2019-02-22 03:03:59.733 INFO 1 --- [container-0-C-1]
o.a.k.c.c.internals.AbstractCoordinator :
[Consumer clientId=consumer-6, groupId=my-super-service]
Group coordinator my-super-hub.servicebus.windows.net:9093
(id: 2147483647 rack: null) is unavailable or invalid, will attempt rediscovery

有人对 Azure 事件中心有类似的问题吗?也许对可能出现的问题有一些想法?

最佳答案

您需要设置最大连接空闲时间。

connections.max.idle.ms

祝你好运。

关于java - Azure 事件中心与 Spring Cloud Stream Kafka 的连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54825091/

相关文章:

java - 无法理解何时必须将 return 语句与递归结合使用

python - azure Blob : upload directory content using a loop in Python

ubuntu - 无法将主管与 Apache Kafka 一起使用

apache-kafka - 确实需要白名单/黑名单/主题之一

azure - 使用 Azure Active Directory B2C 中的自定义策略设置 Google 帐户登录并获取个人资料图片

java - 想要输入主机名:9092 in BootStrap url(I have the hostname entry against the actual url in my host file windows) JAVA

java - 如何将 Java 对象作为参数传递给 MATLAB 函数?

java - GUI 上的 MySQL SQL 语法错误

java - 如何使用 Random.nextGaussian() 生成 N 个总和为 1 的 double

python - 带有 databricks 的 Azure 文件系统事件