我在一台机器上安装了eclipse-hono,在另一台机器上安装了Eclipse同上,连接到相同的WIFI。我正在尝试使用从Eclipse hono到Eclipse ditto的数据。
我已经创建了一个名为tenantallAdapters的租户,并注册了一个名为4716的设备。
让我们假设我需要将温度传感器数据从租户中注册的设备发送到Hono消费者,如以下代码片段所示。
curl -i -X POST \
-u sensor10@tenantAllAdapters \
-H 'Content-Type: application/json' \
--data-binary '{"temp": 5}' \
http://10.196.2.164:8080/telemetry我还启动了Hono-consumer,如下所示
mvn spring-boot:run -Drun.arguments=\
--hono.client.host=10.196.2.164,\
--hono.client.username=consumer@HONO,\
--hono.client.password=verysecret,\
--hono.auth.amqp.bindAddress=10.196.2.164,\
--hono.auth.amqp.keyPath=target/certs/auth-server-key.pem,\
--hono.auth.amqp.certPath=target/certs/auth-server-cert.pem,\
--hono.auth.amqp.trustStorePath=target/certs/trusted-certs.pem,\
--tenant.id=tenantAllAdapters我能够成功地在Hono consumer中接收数据。
我如何在Ditto中使用相同的数据而不是Hono消费者?
编辑:根据下面第一条评论中的博客:
为了测试Ditto沙箱是否可以连接到Hono沙箱,通过HTTP的“test connection”命令如下所示
$ curl -X POST -i -u devops:devopsPw1! -H 'Content-Type: application/json' -d '{
"targetActorSelection": "/system/sharding/connection",
"headers": {
"aggregate": false
},
"piggybackCommand": {
"type": "connectivity.commands:testConnection",
"connection": {
"id": "hono-sandbox-connection-1",
"connectionType": "amqp-10",
"connectionStatus": "open",
"uri": "amqp://consumer%40HONO:verysecret@hono.eclipse.org:15672",
"failoverEnabled": true,
"sources": [{
"addresses": [
"telemetry/org.eclipse.ditto",
"event/org.eclipse.ditto"
],
"authorizationContext": ["nginx:demo5"]
}]
}
}
}' https://ditto.eclipse.org/devops/piggyback/connectivity?timeout=8000我不确定我是不是错过了什么
发布于 2019-07-09 23:29:29
在我把这个问题贴在这里之前,我就已经关注了https://www.eclipse.org/ditto/2018-05-02-connecting-ditto-hono.html。
但我唯一遗漏的是devops用户的密码。正如前面提到的以及在给定链接中提到的,我使用的是devopsPw1!作为密码。我把密码改成foobar后,Hono和Ditto就联系上了。
发布于 2019-06-27 15:02:32
您可能希望遵循此博客文章中提供的指导:https://www.eclipse.org/ditto/2018-05-02-connecting-ditto-hono.html
https://stackoverflow.com/questions/56777282
复制相似问题