如何保持azure事件集线器连接活动以使用amqp接收批量诊断

问题描述 投票:0回答:1

我们在批处理帐户上启用了诊断功能,以便将事件流式传输到我们在应用程序中捕获的事件中心,以便根据批处理任务状态执行操作。但是我们注意到连接自动关闭(可能是因为没有事件发生在夜间),因此我们不得不每隔一段时间就将服务器反弹回来以再次接收事件/消息。

我们仍然依赖于java 7,这里是我们为批处理添加的依赖项:

       //azure dependency
        compile('com.microsoft.azure:azure-storage:7.0.0')
        compile('com.microsoft.azure:azure-batch:5.0.1') {
            //do not get transitive dependency com.nimbusds:nimbus-jose-jw because spring security still rely on old version of it
            excludes group: 'com.nimbusds', module: 'nimbus-jose-jw'
        }
        compile('com.fasterxml.jackson.core:jackson-core:2.9.8')
        compile('org.apache.qpid:qpid-amqp-1-0-common:0.32')
        compile('org.apache.qpid:qpid-amqp-1-0-client:0.32')
        compile('org.apache.qpid:qpid-amqp-1-0-client-jms:0.32')
        compile('org.apache.qpid:qpid-jms-client:0.40.0')
        compile('org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1')
        //end of azure dependency

这里是连接的代码片段,实际上我们使用了这里给出的代码示例:qazxsw poi,因为我们在azure doc本身找不到java 7的任何工作示例。

http://theitjourney.blogspot.com/2015/12/sendreceive-messages-using-amqp-in-java.html

那么有没有办法跟踪连接是否已关闭,如果是,请重新启动连接? 任何进一步诊断此问题的信息也将受到赞赏。

azure azure-eventhub azure-batch
1个回答
0
投票

我想我发现了这个问题,我使用了“SBCFR”作为connectionFactoryName,仔细查看链接中的示例,我应该使用“SBCF”。我还将lib“org.apache.qpid:qpid-jms-client”从版本“0.40.0”更新为“0.41.0”

同样在上面的代码中,我不应该使用AUTO_ACKNOWLEGDE因为最长时间我认为有些错误,因为我从未在本地设置中接收事件。原来其他机器也连接到同一个消费者群体,并且已经收到了消息。

© www.soinside.com 2019 - 2024. All rights reserved.