Federico Mariani created CAMEL-26810:
----------------------------------------

             Summary: camel-azure-iothub: map Camel headers to IoT Hub message 
properties on telemetry
                 Key: CAMEL-26810
                 URL: https://issues.apache.org/jira/browse/CAMEL-26810
             Project: Camel
          Issue Type: Improvement
          Components: camel-azure
            Reporter: Federico Mariani


In [PR #29489|https://github.com/apache/camel/pull/29489], 
{{TelemetryDeliveryStrategy}} builds each telemetry {{Message}} with a content 
type, a content encoding and a random message id, and nothing from the exchange.

Reproduced on the PR head (4701e30fe143) with a mocked {{DeviceClient}}, 
sending through {{IoTHubProducer.process}}:
* With a header {{level=critical}}, the sent message has 0 application 
properties. IoT Hub message routing queries on application properties cannot be 
used.
* {{CamelCorrelationId}} is not used. The message carries the random 
correlation id the SDK assigns by default.
* When the first {{sendEvent}} throws a retryable {{IotHubClientException}} 
(THROTTLED), the component retries with a new message id (6c56ee11-... on the 
first attempt, f90edc7d-... on the second). A downstream consumer cannot 
recognise the duplicate.

h3. Proposal
* Map headers to application properties through a {{HeaderFilterStrategy}}, as 
other components do.
* Add headers for the message id, the correlation id and the user id.
* Generate the message id once per exchange and reuse it on retries.

_Claude Code on behalf of Croway_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to