Claus Ibsen created CAMEL-27836:
-----------------------------------
Summary: camel-jcr: number header values are not stored, the
consumer never retries a failed listener registration
Key: CAMEL-27836
URL: https://issues.apache.org/jira/browse/CAMEL-27836
Project: Camel
Issue Type: Bug
Components: camel-jcr
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-jcr for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31142).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. Number header values are not stored
In {{JcrProducer}} (insert) and {{JcrConverter}} there is no
Long/Integer/Double/BigDecimal to javax.jcr.Value converter, so convertTo
returns null and node.setProperty(key, (Value) null) stores nothing. On getById
a LONG or DOUBLE property becomes a null header (both checked with tests).
Proposed change: add the converters (LongValue, DoubleValue, DecimalValue) or
use session.getValueFactory().
h4. 2. A failed listener registration is never retried
{{JcrConsumer.createSessionAndRegisterListener}} assigns the session before
addEventListener. If addEventListener throws (for example an unknown
nodeTypeNames entry), later checks find a live session and do not retry; the
consumer stays started without a listener.
Proposed change: log out and null the session when registering fails, or also
check eventListener != null.
h4. 3. An invalid uuids entry stops the session checks
An entry with a space ("a, b") makes NodeId.valueOf throw
IllegalArgumentException; the checker catches only RepositoryException, so the
executor stops all later checks.
Proposed change: trim the uuids and nodeTypeNames entries and catch Exception
in the checker.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)