Ditto 1.3.0 is API and binary compatible to prior Eclipse Ditto 1.x versions.
Changelog
Compared to the latest minor release 1.2.0, the following changes, new features and bugfixes were added.
Changes
Update Pekko, Pekko HTTP and Scala to latest versions
The core libraries Ditto is built on were updated to their latest versions which should improve cluster stability and overall performance.
Removed OWASP security headers
Setting the OWASP recommended secure HTTP headers
(e.g. X-Frame-Options
, X-Content-Type-Options
, X-XSS-Protection
) was removed from the Ditto codebase as such
headers are typically set in a reverse proxy (e.g. nginx) or in a cloud loadbalancer in front of Ditto.
Ditto Java Client: Changed default initial reconnect behavior
A newly created configuration was added whether a Ditto Java Client should retry connecting to a Ditto backend
even when the initial connection attempt failed
(see the initialConnectRetryEnabled(boolean)
option on the WebSocketMessagingConfiguration
builder).
Previously, up to Ditto Java Client 1.2.x, the client always retried connecting, even when the initial connection
attempt failed.
We got feedback that this is not always desirable, e.g. when the credentials are wrong during development, the initial
connection should fail with an exception instead, so this is the new default behavior.
New features
Automatic creation of things
Added a payload mapper for connectivity which implicitly creates a new digital twin (thing) for incoming messages: ImplicitThingCreation Mapper.
This is very useful when e.g. a device connectivity layer (like Eclipse Hono) also automatically creates connected devices, for example when a new device connects for the first time to an IoT gateway.
This new feature can work together with the Hono feature for implicit registration of devices connected via gateways.
Use response of HTTP push connections as live message response
When HTTP connections there are now several options to respond to published live messages: [Responding to messages](HTTP connections
For example, it is possible to use the HTTP response of the foreign HTTP endpoint (Webhook) as Ditto live message response.
Raw payload mapper to enable raw pass-through of live messages
Added a payload mapper for connectivity which converts consumed messages via connectivity in “raw mode”: RawMessage mapper.
This mapper creates a Ditto Protocol live message from consumed messages preserving the payload (e.g. JSON or text, binary, etc.) and publishing that message again to interested subscribers.
This can be useful for connections which only need Ditto to forward a message to e.g. another connection or to a WebSocket.
Bugfixes
Several bugs in Ditto 1.2.x were fixed for 1.3.0.
This is a complete list of the
merged pull requests, including the fixed bugs.
Here as well for the Ditto Java Client: merged pull requests
Responses from HTTP /messages API were JSON escaped
With Ditto 1.2.0 HTTP responses to the POST /messages
APIs which transported application/json
were falsely JSON
escaped. As the fix for that had to be done in several steps and at several places, the fix is not backported to the
Ditto 1.2.0 line and it is suggested to update to Ditto 1.3.0 right away, if affected by this bug.
Putting _metadata
while creating a Thing does not work bug
When putting Metadata as part of a “create thing” API call, the metadata was not applied. Only when updating an existing thing, the metadata was applied.
Ditto Java Client: threads leakage
The Ditto Java client did not close/cleanup its threadpools when closing the client.
Migration notes
Check initialConnectRetryEnabled
option when upgrading to Ditto Java Client 1.3.0
If you require that you Ditto Java Client reconnects even when the first connection attempt failed (this might e.g.
be useful when you use the client in a backend application which might be restarted or scaled up/down at any given time),
please configure the initialConnectRetryEnabled(boolean)
to true
:
AuthenticationProvider authenticationProvider = ...;
MessagingProvider messagingProvider =
MessagingProviders.webSocket(WebSocketMessagingConfiguration.newBuilder()
.endpoint("wss://ditto.eclipseprojects.io")
.initialConnectRetryEnabled(true) // set this to true in order to enable retry on initial connection errors
.build(), authenticationProvider);
DittoClient client = DittoClients.newInstance(messagingProvider);
// ...