有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

RequestResponseLink:当使用java客户端读取队列时,Azure服务总线上RequestResponseLink到“$cbs”的内部发送链接因错误而关闭

我们在servicebus上创建了一个队列,当“创建到$CBS的CBS链接”时服务崩溃。服务在servicebus上使用一个队列和一个主题,但是问题只出现在我们添加队列之后。在某些情况下,我们没有这个问题,但服务稍后会挂起并且没有响应,这似乎是因为连接超时

这里是启动时的异常和跟踪

2019-01-11 09:51:53.916  INFO 5756 --- [ca-7e46fe9c28c4] c.m.a.s.primitives.MessagingFactory      : Creating CBS link to $cbs
2019-01-11 09:52:23.923 ERROR 5756 --- [pool-1-thread-5] c.m.a.s.primitives.RequestResponseLink   : RequestResponseLink open timed out.

com.microsoft.azure.servicebus.primitives.TimeoutException: Open operation on RequestResponseLink(MessagingFactory717191-cbs) on Entity($cbs) timed out at 2019-01-11T09:52:23.921251500-05:00[America/New_York].
    at com.microsoft.azure.servicebus.primitives.RequestResponseLink$1.run(RequestResponseLink.java:78)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

2019-01-11 09:52:53.815 ERROR 5756 --- [ca-7e46fe9c28c4] c.m.a.s.primitives.MessagingFactory      : Connection error. 'Error{condition=amqp:connection:forced, description='The connection was inactive for more than the allowed 60000 milliseconds and is closed by container 'LinkTracker'. TrackingId:9bbe750504544351b172806983132bef_G12, SystemTracker:gateway7, Timestamp:2019-01-11T14:53:52', info=null}'

2019-01-14 15:46:45.604  WARN 18908 --- [ef-8af7499a0297] c.m.a.s.primitives.RequestResponseLink   : Internal send link of requestresponselink to '$cbs' closed with error.

com.microsoft.azure.servicebus.primitives.ServiceBusException: Error{condition=amqp:connection:forced, description='The connection was inactive for more than the allowed 300000 milliseconds and is closed by container 'LinkTracker'. TrackingId:9bbe750504544351b172806983132bef_G12, SystemTracker:gateway7, Timestamp:2019-01-14T20:50:43', info=null}
    at com.microsoft.azure.servicebus.primitives.ExceptionUtil.toException(ExceptionUtil.java:113)
    at com.microsoft.azure.servicebus.primitives.RequestResponseLink$InternalSender.onClose(RequestResponseLink.java:837)
    at com.microsoft.azure.servicebus.amqp.BaseLinkHandler.processOnClose(BaseLinkHandler.java:68)
    at com.microsoft.azure.servicebus.amqp.BaseLinkHandler.onLinkRemoteClose(BaseLinkHandler.java:42)
    at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:176)
    at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108)
    at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:309)
    at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:276)
    at com.microsoft.azure.servicebus.primitives.MessagingFactory$RunReactor.run(MessagingFactory.java:481)
    at java.base/java.lang.Thread.run(Unknown Source)

共 (2) 个答案

  1. # 1 楼答案

    你在这里发布的是跟踪,而不是错误。是的,该服务会关闭10分钟内处于非活动状态的连接。客户端跟踪它并重新打开连接。它是无缝的,不会向应用程序抛出任何异常。那不可能是你的问题。如果你的发送失败意味着可能还有另一个问题,但不是这个问题

    调用sendAsync()时,它返回一个completable future。如果没有向应用程序抛出异常,这意味着一切都正常

  2. # 2 楼答案

    我也遇到过类似的问题,经过一番挖掘,我发现这个问题与网络有关

    我做了个测试

    • 启动接收器(听我的话题)
    • 关闭网络接口
    • 等待一段时间(5分钟)
    • 打开网络
    • 发送主题邮件

    作为回报,我得到了以下几点

    02:43:23.339 [reactor-executor-1] ERROR c.a.m.s.FluxAutoLockRenew$LockRenewSubscriber - Errors occurred upstream.
    connectionId[MF_541d1c_1619568823389] sessionName[run-job/subscriptions/test-consumer] entityPath[run-job/subscriptions/test-consumer] linkName[run-job/subscriptions/test-consumer_432ec3_1619568824168] Cannot create receive link from a closed session.
    02:43:23.344 [ioapp-compute-1] DEBUG com.pg.domain.airflow.RunDagPipeline - Received message: Left(ServiceBusError(com.azure.messaging.servicebus.ServiceBusException: connectionId[MF_541d1c_1619568823389] sessionName[run-job/subscriptions/test-consumer] entityPath[run-job/subscriptions/test-consumer] linkName[run-job/subscriptions/test-consumer_432ec3_1619568824168] Cannot create receive link from a closed session.,com.azure.messaging.servicebus.ServiceBusReceiverAsyncClient@46111612))