ditto
ditto copied to clipboard
Process/forward messages conditionally based on on twin state
Similar to the conditional requests for CRUD of things it would be useful to apply a (RQL based) condition when processing messages in Ditto.
Example use cases:
- prevent sending duplicated alarm/alert messages from devices using a flag in the twin state:
POST /api/2/things/org.eclipse.ditto:my-thing-1/outbox/messages/fireAlarm?condition=ne(attributes/alarmConfirmed,true)
- e.g. a (mobile) app which would receive the "fireAlarm" for the first would set the
attributes/alarmConfirmed=true
- this would prevent the mobile app to receive the fireAlarm multiple times
- e.g. a (mobile) app which would receive the "fireAlarm" for the first would set the
- only dispatch messages to a device when it is currently online:
POST /api/2/things/org.eclipse.ditto:my-thing-1/inbox/messages/doSomething?condition=gt(features/ConnectionStatus/properties/status/readyUntil,time:now)