Claus Ibsen created CAMEL-26188:
-----------------------------------
Summary: camel-cometd - the producer publishes a stream body as
its toString and a File as its path, and a null body publishes nothing with no
error
Key: CAMEL-26188
URL: https://issues.apache.org/jira/browse/CAMEL-26188
Project: Camel
Issue Type: Bug
Components: camel-cometd
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of cometd and cometds (CAMEL-24961,
PR #28413).
h4. 1. A stream or File body is published as its toString
{{CometdBinding.createCometdMessage}} (main 2a465aa4814c, line 78) sets the
body as is as the Bayeux data. A stream body (a stream cache) reaches the
client as {{ByteArrayInputStreamCache@...}}, a File as its path, with no
conversion and no error. Checked on 4.24.0-SNAPSHOT with an embedded Jetty
CometD server and a BayeuxClient over loopback.
Proposed: convert stream and File bodies to text (or byte[]) before publishing,
or fail with a clear error.
h4. 2. A null body publishes nothing the client receives
With a null body, {{CometdProducer.ProducerService.process}} (line 116 to 119)
publishes a message with null data that the client never receives, and the
exchange succeeds. Checked on 4.24.0-SNAPSHOT with the same embedded server and
client.
Proposed: publish null as a JSON null the client receives, or fail (or log)
when the body is null.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)