Skip to main content
Technical Preview

Overview

One client-mode connector, EclipseDitto, for the Eclipse Ditto HTTP API 2. Ditto is an open-source digital twin framework: every device or asset is a thing with attributes (static metadata) and features (groups of live properties and desired properties), and access is controlled per thing by a policy. Use the connector to keep a twin in step with the plant floor: merge each telemetry message from the broker into a feature, tag things with their UNS path and line, read the twin or a single property back, set a desired setpoint, send a live command through Ditto to the device, and find every twin on a line with one RQL search. Topics are cloud-iot/eclipse-ditto/<object>/<verb>; every reply goes to <topic>/response. Paths in the table are relative to /api/2.

Authentication

Ditto is self-hosted or run by a vendor, so authentication depends on how your gateway is set up. Every event sends Authorization: {authorization}, so pass the whole header value:
  • "Basic <base64(user:password)>" when Ditto sits behind nginx basic auth (the default Docker Compose stack, with user ditto).
  • "Bearer <JWT>" when Ditto is configured for an OpenID Connect provider such as Keycloak or Microsoft Entra ID.
Keep it in a broker secret (suggested DITTO_AUTHORIZATION) and map it in with GET SECRET. ListConnections and GetConnectionStatus are devops endpoints and need the devops credentials instead (suggested DITTO_DEVOPS_AUTHORIZATION). Wrong credentials return 401; a policy that does not grant READ or WRITE returns 403 or 404.

Basic Syntax

Set BASE_ADDRESS to your Ditto gateway or nginx front, with no trailing slash. For the local Docker Compose stack that is http://localhost:8080, with USE_SSL "false".

MQTT examples

Request bodies go under body, so control fields like authorization, thing_id and feature_id are not sent to Ditto. Thing ids are <namespace>:<name>. Create a twin for a press: create its policy on cloud-iot/eclipse-ditto/policy/put, then publish to cloud-iot/eclipse-ditto/thing/put:
Ditto returns 201 with the new thing, or 204 when it replaced an existing one. Merge telemetry into the twin: publish each reading to cloud-iot/eclipse-ditto/feature-properties/patch. It sends a JSON merge patch, so only the keys you send change and null removes a key:
Read one property back: publish {"authorization": "...", "thing_id": "org.coreflux:press-07", "feature_id": "telemetry", "property_path": "temperature"} to cloud-iot/eclipse-ditto/feature-property/get. Nested paths use slashes, for example "status/alarm". Set a desired setpoint: publish to cloud-iot/eclipse-ditto/desired-property/put with "property_path": "speed" and "body": 1500. The body is the raw JSON value, so a string must be a JSON string such as "body": "\"AUTO\"". Send a live command to the device: publish to cloud-iot/eclipse-ditto/thing-message/send:
With "timeout": "0" Ditto accepts the message with 202 and does not wait; with a timeout it waits for the device’s reply and returns 408 if no device answers in time. Find every twin on a line: publish to cloud-iot/eclipse-ditto/search/things with a pre-encoded RQL query:
cloud-iot/eclipse-ditto/search/count takes the same query and returns a number.

Helper actions

Keep the credentials in a broker secret and mirror plant telemetry into Ditto as it arrives:
DittoMirrorPressTelemetry assumes thing ids match the machine segment of the topic, for example org.coreflux:press07. Restrict who can publish to cloud-iot/eclipse-ditto/# with a rule: its payloads carry the credentials and can change twins and send commands to devices.

Notes

  • Errors come back on the response topic: 400 for bad JSON, a bad RQL filter or an invalid id, 401 for missing or wrong credentials, 403 when the policy does not allow the change, 404 for an unknown thing, feature, property or policy (or one you cannot see), 408 when a message times out, 412 when a condition fails, and 413 when an entity is too large.
  • PatchThing and PatchFeatureProperties send application/merge-patch+json. Every other write is a plain JSON PUT or POST.
  • The query field on search events and ids on ListThings must be URL-encoded. ListThings needs at least one id; use SearchThings to list without ids.
  • Ditto also has WebSocket, Server-Sent Events and its own MQTT and Kafka connections. For high-rate telemetry, a Ditto MQTT connection that subscribes to your Coreflux broker can be cheaper than one HTTP call per message. This template covers the HTTP API only and does not create connections.
  • The public sandbox https://ditto.eclipseprojects.io listed in the Ditto OpenAPI spec refused every request from our test machine, so test against your own instance.
Last modified on October 21, 2026