【发布时间】:2019-06-26 16:24:42
【问题描述】:
我在一台机器上安装了 eclipse-hono,在另一台机器上安装了 Eclipse ditto,它连接到同一个 WIFI。我正在尝试将 Eclipse hono 中的数据消耗到 Eclipse 同上。
我创建了一个名为 tenantallAdapters 的租户并注册了一个名为 4716 的设备。
假设我需要将温度传感器数据从租户中注册的设备发送到 Hono 消费者,如下面的 sn-p 所示。
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 消费者中的数据。
我如何在 Ditto 中使用相同的数据,而不是 Hono 消费者?
已编辑:根据以下第一条评论中的博客:
为了测试Ditto沙箱是否可以连接到Hono,通过HTTP的“测试连接”命令如下
$ 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
我不确定我是否遗漏了什么
【问题讨论】:
标签: eclipse-hono eclipse-ditto eclipse-iot eclipse-digital-twin