Eclipse ditto转发连接有时会失败

时间:2019-03-20 12:49:57

标签: eclipse-ditto

我已使用Eclipse honoEclipse dittoConnectivity api连接了。设置好后,效果很好。但是,一段时间后,转发连接失败。当我检索指标时,得到以下响应:

{
    "?": {
        "?": {
            "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": []
            }
        }
    }
}

1 个答案:

答案 0 :(得分:0)

如果配置了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 }}地址的终结点?