【Azure 事件中心】Event Hub Client 连接超时(OperationTimeout)测试及解说

Azure Event Hub(Azure事件中心) 是大数据流式处理平台和事件引入服务。 它可以每秒接收和处理数百万个事件。在我们的使用中,需要代码编写的是两个部分:事件生产者和事件接收者
- 事件生成者:向事件中心发送数据的所有实体。 事件发布者可以使用 HTTPS、AMQP 1.0 或 Apache Kafka(1.0 和更高版本)发布事件。
- 事件接收者:从事件中心读取事件数据的所有实体。 所有事件中心使用者通过 AMQP 1.0 会话进行连接。 事件中心服务在事件变得可用时通过会话来提供事件。 所有 Kafka 使用者都通过 Kafka 协议 1.0 及更高版本进行连接。
下图显示了事件中心流处理体系结构:

(其他组件说明:https://docs.azure.cn/zh-cn/event-hubs/event-hubs-about#key-architecture-components)
问题描述
在使用事件生产者或接收者时,都需要与Event Hub服务建立连接。那么只要建立了连接,都需要考虑连接空闲超时参数。当发生Timout后,EventHubClient的表现是什么呢?有什么日志输出呢?同时,当新的消息需要发送时,EventHubClient时如何重建的连接呢? 重建连接耗时多长呢?
问题分析
以上问题,都可以通过调试EventHubClient的代码日志来分析。
实验步骤:
准备条件:参考文档,构建EventHub的发送消息代码:
- 【旧版】使用 Java 向/从 Azure 事件中心 (azure-eventhubs) 发送/接收事件:https://docs.azure.cn/zh-cn/event-hubs/event-hubs-java-get-started-send-legacy
- 【新版】使用 Java 向/从 Azure 事件中心 (azure-messaging-eventhubs) 发送/接收事件:https://docs.azure.cn/zh-cn/event-hubs/event-hubs-java-get-started-send
1) 在初始化EventHubClient对象时,使用默认的OperationTimout时间(60秒)

2) 在发送第一条消息前,使线程睡眠65秒。验证EventHubClient对象超时后SDK的输出

3) 记录触发发送第一条消息前的时间,获取EventHubClient建立连接的日志。计算耗时时间

4) 根据测试中输出的日志,得出5点结论
1:在2021-03-23 15:17:37.505时候,Connection连接建立成功,由于线程睡眠,所以在2021-03-23 15:18:37.463 (60秒后)Connection关闭,理由是( errorDescription[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker')
2021-03-23 15:17:37.505 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], remoteContainer[cc19381675a649259fafb0c0d7faebe0_G18]
2021-03-23T07:17:37.538384400Z: Start to sleep ... waiting the connection idle timeout
2021-03-23 15:18:37.463 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteClose: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[amqp:connection:forced], errorDescription[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:cc19381675a649259fafb0c0d7faebe0_G18, SystemTracker:gateway7, Timestamp:2021-03-23T07:18:37]
2:当线程睡眠结束,在2021-03-23T15:18:42.559930300开始发送消息
3:EventHubClient马上开始重新创建 Connection, Session,Link。耗时近2秒(从2021-03-23 15:18:42.578到2021-03-23 15:18:44.592)
4:重建连接后第一条消息发送成功在2021-03-23T15:18:44.829493900
2021-03-23T07:18:42.538152400Z: End to sleep ...
Start: Send message 0 !2021-03-23T15:18:42.559930300
2021-03-23 15:18:42.578 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.MessageSender : clientId[EventHubClientImplb2e9d6-InternalSender], path[receivemessage], operationTimeout[PT1M30S], creating a send link
2021-03-23 15:18:42.606 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionInit hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:18:42.607 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalOpen entityName[cbs-session], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:42.608 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkLocalOpen linkName[cbs:sender], localTarget[Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:42.609 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ReceiveLinkHandler : onLinkLocalOpen linkName[cbs:receiver], localSource[Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}]
2021-03-23 15:18:42.609 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionLocalOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:18:42.610 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionBound hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:18:43.830 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], remoteContainer[79f3573f29a44a1296940126b03be077_G20]
2021-03-23 15:18:43.832 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionRemoteOpen entityName[cbs-session], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2021-03-23 15:18:43.833 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkRemoteOpen linkName[cbs:sender], remoteTarget[Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:43.835 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ReceiveLinkHandler : onLinkRemoteOpen linkName[cbs:receiver], remoteSource[Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}]
2021-03-23 15:18:44.265 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalOpen entityName[receivemessage], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:44.420 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionRemoteOpen entityName[receivemessage], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2021-03-23 15:18:44.421 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkLocalOpen linkName[37adea_077_G20_1616483924421], localTarget[Target{address='receivemessage', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:44.590 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkRemoteOpen linkName[37adea_077_G20_1616483924421], remoteTarget[Target{address='receivemessage', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:44.592 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.MessageSender : onOpenComplete - clientId[EventHubClientImplb2e9d6-InternalSender], sendPath[receivemessage], linkName[37adea_077_G20_1616483924421]
Completed: Send message 0 !2021-03-23T15:18:44.829493900
5:第二条,第N条发送的时间就非常的短暂,在300毫秒左右。
Completed: Send message 0 !2021-03-23T15:18:44.829493900
Start: Send message 1 !2021-03-23T15:18:44.830505
Completed: Send message 1 !2021-03-23T15:18:45.035403600
Start: Send message 2 !2021-03-23T15:18:45.035403600
Completed: Send message 2 !2021-03-23T15:18:45.249423400
Start: Send message 3 !2021-03-23T15:18:45.250395800
Completed: Send message 3 !2021-03-23T15:18:45.468455300
Start: Send message 4 !2021-03-23T15:18:45.470397200
Completed: Send message 4 !2021-03-23T15:18:45.769922900
Start: Send message 5 !2021-03-23T15:18:45.770920300
Completed: Send message 5 !2021-03-23T15:18:45.973769300
Start: Send message 6 !2021-03-23T15:18:45.975713700
Completed: Send message 6 !2021-03-23T15:18:46.168880300
Start: Send message 7 !2021-03-23T15:18:46.169844900
Completed: Send message 7 !2021-03-23T15:18:46.377778800
总结:EventHub Client在创建过程中的三个关键因素和日志中所打印出的事件顺序
EventHub Client使用AMQP协议的连接创建与关闭的过程: 它涉及到三个主要的部分:connection,session和link
三者关系图

创建连接全过程事件顺序

关闭连接全过程事件顺序

代码
pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>sendehmsg</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>sendehmsg</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> <dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-eventhubs</artifactId>
<version>2.2.0</version>
</dependency> </dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
SendehmsgApplication.java

package com.example.sendehmsg; import com.microsoft.azure.eventhubs.ConnectionStringBuilder;
import com.microsoft.azure.eventhubs.EventData;
import com.microsoft.azure.eventhubs.EventHubClient;
import com.microsoft.azure.eventhubs.EventHubException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.sql.Date;
import java.sql.Time;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
public class SendehmsgApplication { public static void main(String[] args)
throws EventHubException, IOException, InterruptedException, URISyntaxException {
SpringApplication.run(SendehmsgApplication.class, args); final ConnectionStringBuilder connStr = new ConnectionStringBuilder().setNamespaceName("xxxxxxxxxxxxxx")
.setEndpoint(new URI("sb://xxxxxxxxxxxxxx.servicebus.chinacloudapi.cn/")).setEventHubName("receivemessage")
.setSasKeyName("all").setSasKey("xxxxxxxxxxxxxx")
.setOperationTimeout(Duration.ofSeconds(90)); // The Executor handles all asynchronous tasks and this is passed to the
// EventHubClient instance.
// This enables the user to segregate their thread pool based on the work load.
// This pool can then be shared across multiple EventHubClient instances.
// The following sample uses a single thread executor, as there is only one
// EventHubClient instance,
// handling different flavors of ingestion to Event Hubs here.
final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1); // Each EventHubClient instance spins up a new TCP/TLS connection, which is
// expensive.
// It is always a best practice to reuse these instances. The following sample
// shows this.
// final EventHubClient ehClient = EventHubClient.createSync(connectionstr,
// executorService);
final EventHubClient ehClient = EventHubClient.createSync(connStr.toString(), executorService); // Send the First message
EventData sendEvent = EventData.create("Message 0".getBytes());
System.out.println("Start: Send message 0 !" + LocalDateTime.now().toString());
ehClient.sendSync(sendEvent);
System.out.println("Completed: Send message 0 !" + LocalDateTime.now().toString()); try {
for (int i = 1; i < 100; i++) {
var timelong = 10000;
System.out.println("@@@@@@@@@@@@@@@@" + LocalDateTime.now().toString() + ": [" + i
+ "] Start to sleep ... waiting the connection idle timeout");
for (int j = 0; j < i*30; j++) {
Thread.sleep(timelong);
}
System.out.println("@@@@@@@@@@@@@@@@" + LocalDateTime.now().toString() + ": [" + i
+ "] End to sleep ..." + timelong);
String payload = "Message " + Integer.toString(i);
// byte[] payloadBytes =
// gson.toJson(payload).getBytes(Charset.defaultCharset());
sendEvent = EventData.create(payload.getBytes()); // Send - not tied to any partition
// Event Hubs service will round-robin the events across all Event Hubs
// partitions.
// This is the recommended & most reliable way to send to Event Hubs. System.out.println("Start: Send message " + i + " !" + LocalDateTime.now().toString()); ehClient.sendSync(sendEvent); System.out.println("Completed: Send message " + i + " !" + LocalDateTime.now().toString());
} System.out.println(Instant.now() + ": Send Complete...");
System.out.println("Press Enter to stop."); // System.in.read();
} finally {
ehClient.closeSync();
executorService.shutdown();
} } }
日志
PS C:\LBWorkSpace\MyCode\22-EventHub- send message - Java\sendehmsg> c:; cd 'c:\LBWorkSpace\MyCode\22-EventHub- send message - Java\sendehmsg'; & 'c:\Users\bulu\.vscode\extensions\vscjava.vscode-java-debug-0.32.0\scripts\launcher.bat' 'C:\Program Files\Java\jdk-12.0.1\bin\java.exe' '-Dfile.encoding=UTF-8' '@C:\Users\bulu\AppData\Local\Temp\cp_9a7ev5x7qjbbggrbbozjir273.argfile' 'com.example.sendehmsg.SendehmsgApplication' . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.4.4) 2021-03-23 15:17:33.414 INFO 104016 --- [ main] c.e.sendehmsg.SendehmsgApplication : Starting SendehmsgApplication using Java 12.0.1 on MININT-S4MGVOU with PID 104016 (C:\LBWorkSpace\MyCode\22-EventHub- send message - Java\sendehmsg\target\classes started by bulu in C:\LBWorkSpace\MyCode\22-EventHub- send message - Java\sendehmsg)
2021-03-23 15:17:33.419 INFO 104016 --- [ main] c.e.sendehmsg.SendehmsgApplication : No active profile set, falling back to default profiles: default
2021-03-23 15:17:35.292 INFO 104016 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-03-23 15:17:35.305 INFO 104016 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-03-23 15:17:35.305 INFO 104016 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.44]
2021-03-23 15:17:35.436 INFO 104016 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-03-23 15:17:35.436 INFO 104016 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1936 ms
2021-03-23 15:17:35.655 INFO 104016 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-03-23 15:17:35.866 INFO 104016 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-03-23 15:17:35.878 INFO 104016 --- [ main] c.e.sendehmsg.SendehmsgApplication : Started SendehmsgApplication in 3.076 seconds (JVM running for 3.633)
2021-03-23 15:17:35.926 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : messagingFactory[MessagingFactorye40067], hostName[lbtesteh.servicebus.chinacloudapi.cn], info[starting reactor instance.]
2021-03-23 15:17:35.935 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.ReactorHandler : reactor.onReactorInit
2021-03-23 15:17:35.942 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionInit hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:17:35.945 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionLocalOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:17:36.086 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionBound hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:17:37.505 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], remoteContainer[cc19381675a649259fafb0c0d7faebe0_G18]
2021-03-23T07:17:37.538384400Z: Start to sleep ... waiting the connection idle timeout
2021-03-23 15:18:37.463 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteClose: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[amqp:connection:forced], errorDescription[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:cc19381675a649259fafb0c0d7faebe0_G18, SystemTracker:gateway7, Timestamp:2021-03-23T07:18:37]
2021-03-23 15:18:37.465 WARN 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : onConnectionError: messagingFactory[MessagingFactorye40067], hostname[lbtesteh.servicebus.chinacloudapi.cn], error[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:cc19381675a649259fafb0c0d7faebe0_G18, SystemTracker:gateway7, Timestamp:2021-03-23T07:18:37]
2021-03-23 15:18:37.466 WARN 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : onConnectionError: messagingFactory[MessagingFactorye40067], hostname[lbtesteh.servicebus.chinacloudapi.cn], closing current
connection
2021-03-23 15:18:37.468 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionLocalClose: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[amqp:connection:forced], errorDescription[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:cc19381675a649259fafb0c0d7faebe0_G18, SystemTracker:gateway7, Timestamp:2021-03-23T07:18:37]2021-03-23 15:18:37.470 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionUnbound: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], state[CLOSED], remoteState[CLOSED]
2021-03-23 15:18:37.472 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionFinal: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[amqp:connection:forced], errorDescription[The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:cc19381675a649259fafb0c0d7faebe0_G18, SystemTracker:gateway7, Timestamp:2021-03-23T07:18:37]
2021-03-23T07:18:42.538152400Z: End to sleep ...
Start: Send message 0 !2021-03-23T15:18:42.559930300
2021-03-23 15:18:42.578 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.MessageSender : clientId[EventHubClientImplb2e9d6-InternalSender], path[receivemessage], operationTimeout[PT1M30S], creating a send link
2021-03-23 15:18:42.606 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionInit hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:18:42.607 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalOpen entityName[cbs-session], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:42.608 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkLocalOpen linkName[cbs:sender], localTarget[Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:42.609 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ReceiveLinkHandler : onLinkLocalOpen linkName[cbs:receiver], localSource[Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}]
2021-03-23 15:18:42.609 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionLocalOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:18:42.610 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionBound hostname[lbtesteh.servicebus.chinacloudapi.cn]
2021-03-23 15:18:43.830 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteOpen: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], remoteContainer[79f3573f29a44a1296940126b03be077_G20]
2021-03-23 15:18:43.832 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionRemoteOpen entityName[cbs-session], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2021-03-23 15:18:43.833 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkRemoteOpen linkName[cbs:sender], remoteTarget[Target{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:43.835 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ReceiveLinkHandler : onLinkRemoteOpen linkName[cbs:receiver], remoteSource[Source{address='$cbs', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}]
2021-03-23 15:18:44.265 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalOpen entityName[receivemessage], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:44.420 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionRemoteOpen entityName[receivemessage], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2021-03-23 15:18:44.421 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkLocalOpen linkName[37adea_077_G20_1616483924421], localTarget[Target{address='receivemessage', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:44.590 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.SendLinkHandler : onLinkRemoteOpen linkName[37adea_077_G20_1616483924421], remoteTarget[Target{address='receivemessage', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null}]
2021-03-23 15:18:44.592 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.MessageSender : onOpenComplete - clientId[EventHubClientImplb2e9d6-InternalSender], sendPath[receivemessage], linkName[37adea_077_G20_1616483924421]
Completed: Send message 0 !2021-03-23T15:18:44.829493900
Start: Send message 1 !2021-03-23T15:18:44.830505
Completed: Send message 1 !2021-03-23T15:18:45.035403600
Start: Send message 2 !2021-03-23T15:18:45.035403600
Completed: Send message 2 !2021-03-23T15:18:45.249423400
Start: Send message 3 !2021-03-23T15:18:45.250395800
Completed: Send message 3 !2021-03-23T15:18:45.468455300
Start: Send message 4 !2021-03-23T15:18:45.470397200
Completed: Send message 4 !2021-03-23T15:18:45.769922900
Start: Send message 5 !2021-03-23T15:18:45.770920300
Completed: Send message 5 !2021-03-23T15:18:45.973769300
Start: Send message 6 !2021-03-23T15:18:45.975713700
Completed: Send message 6 !2021-03-23T15:18:46.168880300
Start: Send message 7 !2021-03-23T15:18:46.169844900
Completed: Send message 7 !2021-03-23T15:18:46.377778800
Start: Send message 8 !2021-03-23T15:18:46.379782200
Completed: Send message 8 !2021-03-23T15:18:46.601331
Start: Send message 9 !2021-03-23T15:18:46.603331700
Completed: Send message 9 !2021-03-23T15:18:46.804803400
2021-03-23T07:18:46.805802600Z: Send Complete...
Press Enter to stop.
2021-03-23 15:18:46.807 INFO 104016 --- [ main] c.m.azure.eventhubs.impl.ClientEntity : close: clientId[EventHubClientImplb2e9d6]
2021-03-23 15:18:46.808 INFO 104016 --- [ main] c.m.azure.eventhubs.impl.ClientEntity : close: clientId[EventHubClientImplb2e9d6-InternalSender]
2021-03-23 15:18:46.821 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkLocalClose linkName[37adea_077_G20_1616483924421], errorCondition[null], errorDescription[null]
2021-03-23 15:18:46.822 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : closeSession for linkName[37adea_077_G20_1616483924421], errorCondition[null], errorDescription[null]
2021-03-23 15:18:46.826 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalClose entityName[receivemessage], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:47.059 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkRemoteClose linkName[37adea_077_G20_1616483924421], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.061 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : processOnClose linkName[37adea_077_G20_1616483924421], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.063 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionRemoteClose entityName[receivemessage], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:47.093 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.ClientEntity : close: clientId[MessagingFactorye40067]
2021-03-23 15:18:47.100 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionLocalClose: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.102 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkLocalClose linkName[cbs:sender], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.103 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : closeSession for linkName[cbs:sender], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.103 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkLocalClose linkName[cbs:receiver], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.104 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionLocalClose entityName[cbs-session], condition[Error{condition=null, description='null', info=null}]
2021-03-23 15:18:47.422 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkRemoteClose linkName[cbs:sender], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.423 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : processOnClose linkName[cbs:sender], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.424 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : onLinkRemoteClose linkName[cbs:receiver], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.424 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.BaseLinkHandler : processOnClose linkName[cbs:receiver], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.425 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : messagingFactory[MessagingFactorye40067], hostName[lbtesteh.servicebus.chinacloudapi.cn], info[cbsChannel closed]
2021-03-23 15:18:47.426 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionRemoteClose: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.427 WARN 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : onConnectionError: messagingFactory[MessagingFactorye40067], hostname[lbtesteh.servicebus.chinacloudapi.cn], error[null]
2021-03-23 15:18:47.428 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onTransportClosed: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], error[n/a]
2021-03-23 15:18:47.429 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.CustomIOHandler : onTransportClosed hostname[lbtesteh.servicebus.chinacloudapi.cn:5671]
2021-03-23 15:18:47.429 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionUnbound: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], state[CLOSED], remoteState[CLOSED]
2021-03-23 15:18:47.430 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionFinal entityName[cbs-session], condition[null], description[null]
2021-03-23 15:18:47.431 INFO 104016 --- [pool-1-thread-1] c.m.azure.eventhubs.impl.SessionHandler : onSessionFinal entityName[receivemessage], condition[null], description[null]
2021-03-23 15:18:47.431 INFO 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.ConnectionHandler : onConnectionFinal: hostname[lbtesteh.servicebus.chinacloudapi.cn:5671], errorCondition[null], errorDescription[null]
2021-03-23 15:18:47.432 WARN 104016 --- [pool-1-thread-1] c.m.a.eventhubs.impl.MessagingFactory : messagingFactory[MessagingFactorye40067], hostName[lbtesteh.servicebus.chinacloudapi.cn], message[stopping the reactor because thread was interrupted or the reactor has no more events to process.]
参考资料
Azure 服务总线和事件中心内的 AMQP 1.0 协议指南:https://docs.azure.cn/zh-cn/service-bus-messaging/service-bus-amqp-protocol-guide?toc=https%3A%2F%2Fdocs.azure.cn%2Fzh-cn%2Fevent-hubs%2Ftoc.json&bc=https%3A%2F%2Fdocs.azure.cn%2Fzh-cn%2Fbread%2Ftoc.json#what-is-amqp
【Azure 事件中心】Event Hub Client 连接超时(OperationTimeout)测试及解说的更多相关文章
- 【Azure 事件中心】在微软云中国区 (Mooncake) 上实验以Apache Kafka协议方式发送/接受Event Hubs消息 (Java版)
问题描述 事件中心提供 Kafka 终结点,现有的基于 Kafka 的应用程序可将该终结点用作运行你自己的 Kafka 群集的替代方案. 事件中心可与许多现有 Kafka 应用程序配合使用.在Azur ...
- 【Azure 事件中心】使用Azure AD认证方式创建Event Hub Consume Client + 自定义Event Position
问题描述 当使用SDK连接到Azure Event Hub时,最常规的方式为使用连接字符串.这种做法参考官网文档就可成功完成代码:https://docs.azure.cn/zh-cn/event-h ...
- 【Azure 事件中心】Event Hub 无法连接,出现 Did not observe any item or terminal signal within 60000ms in 'flatMapMany' 的错误消息
问题描述 使用Java SDK连接Azure Event Hub,一直出现 java.util.concurrent.TimeoutException 异常, 消息为:java.util.concur ...
- 【Azure 事件中心】Azure Event Hub 新功能尝试 -- 异地灾难恢复 (Geo-Disaster Recovery)
问题描述 关于Event Hub(事件中心)的灾备方案,大多数就是新建另外一个备用的Event Hub,当主Event Hub出现不可用的情况时,就需要切换到备Event Hub上. 而在切换的过程中 ...
- 【Azure 事件中心】 org.slf4j.Logger 收集 Event Hub SDK(Java) 输出日志并以文件形式保存
问题描述 在使用Azure Event Hub的SDK时候,常规情况下,发现示例代码中并没有SDK内部的日志输出.因为在Java项目中,没有添加 SLF4J 依赖,已致于在启动时候有如下提示: SLF ...
- 【Azure 事件中心】为应用程序网关(Application Gateway with WAF) 配置诊断日志,发送到事件中心
问题描述 在Application Gateway中,开启WAF(Web application firewall)后,现在需要把访问的日志输出到第三方分析代码中进行分析,如何来获取WAF的诊断日志呢 ...
- 【Azure 事件中心】EPH (EventProcessorHost) 消费端观察到多次Shutdown,LeaseLost的error信息,这是什么情况呢?
问题详情 使用EPH获取Event Hub数据时,多次出现连接shutdown和LeaseLost的error ,截取某一次的error log如: Time:2021-03-10 08:43:48 ...
- Azure Event Hub 技术研究系列2-发送事件到Event Hub
上篇博文中,我们介绍了Azure Event Hub的一些基本概念和架构: Azure Event Hub 技术研究系列1-Event Hub入门篇 本篇文章中,我们继续深入研究,了解Azure Ev ...
- 【Azure 事件中心】在Service Bus Explorer工具种查看到EventHub数据在分区中的各种属性问题
问题描述 通过Service Bus Explorer工具,查看到Event Hub的属性值,从而产生的问题及讨论: Size in Bytes: 这个是表示当前分区可以存储的最大字节数吗? La ...
- 【Azure 事件中心】azure-spring-cloud-stream-binder-eventhubs客户端组件问题, 实践消息非顺序可达
问题描述 查阅了Azure的官方文档( 将事件发送到特定分区: https://docs.azure.cn/zh-cn/event-hubs/event-hubs-availability-and-c ...
随机推荐
- 使用perfdog如何测试微信小程序
测试微信小程序和测试其他app唯一的不同点是如何在app中选中要测试的小程序 至于其他的基本操作可查看https://www.cnblogs.com/lihongtaoya/p/15140610.ht ...
- 日志框架简介-Slf4j+Logback入门实践 | 京东云技术团队
前言 随着互联网和大数据的迅猛发展,分布式日志系统和日志分析系统已广泛应用,几乎所有应用程序都使用各种日志框架记录程序运行信息.因此,作为工程师,了解主流的日志记录框架非常重要.虽然应用程序的运行结果 ...
- ClickHouse(06)ClickHouse建表语句DDL详细解析
目录 当前服务器上创建表(单节点) 语法形式 使用显式架构 从相同结构的表复制创建 从表函数创建 从选择查询创建 分布式集群创建表 临时表 分区表 创建表语句关键字解析 空值或非空修饰符 默认值表达式 ...
- 【scikit-learn基础】--『回归模型评估』之准确率分析
分类模型的评估和回归模型的评估侧重点不一样,回归模型一般针对连续型的数据,而分类模型一般针对的是离散的数据. 所以,评估分类模型时,评估指标与回归模型也很不一样,比如,分类模型的评估指标通常包括准确率 ...
- 手撕Vue-编译模板数据
经上一篇编译指令数据后,我们已经可以将指令数据编译成具体需要展示的数据了,上一篇只是编译了指令数据,还没有编译模板数据,这一篇我们就来编译模板数据. 也就是 {{}} 这种模板的形式我们该如何编译,其 ...
- 微信小程序-页面跳转navigator组件
官方文档地址:https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/route.html 在官方文档当中有提到一 ...
- C/C++ 实现Socket交互式服务端
在 Windows 操作系统中,原生提供了强大的网络编程支持,允许开发者使用 Socket API 进行网络通信,通过 Socket API,开发者可以创建.连接.发送和接收数据,实现网络通信.本文将 ...
- 8.10 TLS线程局部存储反调试
TLS(Thread Local Storage)用来在进程内部每个线程中存储私有的数据.每个线程都会拥有独立的TLS存储空间,可以在TLS存储空间中保存线程的上下文信息.变量.函数指针等.TLS其目 ...
- 7.5 C/C++ 实现链表队列
链表队列是一种基于链表实现的队列,相比于顺序队列而言,链表队列不需要预先申请固定大小的内存空间,可以根据需要动态申请和释放内存.在链表队列中,每个节点包含一个数据元素和一个指向下一个节点的指针,头节点 ...
- XXE注入详解
XML介绍 XML全称可扩展标记语言(EXtensible Markup Language),XML跟HTML格式类似,但是作用不同,XML侧重于数据传输,HTML注重于标记语言,也就是说XML其实是 ...