Via events you can send messages from your device to your application.
Bosch IoT Hub will guarantee the delivery of the message to the Things service. This means, if the connection between the Hub and Things is broken, the message will be queued in the Hub internal messaging infrastructure and will be delivered to Things as soon as the connection is established again. Then the Things service sends an acknowledgement about receiving the message to the Bosch IoT Hub.
Use cases for events
Events should be the communication pattern of choice if reliability is crucial for your business or functional requirements.
Due to the involved overhead for assured delivery and reliable processing and queuing, this approach has drawbacks considering latency and throughput.
A typical example for event messages is a fire alarm. This type of incident will happen only very rarely. But if it happens, it’s absolutely crucial that the message is sent and processed successfully.
At this point we assume that you went through all steps described at Getting started and have already registered a device and its corresponding thing.
The steps to send an event are the same as described in the previous Telemetry example - HTTP.
The starting point is Bosch IoT Hub - HTTP Adapter - event/post_event.
In our example we have now increased the temperature to 10 in order to make the difference easier to be acknowledged.
The payload to send to the Things service follows the Ditto protocol:
After Bosch IoT Hub has received the message from the device, it sends back an acknowledgement to the device.
After Things has processed the request, it sends the acknowledgement to Bosch IoT Hub.
Find the complete Ditto protocol specification examples at