blob: 57381113cebf9f5014b48ab39c265002fde4d82b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Eclipse Ditto Blog</title>
<description>Announcements, tutorials and examples around Eclipse Ditto and Digital Twins</description>
<link>https://www.eclipse.org/ditto/</link>
<atom:link href="https://www.eclipse.org/ditto/feed.xml" rel="self" type="application/rss+xml"/>
<pubDate>Wed, 09 Dec 2020 08:47:48 +0000</pubDate>
<lastBuildDate>Wed, 09 Dec 2020 08:47:48 +0000</lastBuildDate>
<generator>Jekyll v3.6.2</generator>
<item>
<title>Weak acknowledgments to decouple signal publishers and subscribers</title>
<description>&lt;h2 id=&quot;motivation&quot;&gt;Motivation&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;2020-08-31-release-announcement-120.html&quot;&gt;Ditto 1.2.0&lt;/a&gt; introduced at-least-once delivery via
&lt;a href=&quot;basic-acknowledgements.html&quot;&gt;acknowledgement requests&lt;/a&gt;.&lt;br /&gt;
It increased coupling between the publisher and the subscriber of signals in that the subscriber is no longer at the
liberty to filter for signals it is interested in. Instead, the subscriber must consume all signals in order to
fulfill acknowledgement requests and prevent endless redelivery.&lt;/p&gt;
&lt;p&gt;To combat the problem,
&lt;a href=&quot;2020-10-28-release-announcement-140.html&quot;&gt;Ditto 1.4.0&lt;/a&gt; made acknowledgement labels unique and introduced the requirement
to manage &lt;a href=&quot;basic-acknowledgements.html#issuing-acknowledgements&quot;&gt;&lt;em&gt;declared acknowledgements&lt;/em&gt;&lt;/a&gt;, identifying of each
subscriber.&lt;br /&gt;
It is now possible for Ditto to issue
&lt;a href=&quot;basic-acknowledgements.html#weak-acknowledgements-wacks&quot;&gt;&lt;em&gt;weak acknowledgements&lt;/em&gt;&lt;/a&gt; on behalf of the subscriber
whenever it decides to not consume a signal. That allows subscribers to configure RQL and namespace filters freely
without causing any futile redelivery.&lt;/p&gt;
&lt;div class=&quot;alert alert-info&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-info-circle&quot;&gt;&lt;/i&gt; &lt;b&gt;Note:&lt;/b&gt; Weak acknowledgements are available since Ditto 1.5.0.&lt;/div&gt;
&lt;h2 id=&quot;what-it-is&quot;&gt;What it is&lt;/h2&gt;
&lt;p&gt;A &lt;a href=&quot;basic-acknowledgements.html#weak-acknowledgements-wacks&quot;&gt;&lt;em&gt;weak acknowledgement&lt;/em&gt;&lt;/a&gt; is issued by Ditto for any
&lt;a href=&quot;basic-acknowledgements.html#requesting-acks&quot;&gt;acknowledgement request&lt;/a&gt; that will not be fulfilled now or ever without
configuration change.&lt;br /&gt;
A weak acknowledgement is identified by the header &lt;code class=&quot;highlighter-rouge&quot;&gt;ditto-weak-ack: true&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The status code of weak acknowledgements is &lt;code class=&quot;highlighter-rouge&quot;&gt;200 OK&lt;/code&gt;; it signifies that any redelivery is not to be made on their
account.&lt;/p&gt;
&lt;p&gt;A weak acknowledgement may look like this in Ditto protocol:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;com.acme/xdk_53/things/twin/acks/my-mqtt-connection:my-mqtt-topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ditto-weak-ack&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Acknowledgement was issued automatically, because the subscriber is not authorized to receive the signal.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;how-it-works&quot;&gt;How it works&lt;/h2&gt;
&lt;p&gt;Since Ditto 1.4.0, subscribers of &lt;em&gt;twin events&lt;/em&gt; or &lt;em&gt;live signals&lt;/em&gt; are required to declare unique acknowledgement labels
they are allowed to send. The labels of acknowledgement requests are then identifying the intended subscribers.&lt;br /&gt;
If the intended subscriber exists but does not receive the signal for non-transient reasons, Ditto issues
a weak acknowledgement for that subscriber.&lt;br /&gt;
Such reasons may be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The intended subscriber &lt;strong&gt;is not authorized&lt;/strong&gt; to receive the signal by policy;&lt;/li&gt;
&lt;li&gt;The intended subscriber did not subscribe for the signal type (&lt;em&gt;twin event, live command, live event or live message&lt;/em&gt;);&lt;/li&gt;
&lt;li&gt;The intended subscriber filtered the signal out by its &lt;a href=&quot;basic-changenotifications.html#filtering&quot;&gt;namespace or RQL filter&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;The intended subscriber dropped the signal because its &lt;a href=&quot;connectivity-mapping.html&quot;&gt;payload mapper&lt;/a&gt; produced nothing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;limitation&quot;&gt;Limitation&lt;/h2&gt;
&lt;p&gt;The distributed nature of cluster pub/sub means that weak acknowledgements are not always issued correctly.&lt;br /&gt;
They are only &lt;em&gt;eventually correct&lt;/em&gt; in the sense that some time after a change to the publisher-subscriber pair,
the issued weak acknowledgements will reflect the change.&lt;br /&gt;
Such changes include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Opening and closing of Websocket or other connections acting as the subscriber;&lt;/li&gt;
&lt;li&gt;Subscribing and unsubscribing for different signal types via Websocket;&lt;/li&gt;
&lt;li&gt;Modification of connections via the &lt;a href=&quot;connectivity-manage-connections.html&quot;&gt;connectivity API&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;Migration of a connection from one Ditto cluster member to another due to load balancing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;feedback&quot;&gt;Feedback?&lt;/h2&gt;
&lt;p&gt;Please &lt;a href=&quot;feedback.html&quot;&gt;get in touch&lt;/a&gt; if you have feedback or questions towards this new concept of weak
acknowledgements.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Mon, 16 Nov 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-11-16-weak-acknowledgements.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-11-16-weak-acknowledgements.html</guid>
<category>blog</category>
</item>
<item>
<title>Desired Feature Properties</title>
<description>&lt;h2 id=&quot;desired-feature-properties-added-to-things-model&quot;&gt;Desired feature properties added to things model&lt;/h2&gt;
&lt;p&gt;With the upcoming release of Eclipse Ditto &lt;strong&gt;version 1.5.0&lt;/strong&gt;
&lt;a href=&quot;basic-feature.html#feature-desired-properties&quot;&gt;desired feature properties&lt;/a&gt; are introduced to the things model for
&lt;strong&gt;API versions later than 1&lt;/strong&gt;. The &lt;em&gt;desired properties&lt;/em&gt; for features are added on the same level of the model as
the feature properties and can reflect for example feature property updates ,which are intended, but not yet applied.&lt;/p&gt;
&lt;div class=&quot;alert alert-info&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-info-circle&quot;&gt;&lt;/i&gt; &lt;b&gt;Note:&lt;/b&gt; Further logics for desired feature properties might be implemented in future Ditto
versions.&lt;/div&gt;
&lt;p&gt;A fully-fledged JSON representation of a feature with desired properties is shown below:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;lamp&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;definition&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;com.mycompany.fb:Lamp:1.0.0&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;properties&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;configuration&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;location&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;longitude&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;34.052235&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;latitude&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;-118.243683&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;color&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;blue&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;desiredProperties&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;configuration&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;operations-on-desired-feature-properties&quot;&gt;Operations on desired feature properties&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CRUD operations&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;You can create multiple desired properties of a feature or just single ones.&lt;/li&gt;
&lt;li&gt;You can retrieve all desired properties of a feature or just single ones.&lt;/li&gt;
&lt;li&gt;You can modify all desired properties of a feature or just single ones.&lt;/li&gt;
&lt;li&gt;You can delete all desired properties of a feature or just single ones.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;a href=&quot;httpapi-search.html&quot;&gt;search&lt;/a&gt; for things with specific desired properties with &lt;a href=&quot;basic-rql.html&quot;&gt;RQL-functions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You can search for things, which have &lt;a href=&quot;basic-rql.html#exists&quot;&gt;existent&lt;/a&gt; desired properties for a feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Get notified on changes&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;a href=&quot;basic-signals-event.html&quot;&gt;receive events&lt;/a&gt; for changes done to the desired properties of things
you’re authorized to read.&lt;/li&gt;
&lt;li&gt;You can &lt;a href=&quot;basic-enrichment.html&quot;&gt;enrich&lt;/a&gt; and &lt;a href=&quot;basic-changenotifications.html#filtering&quot;&gt;filter&lt;/a&gt; the
events you want to receive, for changes done to the desired properties.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;executing-crud-operations-on-desired-feature-properties&quot;&gt;Executing CRUD operations on desired feature properties&lt;/h3&gt;
&lt;p&gt;CRUD operations can be executed either via the &lt;a href=&quot;httpapi-concepts.html&quot;&gt;Ditto HTTP API&lt;/a&gt; &lt;strong&gt;versions later than 1&lt;/strong&gt; or via
&lt;a href=&quot;protocol-overview.html&quot;&gt;ditto-protocol&lt;/a&gt; messages.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Possible CRUD operations for desired feature properties via ditto-protocol&lt;/em&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-retrievedesiredproperties.html&quot;&gt;Retrieve all desired properties of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-retrievedesiredproperty.html&quot;&gt;Retrieve a single desired property of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-modifydesiredproperties.html&quot;&gt;Create/Modify all desired properties of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-modifydesiredproperty.html&quot;&gt;Create/Modify a single desired property of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-deletedesiredproperties.html&quot;&gt;Delete all desired properties of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;protocol-examples-deletedesiredproperty.html&quot;&gt;Delete a single desired property of a feature via ditto-protocol&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;using-the-ditto-client-to-manage-desired-feature-properties&quot;&gt;Using the ditto-client to manage desired feature properties&lt;/h3&gt;
&lt;p&gt;The desired feature properties can also be retrieved, modified and deleted via the &lt;a href=&quot;client-sdk-java.html&quot;&gt;Ditto Java Client&lt;/a&gt;.
With the upcoming (&lt;strong&gt;Ditto Java Client version 1.5.0&lt;/strong&gt;), no special CRUD operations for
desired feature properties are implemented in the client. Thus, the operations have to be executed via creating
&lt;strong&gt;ditto-protocol messages&lt;/strong&gt; manually in the client.&lt;/p&gt;
&lt;p&gt;Example for creating/modifying desired feature properties of a thing via the ditto-client:&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Adaptable&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;modifyFeatureDesiredProperties&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;Adaptable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TopicPath&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ThingId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;com.mycompany.fb:Car:1.0.0&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;things&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;twin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;modify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;withPayload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Payload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;JsonPointer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;/features/lamp/desiredProperties&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;withValue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;JsonObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;sendDittoProtocol&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;modifyFeatureDesiredProperties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;whenComplete&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;adaptable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;throwable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;throwable&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;LOGGER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Received error while sending ModifyFeatureDesiredProperties: '{}' &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;throwable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;LOGGER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Received response for ModifyFeatureDesiredProperties: '{}'&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;adaptable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;feedback&quot;&gt;Feedback?&lt;/h2&gt;
&lt;p&gt;Please &lt;a href=&quot;feedback.html&quot;&gt;get in touch&lt;/a&gt; if you have feedback or questions towards this new concept of desired properties.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Wed, 11 Nov 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-11-11-desired-properties.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-11-11-desired-properties.html</guid>
<category>blog</category>
</item>
<item>
<title>Announcing Eclipse Ditto Release 1.4.0</title>
<description>&lt;p&gt;Today, the Ditto team is happy to announce the next feature update of Ditto &lt;code class=&quot;highlighter-rouge&quot;&gt;1.x&lt;/code&gt;: &lt;strong&gt;Eclipse Ditto 1.4.0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1.4.0 focuses on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Declaration of acknowledgement labels unique to each subscriber&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please have a look at the &lt;a href=&quot;release_notes_140.html&quot;&gt;1.4.0 release notes&lt;/a&gt; for a more detailed information on the release.&lt;/p&gt;
&lt;p&gt;Also, some bugs were fixed which are not backported to Ditto 1.3.0 - it is recommended to update to Ditto 1.4.0 right
away and skip 1.3.0.&lt;/p&gt;
&lt;h2 id=&quot;artifacts&quot;&gt;Artifacts&lt;/h2&gt;
&lt;p&gt;The new Java artifacts have been published at the &lt;a href=&quot;https://repo.eclipse.org/content/repositories/ditto/&quot;&gt;Eclipse Maven repository&lt;/a&gt;
as well as &lt;a href=&quot;https://repo1.maven.org/maven2/org/eclipse/ditto/&quot;&gt;Maven central&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also the &lt;a href=&quot;client-sdk-java.html&quot;&gt;Ditto Java client&lt;/a&gt;’s artifacts were published to Maven central.&lt;/p&gt;
&lt;p&gt;The Docker images have been pushed to Docker Hub:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-policies/&quot;&gt;eclipse/ditto-policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things/&quot;&gt;eclipse/ditto-things&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things-search/&quot;&gt;eclipse/ditto-things-search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-gateway/&quot;&gt;eclipse/ditto-gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-connectivity/&quot;&gt;eclipse/ditto-connectivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-concierge/&quot;&gt;eclipse/ditto-concierge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;kubernetes-ready-helm-chart&quot;&gt;Kubernetes ready: Helm chart&lt;/h2&gt;
&lt;p&gt;In order to run Eclipse Ditto in a Kubernetes environment, best rely on the official
&lt;a href=&quot;https://hub.helm.sh/charts/eclipse-iot/ditto&quot;&gt;Helm chart&lt;/a&gt; and deploy Ditto via the Helm package manager.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Wed, 28 Oct 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-10-28-release-announcement-140.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-10-28-release-announcement-140.html</guid>
<category>blog</category>
</item>
<item>
<title>E2E acknowledgment</title>
<description>&lt;h2 id=&quot;e2e-acknowledgement-using-eclipse-ditto&quot;&gt;E2E acknowledgement using Eclipse Ditto&lt;/h2&gt;
&lt;p&gt;By adding the new &lt;a href=&quot;basic-acknowledgements.html&quot;&gt;acknowledgements feature&lt;/a&gt; to Ditto, it is now possible to provide an end to end QoS (quality of service) with level 1.
Previously the &lt;a href=&quot;architecture-services-connectivity.html&quot;&gt;connectivity service&lt;/a&gt; of Ditto did accept all incoming messages immediately as soon as it received the message.&lt;/p&gt;
&lt;p&gt;This behaviour can now be controlled by a Ditto header called &lt;a href=&quot;basic-acknowledgements.html#requesting-acks&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this blog post I will provide a few examples for how to use this new feature in the following scenarios:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Device publishes a change of its state and doesn’t care about whether the event regarding this change will be received by any subscriber or not.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-1---fire-and-forget&quot;&gt;fire and forget&lt;/a&gt; scenario.&lt;/li&gt;
&lt;li&gt;Device publishes a change of its state and wants to be sure it is persisted in Ditto.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-2---processed-in-ditto&quot;&gt;processed in Ditto&lt;/a&gt; scenario.&lt;/li&gt;
&lt;li&gt;Device publishes a change of its state and wants to be sure an application connected to Eclipse Ditto will receive the event regarding this change of the state.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-3---notification-scenario&quot;&gt;notification&lt;/a&gt; scenario.&lt;/li&gt;
&lt;li&gt;Device publishes a change of its state and wants to be notified when a subscriber was not able to receive the event regarding this change.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-4---tracked-notification-scenario&quot;&gt;tracked notification&lt;/a&gt; scenario.&lt;/li&gt;
&lt;li&gt;Device sends a live message and wants to be sure that it will eventually receive a response.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-5---long-running-live-message-scenario&quot;&gt;long running live message&lt;/a&gt; scenario.&lt;/li&gt;
&lt;li&gt;Device sends a live message and wants to either receive the response within a given timeout or never.&lt;br /&gt;
This is the &lt;a href=&quot;#scenario-6---asking-for-required-information-scenario&quot;&gt;asking for required information&lt;/a&gt; scenario.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;scenarios&quot;&gt;Scenarios&lt;/h2&gt;
&lt;p&gt;The following scenarios all share the same context:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a device sends data/messages via a device connectivity layer (e.g. &lt;a href=&quot;https://eclipse.org/hono/&quot;&gt;Eclipse Hono&lt;/a&gt; or an MQTT broker) to Ditto&lt;/li&gt;
&lt;li&gt;Ditto’s &lt;a href=&quot;architecture-services-connectivity.html&quot;&gt;connectivity service&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;consumes the &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message&lt;/li&gt;
&lt;li&gt;forwards the message into the Ditto cluster to be processed&lt;/li&gt;
&lt;li&gt;is responsible for technically acknowledging/settling the consumed message at the device connectivity layer / broker
&lt;ul&gt;
&lt;li&gt;the strategy of when this is done and with which outcome is handled by the Ditto headers mentioned in the scenarios&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Although all scenarios are based on the device sending something (e.g. telemetry data or a message), the
E2E acknowledgement can also be used the other way around when e.g. a backend application sends something to a device.&lt;/p&gt;
&lt;h3 id=&quot;scenario-1---fire-and-forget&quot;&gt;Scenario 1 - Fire and Forget&lt;/h3&gt;
&lt;p&gt;This is the simplest scenario of all, since the change can be published in a fire and forget semantics.&lt;/p&gt;
&lt;p&gt;In this scenario the device will send the modification command containing the headers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;response-required=false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks=[]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/twin/commands/modify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/features/lightSwitch/properties/status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For this case the connectivity service will immediately acknowledge the incoming message at the messaging system and then continues to process the command.&lt;/p&gt;
&lt;p&gt;It doesn’t matter if the command could be processed successfully or if any subscriber received an event for this change.&lt;/p&gt;
&lt;h3 id=&quot;scenario-2---processed-in-ditto&quot;&gt;Scenario 2 - Processed in Ditto&lt;/h3&gt;
&lt;p&gt;For this scenario the device wants to be sure its change will be properly persisted in Ditto.&lt;/p&gt;
&lt;p&gt;The command needs to define the following headers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;response-required=false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks=[&quot;twin-persisted&quot;]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/twin/commands/modify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;twin-persisted&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/features/lightSwitch/properties/status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For this case the connectivity service will wait until the modification will be properly persisted in Ditto before acknowledging the incoming message at the messaging system.&lt;/p&gt;
&lt;p&gt;If the device published this command for example via an AMQP broker (with a QoS 1 “at least once” semantic),
this will cause the broker to redeliver the command to Ditto if the acknowledgment fails.&lt;br /&gt;
Please be aware that a redelivery will only be requested for the following error status codes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;408&lt;/code&gt; (Request timed out)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;424&lt;/code&gt; (Dependency Failure)&lt;/li&gt;
&lt;li&gt;All kinds of &lt;code class=&quot;highlighter-rouge&quot;&gt;5xx&lt;/code&gt; status codes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this scenario it does matter if the command could be processed successfully, but it’s still not relevant if any subscriber received an event for this change.&lt;/p&gt;
&lt;h3 id=&quot;scenario-3---notification-scenario&quot;&gt;Scenario 3 - Notification scenario&lt;/h3&gt;
&lt;p&gt;For this scenario the device wants to be sure another system will be notified about the change of its state.&lt;/p&gt;
&lt;p&gt;This could be for example an alarming system which wants to be sure a backend application receives the information that the alarm was triggered.&lt;/p&gt;
&lt;p&gt;A prerequisite for this is that any kind of connection exists that publishes the event to the backend application and declares a user defined acknowledgement label.
This can be a &lt;a href=&quot;httpapi-protocol-bindings-websocket.html&quot;&gt;WebSocket session&lt;/a&gt; or any kind of Ditto Connection types which can be found &lt;a href=&quot;connectivity-overview.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For this example we expect the event to be forwarded by an &lt;a href=&quot;connectivity-protocol-bindings-http.html&quot;&gt;HTTP connection&lt;/a&gt;
which declared the following acknowledgement label as
&lt;a href=&quot;basic-connections.html#target-issued-acknowledgement-label&quot;&gt;issued acknowledgement of the target&lt;/a&gt;: &lt;code class=&quot;highlighter-rouge&quot;&gt;d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The UUID prefix in this case is the ID of the HTTP connection and the&lt;code class=&quot;highlighter-rouge&quot;&gt;backend-process&lt;/code&gt; part is a custom label, defined by the user.&lt;/p&gt;
&lt;p&gt;The command needs to define the following headers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;response-required=false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks=[&quot;d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&quot;]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;timeout=30s&lt;/code&gt; (optional. Default is 10s.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/twin/commands/modify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;timeout&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;30s&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/features/alarm/properties/status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For this case the connectivity service will wait until the HTTP request, which forwards the event regarding the thing change,
will be finished before acknowledging the incoming message at the messaging system.&lt;/p&gt;
&lt;p&gt;The status code of the HTTP response will in this case determine if the message will be acknowledged successfully or not and if a redelivery will be requested or not.&lt;br /&gt;
All kinds of &lt;code class=&quot;highlighter-rouge&quot;&gt;2xx&lt;/code&gt; status codes will lead to a successful acknowledgement at the messaging system.&lt;br /&gt;
All other status codes will lead to a failed acknowledgement at the messaging system and for the following status codes a redelivery will be requested:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;408&lt;/code&gt; (Request timed out)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;424&lt;/code&gt; (Dependency Failure)&lt;/li&gt;
&lt;li&gt;All kinds of &lt;code class=&quot;highlighter-rouge&quot;&gt;5xx&lt;/code&gt; status codes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this scenario it is ensured a specified subscriber will receive an event for this change.&lt;/p&gt;
&lt;h3 id=&quot;scenario-4---tracked-notification-scenario&quot;&gt;Scenario 4 - Tracked notification scenario&lt;/h3&gt;
&lt;p&gt;For this scenario the device wants to know when a system could not be notified about the change of its state.&lt;/p&gt;
&lt;p&gt;This could be for example an alarming system which wants to be sure a backend application receives the information,
or if not: tries to send an SMS as notification.&lt;/p&gt;
&lt;p&gt;This scenario is mostly like scenario 3, but needs to set the &lt;code class=&quot;highlighter-rouge&quot;&gt;response-required&lt;/code&gt; header to &lt;code class=&quot;highlighter-rouge&quot;&gt;true&lt;/code&gt; and it’s required
to &lt;a href=&quot;basic-connections.html#source-reply-target&quot;&gt;configure the reply-target of the source&lt;/a&gt; to also expect “nack” responses.&lt;/p&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/twin/commands/modify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/features/alarm/properties/status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;on&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In this case the device will receive an acknowledgement response containing the status code and payload of the response of the backend application.&lt;br /&gt;
Based on this the device can decide how to handle the situation.&lt;br /&gt;
It is suggested to publish the modification command with QoS 0 (“at most once” semantics) in this case because the
device handles the result of the E2E acknowledgement. With QoS 1 (“at least once” semantics) brokers would usually redeliver the message to Ditto.&lt;/p&gt;
&lt;p&gt;If the HTTP endpoint of the backend application responds with the following response:&lt;/p&gt;
&lt;p&gt;headers:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;content-type&quot;: &quot;application/json&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;body:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;errorCode&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;notification.smartphone.failed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Could not notify smartphone.&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;status code: &lt;code class=&quot;highlighter-rouge&quot;&gt;424&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The response received at the device would look like this:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/twin/acks/d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;d45d4522-142e-4057-ae87-8969343a3ddc:backend-processed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;timeout&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;30s&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;content-type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;application/json&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;errorCode&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;notification.smartphone.failed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;message&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Could not notify smartphone.&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;424&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3 id=&quot;scenario-5---long-running-live-message-scenario&quot;&gt;Scenario 5 - Long running live message scenario&lt;/h3&gt;
&lt;p&gt;For this scenario the device is going to ask for an information which it needs eventually.&lt;/p&gt;
&lt;p&gt;Let’s say the device asks for the endpoint where it should download the new firmware from.&lt;br /&gt;
It’s not required that this response arrives within a given time. It’s just required to eventually arrive at the device
and after it was received the device can signal the user, that it is ready to download the firmware.&lt;/p&gt;
&lt;p&gt;The headers of the live message should have the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;response-required=true&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks=[&quot;live-response&quot;]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/live/messages/firmware&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;live-response&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;content-type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;timeout&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5s&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/outbox/messages/firmware&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;firmware.url.query&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By requesting the acknowledgement &lt;code class=&quot;highlighter-rouge&quot;&gt;live-response&lt;/code&gt; the connectivity service will wait until the response for the live message arrived
for 5s before acknowledging the incoming message at the broker and will request a redelivery if the response did not arrive within this timeout.&lt;/p&gt;
&lt;p&gt;This will repeat until either the broker discards the message or the response arrives in the specified timeout.
That way it is guaranteed that the device will eventually receive the response.&lt;/p&gt;
&lt;h3 id=&quot;scenario-6---asking-for-required-information-scenario&quot;&gt;Scenario 6 - Asking for required information scenario&lt;/h3&gt;
&lt;p&gt;For this scenario the device is going to ask for an information which it needs right now to proceed with its current task.&lt;/p&gt;
&lt;p&gt;Let’s say the device asks if it should allow a car with a license plate it detected to drive on the property by opening the barrier.
It could be possible to ask for that information, so the barrier opens automatically, but providing a fallback mechanism
like entering a code directly at the device if this response does not arrive within time.&lt;/p&gt;
&lt;p&gt;The headers of the live message should have the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;response-required=true&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;requested-acks=[]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example &lt;a href=&quot;protocol-specification.html&quot;&gt;Ditto Protocol&lt;/a&gt; message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/my-thing/things/live/messages/car-enter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;headers&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;response-required&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;requested-acks&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;content-type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;timeout&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;5s&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/outbox/messages/car-enter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;FN IB 1337&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By requesting explicitly not requesting any acknowledgement but still requiring a response, the connectivity service will
immediately acknowledge the incoming message at the broker. The device will then either receive the response within the specified timeout or never.
So the device can provide its alternative options to open the barrier after 5 seconds.&lt;/p&gt;
&lt;h2 id=&quot;we-embrace-your-feedback&quot;&gt;We embrace your feedback&lt;/h2&gt;
&lt;p&gt;I hope I could demonstrate the power of the new acknowledgement feature properly and could make it clear how it can be used.
Maybe you did recognize some of your use cases in the given examples or maybe you have another use case which can or cannot be solved by this feature.&lt;/p&gt;
&lt;p&gt;We would love to get your &lt;a href=&quot;feedback.html&quot;&gt;feedback&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Fri, 23 Oct 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-10-23-end-2-end-acknowledgment.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-10-23-end-2-end-acknowledgment.html</guid>
<category>blog</category>
</item>
<item>
<title>Asynchronous Client Creation in Ditto Java Client 1.3.0</title>
<description>&lt;p&gt;Before &lt;a href=&quot;https://github.com/eclipse/ditto-clients/tree/master/java&quot;&gt;Ditto Java Client&lt;/a&gt; 1.3.0,
a client object connects to a configured Ditto back-end during its creation.&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;// create a client object and block until it connects to the Ditto back-end.&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DittoClient&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DittoClients&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newInstance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;messagingProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are several problems with the approach.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The calling thread blocks waiting for IO, namely the authentication process
and establishment of a websocket.&lt;/li&gt;
&lt;li&gt;If the client is configured to reconnect, then an incorrect end-ponit configuration
makes the factory method block forever.&lt;/li&gt;
&lt;li&gt;If the client is not configured to reconnect, then the factory method will throw
an exception. But it is not possible to give the client reference to the exception
handler, since the client creation did not complete. Consequently the exception handler
has no simple way to free all resources allocated for the client.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;1.3.0 addresses these problems by introducing an asynchronous client creation interface.&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DittoClients&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DisconnectedDittoClient&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;newDisconnectedInstance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MessagingProvider&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DisconnectedDittoClient&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;CompletionStage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DittoClient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;destroy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The method &lt;code class=&quot;highlighter-rouge&quot;&gt;DittoClients.newDisconnectedInstance(MessagingProvider)&lt;/code&gt; creates a &lt;code class=&quot;highlighter-rouge&quot;&gt;DisconnectedDittoClient&lt;/code&gt;
object. The &lt;code class=&quot;highlighter-rouge&quot;&gt;DisconnectedDittoClient&lt;/code&gt; has references to all resources allocated for the client and
can free them via the &lt;code class=&quot;highlighter-rouge&quot;&gt;destroy()&lt;/code&gt; method. The &lt;code class=&quot;highlighter-rouge&quot;&gt;DisconnectedDittoClient&lt;/code&gt; object offers no method to
interact with the Ditto API. By calling &lt;code class=&quot;highlighter-rouge&quot;&gt;connect()&lt;/code&gt;, one obtains a future that yields a familiar
&lt;code class=&quot;highlighter-rouge&quot;&gt;DittoClient&lt;/code&gt; object upon completion. One might use the asynchronous client creation interface thus:&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DisconnectedDittoClient&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;disconnectedClient&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;DittoClients&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;newDisconnectedInstance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;messagingProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;disconnectedClient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;thenAccept&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;startUsingDittoClient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;exceptionally&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exception&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;handleConnectionFailure&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;exception&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;disconnectedClient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;destroy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The asynchronous client creation interface has the following advantages.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The calling thread does not block.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Even if configured to reconnect, the user can receive connection errors via
the connection error handler in &lt;code class=&quot;highlighter-rouge&quot;&gt;MessagingConfiguration&lt;/code&gt; and shut down the client
at will.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When initial reconnection is disabled, the method &lt;code class=&quot;highlighter-rouge&quot;&gt;DisconnectedDittoClient.connect()&lt;/code&gt;
returns a failed future on connection error. It is possible to reference the
&lt;code class=&quot;highlighter-rouge&quot;&gt;DittoDisconnectedClient&lt;/code&gt; object in the future’s error handler, where the client can
be destroyed.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Thu, 08 Oct 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-10-08-asynchronous-client-creation.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-10-08-asynchronous-client-creation.html</guid>
<category>blog</category>
</item>
<item>
<title>Announcing Eclipse Ditto Release 1.3.0</title>
<description>&lt;p&gt;Today, the Ditto team is happy to announce the next feature update of Ditto &lt;code class=&quot;highlighter-rouge&quot;&gt;1.x&lt;/code&gt;: &lt;strong&gt;Eclipse Ditto 1.3.0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1.3.0 focuses on the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Implicit/automatic creation of digital twins (things)&lt;/li&gt;
&lt;li&gt;Use response of HTTP push connections as live message response&lt;/li&gt;
&lt;li&gt;“Raw” payload mapper for “pass-through” connectivity scenarios not affecting the twin&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please have a look at the &lt;a href=&quot;release_notes_130.html&quot;&gt;1.3.0 release notes&lt;/a&gt; for a more detailed information on the release.&lt;/p&gt;
&lt;p&gt;Also, some bugs were fixed which are not backported to Ditto 1.2.x - it is recommended to update to Ditto 1.3.0 right
away and skip 1.2.x.&lt;/p&gt;
&lt;h2 id=&quot;artifacts&quot;&gt;Artifacts&lt;/h2&gt;
&lt;p&gt;The new Java artifacts have been published at the &lt;a href=&quot;https://repo.eclipse.org/content/repositories/ditto/&quot;&gt;Eclipse Maven repository&lt;/a&gt;
as well as &lt;a href=&quot;https://repo1.maven.org/maven2/org/eclipse/ditto/&quot;&gt;Maven central&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also the &lt;a href=&quot;client-sdk-java.html&quot;&gt;Ditto Java client&lt;/a&gt;’s artifacts were published to Maven central.&lt;/p&gt;
&lt;p&gt;The Docker images have been pushed to Docker Hub:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-policies/&quot;&gt;eclipse/ditto-policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things/&quot;&gt;eclipse/ditto-things&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things-search/&quot;&gt;eclipse/ditto-things-search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-gateway/&quot;&gt;eclipse/ditto-gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-connectivity/&quot;&gt;eclipse/ditto-connectivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-concierge/&quot;&gt;eclipse/ditto-concierge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;kubernetes-ready-helm-chart&quot;&gt;Kubernetes ready: Helm chart&lt;/h2&gt;
&lt;p&gt;In order to run Eclipse Ditto in a Kubernetes environment, best rely on the official
&lt;a href=&quot;https://hub.helm.sh/charts/eclipse-iot/ditto&quot;&gt;Helm chart&lt;/a&gt; and deploy Ditto via the Helm package manager.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Wed, 30 Sep 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-09-30-release-announcement-130.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-09-30-release-announcement-130.html</guid>
<category>blog</category>
</item>
<item>
<title>Announcing Eclipse Ditto Release 1.2.0</title>
<description>&lt;p&gt;Today, the Ditto team is happy to announce the second minor (feature) update of Ditto &lt;code class=&quot;highlighter-rouge&quot;&gt;1.x&lt;/code&gt;:&lt;br /&gt;
&lt;strong&gt;Eclipse Ditto 1.2.0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1.2.0 focuses on the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“At least once” (QoS 1) processing of messages consumed/sent via Ditto’s managed &lt;a href=&quot;basic-connections.html&quot;&gt;connections&lt;/a&gt;
(via &lt;a href=&quot;basic-acknowledgements.html&quot;&gt;acknowledgements&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Addition of a &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;_created&quot;&lt;/code&gt; timestamp for newly created digital twins (things)&lt;/li&gt;
&lt;li&gt;Possibility to inject arbitrary &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;_metadata&quot;&lt;/code&gt; when modifying digital twins (things)&lt;/li&gt;
&lt;li&gt;Authenticate HTTP push connections with client certificates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please have a look at the &lt;a href=&quot;release_notes_120.html&quot;&gt;1.2.0 release notes&lt;/a&gt; for a more detailed information on the release.&lt;/p&gt;
&lt;h2 id=&quot;artifacts&quot;&gt;Artifacts&lt;/h2&gt;
&lt;p&gt;The new Java artifacts have been published at the &lt;a href=&quot;https://repo.eclipse.org/content/repositories/ditto/&quot;&gt;Eclipse Maven repository&lt;/a&gt;
as well as &lt;a href=&quot;https://repo1.maven.org/maven2/org/eclipse/ditto/&quot;&gt;Maven central&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also the &lt;a href=&quot;client-sdk-java.html&quot;&gt;Ditto Java client&lt;/a&gt;’s artifacts were published to Maven central.&lt;/p&gt;
&lt;p&gt;The Docker images have been pushed to Docker Hub:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-policies/&quot;&gt;eclipse/ditto-policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things/&quot;&gt;eclipse/ditto-things&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things-search/&quot;&gt;eclipse/ditto-things-search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-gateway/&quot;&gt;eclipse/ditto-gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-connectivity/&quot;&gt;eclipse/ditto-connectivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-concierge/&quot;&gt;eclipse/ditto-concierge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;kubernetes-ready-helm-chart&quot;&gt;Kubernetes ready: Helm chart&lt;/h2&gt;
&lt;p&gt;In order to run Eclipse Ditto in a Kubernetes environment, best rely on the official
&lt;a href=&quot;https://hub.helm.sh/charts/eclipse-iot/ditto&quot;&gt;Helm chart&lt;/a&gt; and deploy Ditto via the Helm package manager.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Mon, 31 Aug 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-08-31-release-announcement-120.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-08-31-release-announcement-120.html</guid>
<category>blog</category>
</item>
<item>
<title>Announcing Eclipse Ditto Release 1.1.0</title>
<description>&lt;p&gt;Today, approximately 4 months after Eclipse Ditto’s &lt;a href=&quot;2019-12-12-release-announcement-100.html&quot;&gt;1.0.0&lt;/a&gt; release,
the team is happy to announce the first minor (feature) update of Ditto &lt;code class=&quot;highlighter-rouge&quot;&gt;1.0&lt;/code&gt;:&lt;br /&gt;
&lt;strong&gt;Eclipse Ditto 1.1.0&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Ditto team was quite busy, 1.1.0 focuses on the following areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Management of &lt;a href=&quot;basic-policy.html&quot;&gt;Policies&lt;/a&gt; via &lt;a href=&quot;protocol-specification-policies.html&quot;&gt;Ditto Protocol&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Addition of policy APIs in Ditto &lt;a href=&quot;client-sdk-java.html&quot;&gt;Java client&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Possibility to &lt;a href=&quot;basic-search.html&quot;&gt;search&lt;/a&gt; via &lt;a href=&quot;protocol-specification-things-search.html&quot;&gt;Ditto Protocol&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Addition of search APIs in Ditto &lt;a href=&quot;client-sdk-java.html&quot;&gt;Java client&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enrich published Ditto events/message via additional &lt;a href=&quot;basic-enrichment.html&quot;&gt;custom fields&lt;/a&gt; of the affected thing
&lt;ul&gt;
&lt;li&gt;Addition of enrichment APIs in Ditto &lt;a href=&quot;client-sdk-java.html&quot;&gt;Java client&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Support for establishing managed &lt;a href=&quot;basic-connections.html&quot;&gt;connections&lt;/a&gt; via &lt;a href=&quot;connectivity-protocol-bindings-mqtt5.html&quot;&gt;MQTT 5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;End-2-end &lt;a href=&quot;basic-acknowledgements.html&quot;&gt;acknowledgements&lt;/a&gt; preparing Ditto to enable “at least once” processing
&lt;ul&gt;
&lt;li&gt;Addition of acknowledgement APIs in Ditto &lt;a href=&quot;client-sdk-java.html&quot;&gt;Java client&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Officially documented &lt;a href=&quot;installation-operating.html#pre-authentication&quot;&gt;pre-authenticated&lt;/a&gt; authentication mechanism&lt;/li&gt;
&lt;li&gt;Use of Java 11 for running Ditto containers&lt;/li&gt;
&lt;li&gt;Deprecation of API version 1 (authorization via &lt;a href=&quot;basic-acl.html&quot;&gt;ACL&lt;/a&gt; mechanism)&lt;/li&gt;
&lt;li&gt;Use of CBOR as cluster internal replacement for JSON serialization&lt;/li&gt;
&lt;li&gt;Further improvements on increasing throughput&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please have a look at the &lt;a href=&quot;release_notes_110.html&quot;&gt;1.1.0 release notes&lt;/a&gt; for a more detailed information on the release.&lt;/p&gt;
&lt;h2 id=&quot;artifacts&quot;&gt;Artifacts&lt;/h2&gt;
&lt;p&gt;The new Java artifacts have been published at the &lt;a href=&quot;https://repo.eclipse.org/content/repositories/ditto/&quot;&gt;Eclipse Maven repository&lt;/a&gt;
as well as &lt;a href=&quot;https://repo1.maven.org/maven2/org/eclipse/ditto/&quot;&gt;Maven central&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also the &lt;a href=&quot;client-sdk-java.html&quot;&gt;Ditto Java client&lt;/a&gt;’s artifacts were published to Maven central.&lt;/p&gt;
&lt;p&gt;The Docker images have been pushed to Docker Hub:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-policies/&quot;&gt;eclipse/ditto-policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things/&quot;&gt;eclipse/ditto-things&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things-search/&quot;&gt;eclipse/ditto-things-search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-gateway/&quot;&gt;eclipse/ditto-gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-connectivity/&quot;&gt;eclipse/ditto-connectivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-concierge/&quot;&gt;eclipse/ditto-concierge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;kubernetes-ready-helm-chart&quot;&gt;Kubernetes ready: Helm chart&lt;/h2&gt;
&lt;p&gt;In order to run Eclipse Ditto in a Kubernetes environment, best rely on the official
&lt;a href=&quot;https://hub.helm.sh/charts/eclipse-iot/ditto&quot;&gt;Helm chart&lt;/a&gt; and deploy Ditto via the Helm package manager.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Wed, 29 Apr 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-04-29-release-announcement-110.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-04-29-release-announcement-110.html</guid>
<category>blog</category>
</item>
<item>
<title>Digital twins of devices connected via LoRaWAN to TTN</title>
<description>&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/2020-04-16-Logo_TTVC_color.png&quot; alt=&quot;TTVC logo&quot; style=&quot;max-width:300px;padding-left:1em;float:right&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;A workshop of the &lt;a href=&quot;https://www.thethingsnetwork.org/article/the-things-virtual-conference&quot;&gt;2020 The Things Virtual Conference&lt;/a&gt;
on April 16th 2020 is/was about how to connect Eclipse Ditto to “The Things Network” via TTN’s MQTT broker in order to
automatically update digital twins of devices connected via LoRaWAN to the TTN backend.&lt;/p&gt;
&lt;p&gt;You can find the slides &lt;a href=&quot;slides/2020_04_16-ttn-virtual-conference/index.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This blogpost helps setting up this kind of connection and shall also be used as a step-by-step tutorial during
the workshop.&lt;/p&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube-nocookie.com/embed/D33JrN2RWiI&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;h2 id=&quot;requirements&quot;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;You’ll need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an operating system capable of running Docker (best use a Linux distribution)&lt;/li&gt;
&lt;li&gt;4 CPU cores and 4GB of RAM are advised (less can work, but the Ditto cluster startup is more fragile then)&lt;/li&gt;
&lt;li&gt;to have installed: &lt;code class=&quot;highlighter-rouge&quot;&gt;curl&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;git&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, you’ll need a TTN account and an existing application with at least one device if you want to follow the hands-on
part and want to create digital twins of your devices connected to TTN.&lt;/p&gt;
&lt;h2 id=&quot;preparation&quot;&gt;Preparation&lt;/h2&gt;
&lt;p&gt;Please follow these initial preparation steps (if you don’t already have Docker and Docker Compose installed).&lt;/p&gt;
&lt;p&gt;When you have access to a Kubernetes cluster and already have worked with &lt;a href=&quot;https://helm.sh&quot;&gt;Helm&lt;/a&gt; (the package manager
for Kubernetes), you can alternatively install Ditto via its official
&lt;a href=&quot;https://hub.helm.sh/charts/eclipse-iot/ditto&quot;&gt;Helm chart&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;install-docker&quot;&gt;Install Docker&lt;/h3&gt;
&lt;p&gt;Assumption: You’re running a Debian or Ubuntu based Linux distribution containing the &lt;code class=&quot;highlighter-rouge&quot;&gt;apt&lt;/code&gt; package manager.&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt install docker.io
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;service docker start
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;usermod &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-G&lt;/span&gt; docker &amp;lt;your-username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Logout and login again so that your user gets the “docker” group.&lt;/p&gt;
&lt;h3 id=&quot;install-docker-compose&quot;&gt;Install Docker Compose&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.docker.com/compose/install/&quot;&gt;Follow the installation guide here&lt;/a&gt;, in short:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;curl &lt;span class=&quot;nt&quot;&gt;-L&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;https://github.com/docker/compose/releases/download/1.25.4/docker-compose-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;uname &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;$(&lt;/span&gt;uname &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; /usr/local/bin/docker-compose
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;chmod +x /usr/local/bin/docker-compose
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3 id=&quot;clone-ditto-codebase&quot;&gt;Clone Ditto codebase&lt;/h3&gt;
&lt;p&gt;That is required to get the &lt;code class=&quot;highlighter-rouge&quot;&gt;docker-compose.yaml&lt;/code&gt; file and other resources required to run Ditto with Docker Compose.&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone &lt;span class=&quot;nt&quot;&gt;--depth&lt;/span&gt; 1 https://github.com/eclipse/ditto.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;startup-ditto-cluster&quot;&gt;Startup Ditto cluster&lt;/h2&gt;
&lt;p&gt;Change directory into the just cloned git repository - optionally adjust the &lt;code class=&quot;highlighter-rouge&quot;&gt;DITTO_EXTERNAL_PORT&lt;/code&gt; variable to where
Ditto is reachable after the start:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ditto/deployment/docker/
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DITTO_EXTERNAL_PORT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;80
docker-compose up &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Verify that Ditto is running:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker-compose ps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The output should look similar like this:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; Name Command State Ports
----------------------------------------------------------------------------------------
docker_concierge_1 /sbin/tini -- java -jar st ... Up 8080/tcp
docker_connectivity_1 /sbin/tini -- java -jar st ... Up 8080/tcp
docker_gateway_1 /sbin/tini -- java -Dditto ... Up 0.0.0.0:8081-&amp;gt;8080/tcp
docker_mongodb_1 docker-entrypoint.sh mongo ... Up 27017/tcp
docker_nginx_1 nginx -g daemon off; Up 0.0.0.0:80-&amp;gt;80/tcp
docker_policies_1 /sbin/tini -- java -jar st ... Up 8080/tcp
docker_swagger-ui_1 nginx -g daemon off; Up 80/tcp, 8080/tcp
docker_things-search_1 /sbin/tini -- java -jar st ... Up 8080/tcp
docker_things_1 /sbin/tini -- java -jar st ... Up 8080/tcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Verify that your Ditto cluster is healthy. Please give it ~1 minute in order to properly start up.&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; devops:foobar http://localhost:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DITTO_EXTERNAL_PORT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/status/health
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The returned output should start with:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;label&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;roles&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;status&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;UP&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If your Ditto cluster has trouble starting up (e.g. because you only have less CPU cores than advised), try the following
startup command instead:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker-compose start mongodb&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sleep 30&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; docker-compose start policies things&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sleep 60&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; docker-compose start concierge&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sleep 60&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; docker-compose start things-search&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sleep 60&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; docker-compose start connectivity&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; sleep 60&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; docker-compose up &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h2 id=&quot;configure-connection-to-ttn-mqtt-broker&quot;&gt;Configure connection to TTN MQTT broker&lt;/h2&gt;
&lt;p&gt;The Things Network provides a built in MQTT broker which you can connect to using your TTN application credentials.
For a more detailed description on that topic, please refer to the
&lt;a href=&quot;https://www.thethingsnetwork.org/docs/applications/mqtt/quick-start.html&quot;&gt;TTN MQTT Quick Start&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Eclipse Ditto can establish connections to MQTT brokers. This is a schematic picture of what we now will do:&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/../slides/images/ttn-ditto-via-mqtt.png&quot; alt=&quot;TTN to Ditto via MQTT&quot; style=&quot;max-width:600px;padding-left:1em&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;In order to connect to your own TTN application, perform the following steps.&lt;/p&gt;
&lt;p&gt;You can find the &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;AppId&amp;gt;&lt;/code&gt; (application ID) and &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;AppKey&amp;gt;&lt;/code&gt; (access key) in your TTN console of your application.
For &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;Region&amp;gt;&lt;/code&gt;, e.g. choose &lt;code class=&quot;highlighter-rouge&quot;&gt;'eu'&lt;/code&gt; when your application is in handled by the Handler ‘ttn-handler-eu’.&lt;/p&gt;
&lt;p&gt;Please export your application’s credentials locally to environment variables:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_REGION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;Region&amp;gt;'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_ID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;AppID&amp;gt;'&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_KEY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;AppKey&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After having done that, you can already create the connection of Ditto to the TTN MQTT broker:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; POST &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; devops:foobar &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{
&quot;targetActorSelection&quot;: &quot;/system/sharding/connection&quot;,
&quot;headers&quot;: {
&quot;aggregate&quot;: false
},
&quot;piggybackCommand&quot;: {
&quot;type&quot;: &quot;connectivity.commands:createConnection&quot;,
&quot;connection&quot;: {
&quot;id&quot;: &quot;ttn-connection-via-mqtt&quot;,
&quot;name&quot;: &quot;TTN-MQTT&quot;,
&quot;connectionType&quot;: &quot;mqtt&quot;,
&quot;connectionStatus&quot;: &quot;open&quot;,
&quot;uri&quot;: &quot;tcp://'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_ID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;':'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_KEY&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'@'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_REGION&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'.thethings.network:1883&quot;,
&quot;failoverEnabled&quot;: true,
&quot;clientCount&quot;: 1,
&quot;validateCertificates&quot;: false,
&quot;sources&quot;: [{
&quot;addresses&quot;: [
&quot;'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_ID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'/devices/+/up&quot;
],
&quot;consumerCount&quot;: 1,
&quot;qos&quot;: 0,
&quot;authorizationContext&quot;: [
&quot;pre-authenticated:ttn-connection&quot;
],
&quot;enforcement&quot;: {
&quot;input&quot;: &quot;{{ source:address }}&quot;,
&quot;filters&quot;: [
&quot;'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_APP_ID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'/devices/{{ thing:name }}/up&quot;
]
},
&quot;replyTarget&quot;: {
&quot;enabled&quot;: false
},
&quot;payloadMapping&quot;: [
&quot;ttn-demo-mapping&quot;
]
}],
&quot;mappingDefinitions&quot;: {
&quot;ttn-demo-mapping&quot;: {
&quot;mappingEngine&quot;: &quot;JavaScript&quot;,
&quot;options&quot;: {
&quot;incomingScript&quot;: &quot;function mapToDittoProtocolMsg(\n headers,\n textPayload,\n bytePayload,\n contentType\n) {\n\n let ttnJson = JSON.parse(textPayload);\n let deviceId = ttnJson['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'dev_id'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'];\n let payloadFields = ttnJson['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'payload_fields'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'];\n \n let attributesObj = {\n hardwareSerial: ttnJson['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'hardware_serial'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'],\n ttnCounter: ttnJson['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']\n };\n \n let featuresObj = {\n temperature: {\n properties: {\n value: payloadFields['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'temperature_7'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']\n }\n },\n pressure: {\n properties: {\n value: payloadFields['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'barometric_pressure_10'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']\n }\n },\n humidity: {\n properties: {\n value: payloadFields['&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'relative_humidity_8'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;']\n }\n }\n };\n \n let thing = {\n attributes: attributesObj,\n features: featuresObj\n };\n \n let dittoHeaders = {\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'response-required'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;': false,\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'If-Match'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;': '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'*'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\n };\n\n return Ditto.buildDittoProtocolMsg(\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'org.eclipse.ditto.ttn.demo'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n deviceId,\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'things'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'twin'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'commands'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'modify'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n '&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'/'&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;'&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;',\n dittoHeaders,\n thing\n );\n}&quot;,
&quot;outgoingScript&quot;: &quot;function mapFromDittoProtocolMsg() { return null; }&quot;,
&quot;loadBytebufferJS&quot;: &quot;false&quot;,
&quot;loadLongJS&quot;: &quot;false&quot;
}
}
}
}
}
}'&lt;/span&gt; http://localhost:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DITTO_EXTERNAL_PORT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/devops/piggyback/connectivity?timeout&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;8s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Explanation - what is done here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;using curl with the &lt;code class=&quot;highlighter-rouge&quot;&gt;devops&lt;/code&gt; (admin) user and its initial password &lt;code class=&quot;highlighter-rouge&quot;&gt;foobar&lt;/code&gt; we create a connection of type &lt;code class=&quot;highlighter-rouge&quot;&gt;mqtt&lt;/code&gt;
(you can find further information on that in Ditto’s &lt;a href=&quot;connectivity-protocol-bindings-mqtt.html&quot;&gt;MQTT docs&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;we use the TTN application credentials in the configured &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;uri&quot;&lt;/code&gt;, connect via plain TCP
(SSL is also possible but in this case a little more complicated as the server certificate of the TTN MQTT broker
would have to be imported)&lt;/li&gt;
&lt;li&gt;we add an entry in &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;sources&quot;&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;defining the MQTT topic (&lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;addresses&quot;&lt;/code&gt;) to subscribe to&lt;/li&gt;
&lt;li&gt;specifying in which &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;authorizationContext&quot;&lt;/code&gt; messages from this connection shall be executed&lt;/li&gt;
&lt;li&gt;defining in the &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;enforcement&quot;&lt;/code&gt; that, based on the MQTT topic, a device may only update the Ditto twin having the same name&lt;/li&gt;
&lt;li&gt;declaring that a custom payload mapping shall be applied for each incoming message&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;in the &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;mappingDefinitions&quot;&lt;/code&gt; we define the previously used “ttn-demo-mapping” as JavaScript based mapping:
&lt;ul&gt;
&lt;li&gt;only an “incoming” script is defined as we don’t handle downstream messages to TTN in this example&lt;/li&gt;
&lt;li&gt;when you want to understand the script in more depth, please take a look at the &lt;a href=&quot;#javascript-payload-mapping-script-in-detail&quot;&gt;details about it&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert alert-success&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-check-square-o&quot;&gt;&lt;/i&gt; &lt;b&gt;Tip:&lt;/b&gt; As you have other custom &lt;code class=&quot;highlighter-rouge&quot;&gt;payload_fields&lt;/code&gt; for your TTN devices, please adjust the script
if you want to see the device’s custom payload fields in your Ditto twins.&lt;/div&gt;
&lt;h2 id=&quot;create-a-common-policy-for-the-twins-to-be-created&quot;&gt;Create a common policy for the twins to be created&lt;/h2&gt;
&lt;p&gt;Eclipse Ditto secures each API access to the managed twins by applying authorization of the authenticated user.&lt;br /&gt;
Those “rules” which authenticated user may access which twins are defined in &lt;a href=&quot;basic-policy.html&quot;&gt;Policies&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In order to proceed with our scenario, we create a single Policy which shall be used for all twins we create in a later
step:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PUT &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; ditto:ditto &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{
&quot;policyId&quot;: &quot;org.eclipse.ditto.ttn.demo:twin-policy&quot;,
&quot;entries&quot;: {
&quot;USER&quot;: {
&quot;subjects&quot;: {
&quot;nginx:ditto&quot;: {
&quot;type&quot;: &quot;basic auth user authenticated via nginx&quot;
}
},
&quot;resources&quot;: {
&quot;thing:/&quot;: {
&quot;grant&quot;: [&quot;READ&quot;, &quot;WRITE&quot;],
&quot;revoke&quot;: []
},
&quot;policy:/&quot;: {
&quot;grant&quot;: [&quot;READ&quot;, &quot;WRITE&quot;],
&quot;revoke&quot;: []
},
&quot;message:/&quot;: {
&quot;grant&quot;: [&quot;READ&quot;, &quot;WRITE&quot;],
&quot;revoke&quot;: []
}
}
},
&quot;TTN&quot;: {
&quot;subjects&quot;: {
&quot;pre-authenticated:ttn-connection&quot;: {
&quot;type&quot;: &quot;used in the connections authorizationContext to the TTN MQTT&quot;
}
},
&quot;resources&quot;: {
&quot;thing:/&quot;: {
&quot;grant&quot;: [&quot;WRITE&quot;],
&quot;revoke&quot;: []
}
}
}
}
}'&lt;/span&gt; http://localhost:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DITTO_EXTERNAL_PORT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/api/2/policies/org.eclipse.ditto.ttn.demo:twin-policy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Explanation - what is done here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;we create a new Policy with the ID &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;org.eclipse.ditto.ttn.demo:twin-policy&quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;it contains 2 entries:
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;USER&quot;&lt;/code&gt;: this Policy entry contains the authorization information of the user of the twin APIs (authenticated via the contained “nginx” acting as reverse proxy).
This user may READ+WRITE the things (twins), this created policy and may also send and receive messages.&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;TTN&quot;&lt;/code&gt;: this Policy entry contains the authorization information of the connection to the TTN MQTT broker (the subject was configured as &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;authorizationContext&quot;&lt;/code&gt; when we created the connection.
This connection may only WRITE (update) the things (twins).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;create-digital-twins&quot;&gt;Create digital twins&lt;/h2&gt;
&lt;p&gt;Now we have everything in place in order to create digital twins for our devices connected to TTN.&lt;/p&gt;
&lt;p&gt;Please export all device ids you want to create digital twins for as comma separated environment variable:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_DEVICE_IDS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&amp;lt;comma-separated-list-of-your-device-ids&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After having done that, we can already create the twins in Ditto as the &lt;code class=&quot;highlighter-rouge&quot;&gt;ditto&lt;/code&gt; user:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;dev_id &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;TTN_DEVICE_IDS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;//,/ &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# call your procedure/other scripts here below&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Creating digital twin with Thing ID: org.eclipse.ditto.ttn.demo:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$dev_id&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; PUT &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; ditto:ditto &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Type: application/json'&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{
&quot;policyId&quot;: &quot;org.eclipse.ditto.ttn.demo:twin-policy&quot;
}'&lt;/span&gt; http://localhost:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DITTO_EXTERNAL_PORT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/api/2/things/org.eclipse.ditto.ttn.demo:&lt;span class=&quot;nv&quot;&gt;$dev_id&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Explanation - what is done here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;we split the passed in &lt;code class=&quot;highlighter-rouge&quot;&gt;TTN_DEVICE_IDS&lt;/code&gt; environment variable by &lt;code class=&quot;highlighter-rouge&quot;&gt;,&lt;/code&gt; and iterate over all contained device ids&lt;/li&gt;
&lt;li&gt;for each device ID we create a new Thing (twin) referencing the already previously created Policy&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;access-your-digital-twins-via-api&quot;&gt;Access your digital twins via API&lt;/h2&gt;
&lt;p&gt;Congratulations, if you have done it so far your TTN devices do now have digital twin representations in Eclipse Ditto.&lt;/p&gt;
&lt;div class=&quot;alert alert-success&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-check-square-o&quot;&gt;&lt;/i&gt; &lt;b&gt;Tip:&lt;/b&gt; Install the command line tool &lt;code class=&quot;highlighter-rouge&quot;&gt;jq&lt;/code&gt; and pipe the output of the below &lt;code class=&quot;highlighter-rouge&quot;&gt;curl&lt;/code&gt; commands to it in order to get
prettified and colored JSON&lt;/div&gt;
&lt;div class=&quot;alert alert-info&quot; role=&quot;alert&quot;&gt;&lt;i class=&quot;fa fa-info-circle&quot;&gt;&lt;/i&gt; &lt;b&gt;Note:&lt;/b&gt; Alternatively to &lt;code class=&quot;highlighter-rouge&quot;&gt;curl&lt;/code&gt;, you may also use the locally deployed swagger-ui at http://localhost:${DITTO_EXTERNAL_PORT}/apidoc/
in order to try out Ditto’s HTTP API - &lt;em&gt;make sure to select&lt;/em&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;/api/2 - local Ditto&lt;/code&gt; in the ‘Servers’
section - when asked for credentials, use username ‘ditto’ and password ‘ditto’&lt;/div&gt;
&lt;p&gt;You can now, for example, use Ditto’s HTTP APIs in order&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to retrieve the latest reported values: &lt;code class=&quot;highlighter-rouge&quot;&gt;curl -u ditto:ditto http://localhost:${DITTO_EXTERNAL_PORT}/api/2/things/org.eclipse.ditto.ttn.demo:&amp;lt;dev_id&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;to get a live stream of updates to the twins using SSE (Server Sent Events): &lt;code class=&quot;highlighter-rouge&quot;&gt;curl --http2 -u ditto:ditto -H 'Accept:text/event-stream' -N http://localhost:${DITTO_EXTERNAL_PORT}/api/2/things&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;to list all available twins via the search API: &lt;code class=&quot;highlighter-rouge&quot;&gt;curl -u ditto:ditto http://localhost:${DITTO_EXTERNAL_PORT}/api/2/search/things&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;alternatively, use your browser and open http://localhost:${DITTO_EXTERNAL_PORT}/api/2/search/things&lt;/li&gt;
&lt;li&gt;when asked for credentials, use username “ditto” and password “ditto”&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;formulate a search query, e.g. only searching for twins with a temperature above 24°, sorted by the last modification, the most recent first
to get the most active twin as first result:
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;curl -u ditto:ditto &quot;http://localhost:${DITTO_EXTERNAL_PORT}/api/2/search/things?filter=gt(features/temperature/properties/value,24.0)&amp;amp;option=sort(-_modified),size(5)&amp;amp;fields=thingId,policyId,attributes,features,_modified,_revision&quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;which-other-possibilities-do-we-now-have&quot;&gt;Which other possibilities do we now have?&lt;/h2&gt;
&lt;p&gt;Now you have all the possibilities Eclipse Ditto as digital twin framework provides, e.g.:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;directly use your device’s data in a web application consuming Ditto’s HTTP API&lt;/li&gt;
&lt;li&gt;directly use your device’s data in a mobile app using Ditto’s bidirectional &lt;a href=&quot;httpapi-protocol-bindings-websocket.html&quot;&gt;WebSocket&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;make use of the &lt;a href=&quot;https://github.com/eclpise/ditto-clients/&quot;&gt;Eclipse Ditto Java or JavaScript clients&lt;/a&gt; which also use the WebSocket to integrate your device’s data&lt;/li&gt;
&lt;li&gt;create another connection (optionally also applying JavaScript based payload mapping)
&lt;ul&gt;
&lt;li&gt;to e.g. &lt;a href=&quot;connectivity-protocol-bindings-kafka2.html&quot;&gt;Apache Kafka&lt;/a&gt; and forward all the modifications made to your devices to there&lt;/li&gt;
&lt;li&gt;or using &lt;a href=&quot;connectivity-protocol-bindings-http.html&quot;&gt;HTTP push&lt;/a&gt; in order to call another HTTP API (e.g. insert time series data into an InfluxDB via its HTTP API)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;For time reasons we do not go deeper into additional topics, they are possible however, please consult the Ditto
documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the WebSocket channel and subscribing for change notifications&lt;/li&gt;
&lt;li&gt;sending downward messages to devices&lt;/li&gt;
&lt;li&gt;live commands (not retrieving persisted data of devices, but live data)&lt;/li&gt;
&lt;li&gt;a more detailed introduction into authentication mechanisms (&lt;a href=&quot;installation-operating.html#openid-connect&quot;&gt;OpenID Connect with OAuth2.0 is possible&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;possibilities to configure your Policies on every resource level, e.g. allowing individuals to only access certain values of a twin&lt;/li&gt;
&lt;li&gt;and many other things..&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;additional-resources&quot;&gt;Additional resources&lt;/h2&gt;
&lt;h3 id=&quot;cleanup-after-the-workshop&quot;&gt;Cleanup after the workshop&lt;/h3&gt;
&lt;p&gt;Simply perform in the &lt;code class=&quot;highlighter-rouge&quot;&gt;ditto/deployment/docker&lt;/code&gt; folder:&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker-compose down
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And unistall docker + docker-compose (for docker-compose, just remove the downloaded file) again, if you don’t need it.&lt;/p&gt;
&lt;h3 id=&quot;javascript-payload-mapping-script-in-detail&quot;&gt;JavaScript payload mapping script in detail&lt;/h3&gt;
&lt;p&gt;Similar to the TTN console’s decoding/converting capabilities of “Payload Formats” of an TTN application, Ditto is able
to apply a custom JavaScript function for each consumed message.&lt;br /&gt;
That is necessary in order to convert the received data into a &lt;a href=&quot;protocol-overview.html&quot;&gt;Ditto Protocol&lt;/a&gt; message
including the JSON hierarchy of a so called &lt;a href=&quot;basic-thing.html&quot;&gt;Thing&lt;/a&gt; being the representation of a digital twin.&lt;/p&gt;
&lt;p&gt;As the above injected JavaScript payload mapping script is formatted in a single line, this is the script we used pretty
formatted, including the jsdoc of the provided function and some other inline comments.&lt;/p&gt;
&lt;p&gt;If you need to adjust the script in order to use your own &lt;code class=&quot;highlighter-rouge&quot;&gt;payload_fields&lt;/code&gt;, please replace all newlines with &lt;code class=&quot;highlighter-rouge&quot;&gt;\n&lt;/code&gt; and
escape the single quotes &lt;code class=&quot;highlighter-rouge&quot;&gt;'&lt;/code&gt; in the script with the following replacement: &lt;code class=&quot;highlighter-rouge&quot;&gt;'&quot;'&quot;'&lt;/code&gt;. Otherwise the single quotes won’t get
correctly escaped in the bash. You can remove the comments before making a single line of the script.&lt;/p&gt;
&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/**
* Maps the passed parameters to a Ditto Protocol message.
* @param {Object.&amp;lt;string, string&amp;gt;} headers - The headers Object containing all received header values
* @param {string} [textPayload] - The String to be mapped
* @param {ArrayBuffer} [bytePayload] - The bytes to be mapped as ArrayBuffer
* @param {string} [contentType] - The received Content-Type, e.g. &quot;application/json&quot;
* @returns {(DittoProtocolMessage|Array&amp;lt;DittoProtocolMessage&amp;gt;)} dittoProtocolMessage(s) -
* The mapped Ditto Protocol message,
* an array of Ditto Protocol messages or
* &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt; if the message could/should not be mapped
*/&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;mapToDittoProtocolMsg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;textPayload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;bytePayload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;contentType&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ttnJson&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;textPayload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// we simply parse the incoming TTN message as JSON&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;deviceId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ttnJson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'dev_id'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// and extract some fields we require&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;payloadFields&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ttnJson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'payload_fields'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// the 'payload_fields' content is - obviously - different for your application&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;attributesObj&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// the attributes of a Thing are meant for unstructured data &lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;hardwareSerial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ttnJson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'hardware_serial'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;ttnCounter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ttnJson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'counter'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;featuresObj&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// the features of a Thing e.g. contain sensor data of devices&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;temperature&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;payloadFields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'temperature_7'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;pressure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;payloadFields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'barometric_pressure_10'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;humidity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;payloadFields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'relative_humidity_8'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;thing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// a Thing can contain both attributes and features&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;attributesObj&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;features&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;featuresObj&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;dittoHeaders&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'response-required'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// we don't expect a response sent back to TTN&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'If-Match'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'*'&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// we only want to update the thing if it already exists&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Ditto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;buildDittoProtocolMsg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'org.eclipse.ditto.ttn.demo'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// this is the namespace used as prefix for Ditto Thing IDs&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;deviceId&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// the TTN device ID is used as &quot;name&quot; part of the Ditto Thing ID &lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'things'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'twin'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'commands'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'modify'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'/'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;dittoHeaders&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;thing&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;An example message received from the TTN MQTT broker:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;app_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;iot-campus-be12&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;dev_id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;node0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;hardware_serial&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;70B3D5499A2D3954&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;port&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;counter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9449&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;payload_raw&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;B2cA6AhoKwpzJ8oEAwH4&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;payload_fields&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;analog_out_4&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;5.04&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;barometric_pressure_10&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;1018.6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;relative_humidity_8&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;21.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;temperature_7&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;23.2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;metadata&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;would be transformed to the following Ditto Protocol message:&lt;/p&gt;
&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;topic&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;org.eclipse.ditto/node0/things/twin/commands/modify&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;attributes&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;hardwareSerial&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;70B3D5499A2D3954&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ttnCounter&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9449&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;features&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;temperature&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;properties&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;23.2&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;pressure&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;properties&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;1018.6&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;humidity&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;properties&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;value&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;21.5&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Thu, 16 Apr 2020 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2020-04-16-connecting-to-ttn-via-mqtt.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2020-04-16-connecting-to-ttn-via-mqtt.html</guid>
<category>blog</category>
<category>connectivity</category>
</item>
<item>
<title>Announcing Eclipse Ditto Release 1.0.0</title>
<description>&lt;p&gt;Today the Eclipse Ditto is thrilled to announce the availability of Eclipse Ditto’s first major release
&lt;a href=&quot;https://projects.eclipse.org/projects/iot.ditto/releases/1.0.0&quot;&gt;1.0.0&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;maturity&quot;&gt;Maturity&lt;/h2&gt;
&lt;p&gt;The initial code contribution was done in October 2017, 2 years later and 2 releases
(&lt;a href=&quot;2018-11-28-release-announcement-080.html&quot;&gt;0.8.0&lt;/a&gt; and &lt;a href=&quot;2019-07-10-release-announcement-090.html&quot;&gt;0.9.0&lt;/a&gt;) later, we
think its time to graduate from the Eclipse “incubation” phase and officially declare the project as mature.&lt;/p&gt;
&lt;p&gt;Recent adoptions and contributions from our community show us that Eclipse Ditto solves problems which also other
companies have. Adopters add Eclipse Ditto as a central part of their own IoT platforms.&lt;/p&gt;
&lt;h3 id=&quot;api-stability&quot;&gt;API stability&lt;/h3&gt;
&lt;p&gt;Having reached 1.0.0, some additional promises towards “API stability” do apply:&lt;/p&gt;
&lt;h4 id=&quot;http-api-stability&quot;&gt;HTTP API stability&lt;/h4&gt;
&lt;p&gt;Ditto uses schema versioning (currently schema version 1 and 2) at the HTTP API level in order to being able to
evolve APIs.
It is backward compatible to the prior versions 0.8.0 and 0.9.0.&lt;/p&gt;
&lt;h4 id=&quot;json-api-stability&quot;&gt;JSON API stability&lt;/h4&gt;
&lt;p&gt;Ditto kept its main JSON APIs (regarding things, policies and search) backwards compatible to 0.8.0 and 0.9.0 releases.
The JSON format of “connections” was changed since 0.9.0 and will from 1.0.0 on be kept backwards compatible as well.&lt;/p&gt;
&lt;h4 id=&quot;java-api-stability&quot;&gt;Java API stability&lt;/h4&gt;
&lt;p&gt;The Java APIs will for the 1.x release be kept backwards compatible, so only non-breaking additions to the APIs will be done. This is enforced by a Maven tooling.&lt;/p&gt;
&lt;p&gt;The following Java modules are treated as API for which compatibility is enforced:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ditto-json&lt;/li&gt;
&lt;li&gt;ditto-model-*&lt;/li&gt;
&lt;li&gt;ditto-signals-*&lt;/li&gt;
&lt;li&gt;ditto-protocol-adapter&lt;/li&gt;
&lt;li&gt;ditto-utils&lt;/li&gt;
&lt;li&gt;ditto-client&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;scalability&quot;&gt;Scalability&lt;/h3&gt;
&lt;p&gt;The focus on the 0.9.0 and 1.0.0 releases regarding non-functionals were laid on horizontal scalability.&lt;/p&gt;
&lt;p&gt;With Eclipse Ditto 1.0.0 we are confident to face production grade scalability requirements being capable of handling
millions of managed things.&lt;/p&gt;
&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;/h2&gt;
&lt;p&gt;The main changes compared to the last release, &lt;a href=&quot;release_notes_090.html&quot;&gt;0.9.0&lt;/a&gt;, are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;addition of a Java and a JavaScript client SDK in separate &lt;a href=&quot;https://github.com/eclipse/ditto-clients&quot;&gt;GitHub repo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;configurable OpenID Connect authorization servers&lt;/li&gt;
&lt;li&gt;support for OpenID Connect / OAuth2.0 based authentication in Ditto Java Client&lt;/li&gt;
&lt;li&gt;invoking custom foreign HTTP endpoints as a result of events/messages&lt;/li&gt;
&lt;li&gt;ability to reflect Eclipse Hono’s device connection state in Ditto’s things&lt;/li&gt;
&lt;li&gt;configurable throttling of max. consumed WebSocket commands / time interval&lt;/li&gt;
&lt;li&gt;Addition of “definition” field in thing at model level containing the model ID a thing may follow&lt;/li&gt;
&lt;li&gt;Improved connection response handling/mapping&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please have a look at the &lt;a href=&quot;release_notes_100.html&quot;&gt;1.0.0 release notes&lt;/a&gt; for a more detailed information on the release.&lt;/p&gt;
&lt;h2 id=&quot;artifacts&quot;&gt;Artifacts&lt;/h2&gt;
&lt;p&gt;The new Java artifacts have been published at the &lt;a href=&quot;https://repo.eclipse.org/content/repositories/ditto/&quot;&gt;Eclipse Maven repository&lt;/a&gt;
as well as &lt;a href=&quot;https://repo1.maven.org/maven2/org/eclipse/ditto/&quot;&gt;Maven central&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Docker images have been pushed to Docker Hub:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-policies/&quot;&gt;eclipse/ditto-policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things/&quot;&gt;eclipse/ditto-things&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-things-search/&quot;&gt;eclipse/ditto-things-search&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-gateway/&quot;&gt;eclipse/ditto-gateway&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-connectivity/&quot;&gt;eclipse/ditto-connectivity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hub.docker.com/r/eclipse/ditto-concierge/&quot;&gt;eclipse/ditto-concierge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img class=&quot;docimage&quot; src=&quot;images/ditto.svg&quot; alt=&quot;Ditto&quot; style=&quot;max-width: 500px&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;–&lt;br /&gt;
The Eclipse Ditto team&lt;/p&gt;
</description>
<pubDate>Thu, 12 Dec 2019 00:00:00 +0000</pubDate>
<link>https://www.eclipse.org/ditto/2019-12-12-release-announcement-100.html</link>
<guid isPermaLink="true">https://www.eclipse.org/ditto/2019-12-12-release-announcement-100.html</guid>
<category>blog</category>
</item>
</channel>
</rss>