0

我已经使用Connectivity api将Eclipse honoEclipse ditto连接起来。当我设置它时,它工作正常。但是,一段时间后,转发连接失败。当我检索指标时,我得到以下响应:

{
    "?": {
        "?": {
            "type": "connectivity.responses:aggregatedResponse",
            "status": 200,
            "connectionId": "<connectionId>",
            "responsesType": "connectivity.responses:retrieveConnectionMetrics",
            "responses": {
                "connectivity-7cc7b5dc4c-6nn59": {
                    "type": "connectivity.responses:retrieveConnectionMetrics",
                    "status": 200,
                    "connectionId": "<connectionId>",
                    "connectionMetrics": {
                        "connectionStatus": "open",
                        "connectionStatusDetails": "Connected at 2019-03-19T08:28:53.211Z",
                        "inConnectionStatusSince": "2019-03-19T08:28:53.211Z",
                        "clientState": "CONNECTED",
                        "sourcesMetrics": [],
                        "targetsMetrics": [
                            {
                                "addressMetrics": {
                                    "gw/{{ thing:namespace }}/{{ thing:id }}": {
                                        "status": "failed",
                                        "statusDetails": "Producer closed at 2019-03-19T21:00:16.466Z",
                                        "messageCount": 2048,
                                        "lastMessageAt": "2019-03-19T21:00:05.361Z"
                                    }
                                },
                                "publishedMessages": 4070
                            }
                        ]
                    }
                }
            }
        }
    }
}

我一直在检查提到的时间的日志,但我没有收到任何错误。我在这里发布的日志是上述时间戳(2019-03-19T21:00:16.466Z)之前的最后一个和之后的第一个。

2019-03-19 21:00:11,771 DEBUG [ID:AMQP_NO_PREFIX:TelemetrySenderImpl-42872] o.e.d.s.c.m.a.AmqpPublisherActor akka://ditto-cluster/system/sharding/connection/7/tenant_aloxy_consumer-aloxy-forward/pa/$a/c1/amqpPublisherActor3
 - Message JmsTextMessage { org.apache.qpid.jms.provider.amqp.message.AmqpJmsTextMessageFacade@9bc051af } sent successfully.
2019-03-19 21:01:11,733 DEBUG [ID:AMQP_NO_PREFIX:TelemetrySenderImpl-42872] o.e.d.s.c.m.a.AmqpClientActor akka://ditto-cluster/system/sharding/connection/1/tenant_aloxy_consumer-aloxy/pa/$a/c1 - Inbound message: JmsInboundMessageDispatch { sequence = 38885, messageId = TelemetrySenderImpl-42873, consumerId = ID:a4925b59-1bb4-4cd8-9151-96ad422c36df:1:1:1 }

尽管所有同上服务的日志级别都设置为调试,但我没有得到任何有用的日志记录。
你们有谁知道我如何让日志记录来调查这个问题,或者更好的是,知道问题可能是什么以及如何解决它?

当我删除连接并重新创建它时,一切都会再次按预期工作。也许同上可以自动在引擎盖下做到这一点?

更新
通过 API 检索连接时,我收到以下响应(包括设置为 true 的 failoverEnabled 属性)。这也表明该连接使用 AMQP 1.0。使用的经纪人是 Enmasse。

{
    "?": {
        "?": {
            "type": "connectivity.responses:retrieveConnection",
            "status": 200,
            "connection": {
                "id": "<connectionId>",
                "name": null,
                "connectionType": "amqp-10",
                "connectionStatus": "open",
                "uri": "amqp://<consumer>:<password>@<amqp-host>:5672",
                "sources": [],
                "targets": [
                    {
                        "address": "gw/{{ thing:namespace }}/{{ thing:id }}",
                        "topics": [
                            "_/_/things/twin/events?filter=exists(features/alp)"
                        ],
                        "authorizationContext": [
                            "<auth-context>"
                        ]
                    }
                ],
                "clientCount": 1,
                "failoverEnabled": true,
                "validateCertificates": true,
                "processorPoolSize": 5,
                "tags": []
            }
        }
    }
}
4

1 回答 1

2

如果配置为 Eclipse Ditto 会自动进行故障转移(请参阅https://www.eclipse.org/ditto/basic-connections.html - 模型中的“failoverEnabled”属性)。然而,这可能是自您使用的 0.8.0 版以来有所改进。Ditto 团队目前正在开发 0.9.0-M1 版本,其中包含改进的重新连接行为。

与 Eclipse Hono 的连接是否会自动重新连接?您描述了“转发连接”时常失败。哪种技术(经纪人等)作为该gw/{{ thing:namespace }}/{{ thing:id }}地址的端点?

于 2019-03-20T13:14:33.297 回答