CreateSubscription
{
"topic": "_/_/things/twin/search/subscribe",
"headers": {
"content-type": "application/json",
"correlation-id": "444dae7e-bacf-312b-bc97-8f393dadf1bd"
},
"path": "/",
"value": {
"filter": "eq(/attributes/temperature,32)",
"options": "size(10),sort(+thingId)",
"namespaces": [
"org.eclipse.ditto"
]
},
"fields": "attributes"
}
RequestFromSubscription
{
"topic": "_/_/things/twin/search/request",
"headers": {
"content-type": "application/json"
},
"path": "/",
"value": {
"subscriptionId": "24601",
"demand": 3
}
}
CancelSubscription
{
"topic": "_/_/things/twin/search/cancel",
"headers": {
"content-type": "application/json"
},
"path": "/",
"value": {
"subscriptionId": "24601"
}
}
SubscriptionCreated
{
"topic": "_/_/things/twin/search/created",
"headers": {
"content-type": "application/json",
"correlation-id": "444dae7e-bacf-312b-bc97-8f393dadf1bd"
},
"path": "/",
"value": {
"subscriptionId": "24601"
}
}
SubscriptionNextPage
{
"topic": "_/_/things/twin/search/next",
"headers": {
"content-type": "application/json"
},
"path": "/",
"value": {
"subscriptionId": "24601",
"items": [{
"thingId": "default:thing1",
"attributes": {
"temperature": 35
}
},
{
"thingId": "default:thing2",
"attributes": {
"temperature": 35
}
}]
}
}
SubscriptionComplete
{
"topic": "_/_/things/twin/search/complete",
"headers": {
"content-type": "application/json"
},
"path": "/",
"value": {
"subscriptionId": "24601"
}
}
SubscriptionFailed
{
"topic": "_/_/things/twin/search/failed",
"headers": {
"content-type": "application/json"
},
"path": "/",
"value": {
"subscriptionId": "24601",
"error": {
"status": 400,
"error": "thing-search:subscription.protocol.error",
"message": "Rule 3.9: While the Subscription is not cancelled, Subscription.request(long n) MUST signal onError with a java.lang.IllegalArgumentException if the argument is <= 0. The cause message SHOULD explain that non-positive request signals are illegal.",
"description": "The intent of this rule is to prevent faulty implementations to proceed operation without any exceptions being raised. Requesting a negative or 0 number of elements, since requests are additive, most likely to be the result of an erroneous calculation on the behalf of the Subscriber."
}
}
}