[ 
https://issues.apache.org/jira/browse/CAMEL-26189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on CAMEL-26189 started by Claus Ibsen.
-------------------------------------------
> camel-jgroups-raft - the producer silently skips a Map, Integer or POJO body, 
> and raftId and channelProperties are missing as endpoint options in the 
> catalog
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26189
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26189
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jgroups
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of jgroups and jgroups-raft 
> (CAMEL-24961, PR #28413).
> h4. 1. A body that does not convert to byte[] is silently skipped
> {{JGroupsRaftProducer.process}} (main 2a465aa4814c, line 60) reads the body 
> with the non-mandatory {{getBody(byte[].class)}}; for a Map, an Integer or a 
> POJO it is null and the producer only logs "Body is null, cannot call set 
> method on raftHandle." at DEBUG (line 84): nothing is replicated and the 
> exchange succeeds. Checked on 4.24.0-SNAPSHOT with local jgroups-raft 
> channels (raftABC.xml, InMemoryLog).
> Proposed: use a mandatory conversion to byte[] for a non-null body, so an 
> unsupported body fails the exchange.
> h4. 2. A List body fails with a misleading TypeConversionException
> A List body fails with a TypeConversionException about converting a String to 
> byte[] ("argument type mismatch"), which does not say that the List cannot be 
> converted. This likely comes from the core array conversion rather than the 
> component. Checked on 4.24.0-SNAPSHOT with the same local channels.
> Proposed: check where the List to byte[] conversion goes wrong, and give an 
> error that names the List body.
> h4. 3. raftId and channelProperties work as endpoint options but are not in 
> the catalog
> {{JGroupsRaftEndpoint}} (line 51 to 52) has the fields {{raftId}} and 
> {{channelProperties}} with setters (line 185 and 193) but no {{@UriParam}}, 
> so {{jgroups-raft:cluster?raftId=A&channelProperties=raft.xml}} works but the 
> catalog and the doc list them only as component options. Checked on 
> 4.24.0-SNAPSHOT with endpoint query parameters on local channels.
> Proposed: add {{@UriParam}} with a description to both fields (and 
> regenerate).
> h4. 4. The doc says the producer body must be a byte[]
> The component doc (jgroups-raft-component.adoc, line 89) says the body "must 
> be a {{byte[]}}", but text, stream and File bodies are converted and work.
> Proposed: say that the body is converted to byte[] (text, bytes, stream or 
> file).
> _Claude Code on behalf of davsclaus_



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

Reply via email to