Camel Spring Boot

Azure IoT Hub

Send device-to-cloud telemetry messages and device twin reported properties to Azure IoT Hub.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-azure-iothub-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 12 options, which are listed below.

Name Description Default Type

camel.component.azure-iothub.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.azure-iothub.configuration

The configuration that each endpoint copies as its defaults, before the endpoint options are applied. The option is a org.apache.camel.component.azure.iothub.IoTHubConfiguration type.

IoTHubConfiguration

camel.component.azure-iothub.connection-string

The connection string of the device, with its HostName, DeviceId and SharedAccessKey. The producer opens one device client per hub, device and module of the connection string, and reuses it; an HTTPS endpoint uses a client of its own. The CamelAzureIoTHubConnectionString header replaces this option.

String

camel.component.azure-iothub.content-encoding

Content encoding applied to telemetry messages. Set it to an empty value to send telemetry without a content encoding, for example for a binary body such as Avro or Protobuf.

UTF-8

String

camel.component.azure-iothub.content-type

The content type of the telemetry message, which IoT Hub message routing needs to query the body. The contentEncoding option sets the content encoding.

application/json

String

camel.component.azure-iothub.delivery-mode

What the producer sends. TELEMETRY sends the body as a device-to-cloud message, TWIN updates the reported properties of the device twin, and BOTH does both. The CamelAzureIoTHubDeliveryMode header replaces this option.

telemetry

IoTHubDeliveryMode

camel.component.azure-iothub.device-client-eviction-interval

How often the component checks the pool for device clients that are unused for longer than deviceClientIdleTimeout, and closes them. A value of 0 or less uses 30 seconds.

30000ms

Duration

camel.component.azure-iothub.device-client-idle-timeout

How long a pooled device client can be unused before the component closes it. A client is unused when no producer sends with it. A value of 0 or less uses 5 minutes.

300000ms

Duration

camel.component.azure-iothub.enabled

Whether to enable auto configuration of the azure-iothub component. This is enabled by default.

Boolean

camel.component.azure-iothub.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.azure-iothub.protocol

The protocol of the device client. MQTT_WS and AMQPS_WS are MQTT and AMQPS over WebSocket on port 443. The SDK supports device twin operations only over MQTT, MQTT_WS, AMQPS and AMQPS_WS.

mqtt

IotHubClientProtocol

camel.component.azure-iothub.send-timeout

How long the producer waits for IoT Hub to acknowledge a telemetry message, and for each device twin request: getting the twin, updating its reported properties, and the subscription to desired properties when a device client is created. Opening the device client uses the retry policy of the Azure IoT SDK and is not limited by this timeout.

10000ms

Duration