Receiving responses from Ditto twin commans over Hono MQTT adapter [message #1847124] |
Fri, 15 October 2021 10:37 |
Vit Holasek Messages: 2 Registered: October 2021 |
Junior Member |
|
|
Hello.
I'm trying to integrate my device to Hono/Ditto stack (deployed by Cloud2Edge package helm chart) using MQTT protocol over Hono. I'm able to connect and sending twin modification commands and receiving event works good. But I'm not able to setup my client to receive command responses (e.g. for modify or especially retrieve command).
I'm sending RetrieveFeature command on telemetry channel with QoS 1:
{
"topic":"org.eclipse.packages.c2e/demo-device/things/twin/commands/retrieve",
"headers":{
"correlation-id":"f579404f-be7c-4799-80dc-4a7892c24fa3",
"ditto-message-direction":"FROM",
"response-required":"true"
},
"path":"/features/temperature"
}
I'm also subscribed to Hono command topic correctly. Policies are set and modify command on the same feature works. In Ditto logs the command seems to be processed but RetrieveFeatureResponse is never delivered to the device. The same for modify command.
Replies on Ditto/Hono connection are set in default way:
"sources":[
{
"addresses":[
"telemetry/org.eclipse.packages.c2e",
"event/org.eclipse.packages.c2e"
],
"consumerCount":1,
"authorizationContext":[
"pre-authenticated:hono-connection"
],
"enforcement":{
"input":"{{ header:device_id }}",
"filters":[
"{{ entity:id }}"
]
},
"acknowledgementRequests":{
"includes":[
],
"filter":"fn:filter(header:qos,'eq','1')"
},
"headerMapping":{
"hono-device-id":"{{ header:device_id }}",
"content-type":"{{ header:content-type }}"
},
"replyTarget":{
"address":"{{ header:reply-to }}",
"headerMapping":{
"content-type":"{{ header:content-type | fn:default('application/vnd.eclipse.ditto+json') }}",
"to":"command/org.eclipse.packages.c2e/{{ header:hono-device-id }}",
"subject":"{{ header:subject | fn:default(topic:action-subject) | fn:default(topic:criterion) }}-response",
"correlation-id":"{{ header:correlation-id }}"
},
"expectedResponseTypes":[
"response",
"error"
],
"enabled":true
}
},
{
"addresses":[
"command_response/org.eclipse.packages.c2e/replies"
],
"consumerCount":1,
"authorizationContext":[
"pre-authenticated:hono-connection"
],
"headerMapping":{
"content-type":"{{ header:content-type }}",
"correlation-id":"{{ header:correlation-id }}",
"status":"{{ header:status }}"
},
"replyTarget":{
"enabled":false
}
}
]
Can someone give me please advice what am I doing wrong or what else should be configured?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02943 seconds