Claus Ibsen created CAMEL-26146:
-----------------------------------
Summary: camel-jooq - operation=consume is listed but does not
exist, and an empty body inserts an empty record or fails with
NoSuchMethodException
Key: CAMEL-26146
URL: https://issues.apache.org/jira/browse/CAMEL-26146
Project: Camel
Issue Type: Bug
Components: camel-jooq
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of jooq (CAMEL-24961, PR #28393).
h4. 1. The catalog lists operation CONSUME, but JooqOperation has no such value
{{JooqConfiguration}} (main 2a465aa4814c, line 32) declares {{enums =
"NONE,EXECUTE,FETCH,CONSUME"}}, while {{JooqOperation}} (lines 20-22) has only
EXECUTE, FETCH and NONE. So the catalog and the docs offer
{{operation=consume}}, and an endpoint with it fails to be created. Checked on
4.24.0-SNAPSHOT with HSQLDB.
Proposed: remove CONSUME from the enums (the consumer is used through {{from}},
not through the operation).
h4. 2. Operation NONE with no body inserts an empty record
When the body is null, the producer expression in
{{JooqEndpoint.createProducerExpression}} (main 2a465aa4814c, line 97) creates
a new instance of the entity type, and {{JooqProducer.process}} (line 80)
stores it with {{batchStore}}. So a message with no body inserts an empty
record, with no error. Checked on 4.24.0-SNAPSHOT with HSQLDB.
Proposed: fail with a clear message when the body is null for operation NONE.
h4. 3. EXECUTE or FETCH with no body and no query option fails with
NoSuchMethodException
The same code (line 97) calls {{getInjector().newInstance(Query.class)}} or
{{newInstance(ResultQuery.class)}}, which are interfaces, so the call fails
with {{NoSuchMethodException: org.jooq.Query.<init>()}} instead of saying what
is missing. Checked on 4.24.0-SNAPSHOT with HSQLDB.
Proposed: fail with a message that a Query in the body or the {{query}} option
is required.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)