Claus Ibsen created CAMEL-26153:
-----------------------------------

             Summary: camel-hivemq - the producer publishes a Map, POJO or 
number body as an empty payload, so the data is lost silently
                 Key: CAMEL-26153
                 URL: https://issues.apache.org/jira/browse/CAMEL-26153
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of rocketmq, hivemq, iggy and 
kafka-share (CAMEL-24961, PR #28394).

h4. 1. A body that does not convert to byte[] is published as an empty payload

{{HiveMQProducer.process}} (main 2a465aa4814c, line 69) reads the body with the 
non-mandatory {{getBody(byte[].class)}} and replaces null with {{new byte[0]}} 
(line 71). A {{Map}}, a POJO or an {{Integer}} body has no converter to 
{{byte[]}}, so it is published as an empty message without any error or log, 
and the data is lost. camel-paho fails the exchange for the same bodies. 
Checked on 4.24.0-SNAPSHOT with hivemq-ce 2026.5 in Docker (MQTT 5 and 3.1.1).

Proposed: use {{getMandatoryBody(byte[].class)}} when the body is not null, and 
keep the empty payload only for a null body.

_Claude Code on behalf of davsclaus_



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

Reply via email to