davsclaus opened a new pull request, #28398:
URL: https://github.com/apache/camel/pull/28398

   _Claude Code on behalf of davsclaus_
   
   This group adds the catalog body types (CAMEL-24961) for eleven NoSQL and 
search components: cql, couchdb, arangodb, neo4j, mongodb-gridfs, influxdb, 
influxdb2, elasticsearch, elasticsearch-rest-client, opensearch and lucene. 
Each change is an `@BodyTypes` annotation on the Endpoint, plus the JSON it 
generates and the catalog copy. Seven doc pages had their body text corrected.
   
   **What the catalog says now**
   
   | Component | Consumer | Producer input | Producer output |
   |---|---|---|---|
   | cql | a List of the driver's `Row` per poll; one `Row` or null with ONE | 
the values of the `?` placeholders: an array or a Collection, or one value | a 
List of `Row` (empty for a write); one `Row` or null with ONE |
   | couchdb | the change as a Gson `JsonObject` (seq, id, revisions), not the 
document | the document as JSON object text, a JsonElement or a Cloudant 
`Document` | unchanged, with the id and the revision in headers; the `Document` 
for GET |
   | arangodb | | by operation: the document as a Map or a POJO, the key as 
text, the AQL as text | by operation: the result entity of the driver, the 
document or null, a List for AQL_QUERY, `Boolean` for the vertex and edge 
deletes |
   | neo4j | | `any`: by the CamelNeo4jOperation header, a Map or JSON text for 
CREATE_NODE, the Cypher as text, a vector | a List of Maps of the properties of 
the nodes for the retrieve and similarity operations; unchanged otherwise |
   | mongodb-gridfs | a stream of the content of the file | text, bytes, a 
stream or a file for create (the default) | unchanged for create; a stream for 
findOne; a Reader for listAll; `Long` for count |
   | influxdb | | an `org.influxdb.dto.Point`, or a Map with the measurement 
name; `BatchPoints` with batch=true | unchanged; `QueryResult` for query; 
`Pong` for ping |
   | influxdb2 | | a Point, a Measurement, Record or similar wrapper of the 
component, or a Map with the measurement name | unchanged; `Boolean` for PING |
   | elasticsearch, opensearch | | by operation: a document as JSON text, 
bytes, a stream, a Map, a POJO or a request builder; the id as text; a List for 
Bulk and MultiGet; a query as JSON text, a Map or a builder | by operation: the 
id as a `String` (Index, Update); the `GetResponse`; `HitsMetadata` for Search 
(an Iterator with useScroll); a List for MultiGet, MultiSearch and Bulk; the 
`Result` of Delete; `Boolean` for DeleteIndex, Exists and Ping |
   | elasticsearch-rest-client | | by operation: the JSON document; the id; a 
Map to match for SEARCH | the id; the source as JSON text; a JSON array for 
SEARCH; `Boolean` for the others |
   | lucene | | the text to index for insert | unchanged for insert; the `Hits` 
for query |
   
   **Checked at runtime.** Throwaway tests sent text, bytes, a stream, a file, 
a Map, a POJO and no body through every operation, and logged the class of the 
body after each step. They are not part of the PR.
   - **Docker:**
     - test-infra: Cassandra, CouchDB, ArangoDB, Neo4j, MongoDB, Elasticsearch 
9.1.0 and OpenSearch 3.9.0;
     - InfluxDB 1.8 and 2.7 (there is no test-infra for InfluxDB).
   - **Embedded:** Lucene.
   
   Not run:
   - a custom ResultSetConversionStrategy of cql;
   - the missing-key case of the arangodb vertex and edge finds;
   - ping of influxdb with the server down;
   - a `Reader` or `GenericFile` body for elasticsearch.
   
   **Choices**
   - elasticsearch, opensearch, elasticsearch-rest-client and arangodb have no 
default operation. Their default sides are the union of the operations, and 
byOption lists each operation.
   - neo4j takes its operation from a header only, so its sides are described 
per operation, without byOption.
   - couchdb takes its operation from a header only as well.
   - For the Search of elasticsearch, useScroll is part of the Search entry 
rather than an entry of its own.
   
   **Doc fixes**
   - **cql:**
     - Only null, an empty array or an empty Collection binds nothing; "" is 
one value.
     - The header takes a `SimpleStatement`, not a `RegularStatement`.
     - ONE gives null when there is no row.
   - **couchdb:**
     - Added that a Cloudant `Document` is accepted and that a JSON array fails.
     - Added the body after save, delete and GET.
     - The consumer gives the change, not the document.
     - The method and id headers are read.
   - **mongodb-gridfs:** count gives a `Long`, not an Integer, in the text and 
in both examples.
   - **influxdb2:** the measurement key of a Map is 
`CamelInfluxDB2MeasurementName`.
   - **elasticsearch, opensearch:**
     - DeleteIndex deletes the index of the indexName header or option, not the 
one named in a String body, and gives a Boolean.
     - The indexId header is optional.
   - **elasticsearch-rest-client:** SEARCH takes its JSON query only from the 
CamelElasticsearchSearchQuery header.
   
   Open PRs that change these modules do not touch the Endpoint classes or the 
generated files of this PR. #28381 changes the mongodb-gridfs consumer, but not 
the carrier of its body.
   
   **Bugs found, not fixed here.** The JIRAs, one per component, will follow.
   - **lucene:** the documents that `insert` writes can never be found. 
`LuceneIndexer.createFieldType` sets stored and tokenized, but never the index 
options, so the fields are stored and not indexed. A query for text that was 
inserted gave `Hits[numberOfHits=0]`. The srcDir indexing has the same problem. 
The tests do not show it: the query tests build their index directly, and the 
insert-and-query test does not check that there are hits. Each header and the 
body are also indexed as separate documents.
   - **couchdb:**
     - The consumer sets CamelCouchDbMethod to UPDATE or DELETE, and the 
producer reads that header as its operation. With UPDATE the producer does 
nothing, with no error, so a couchdb consumer routed to a couchdb producer 
never saves.
     - GET needs a body it does not use.
     - Invalid JSON text gives "No body available of type: java.lang.String but 
has type: java.lang.String".
     - A JSON array fails with "Could not save document [unknown reason]".
   - **arangodb:**
     - SAVE_DOCUMENT with a List and no multi header inserts the documents, 
then fails with "Cannot deserialize ... DocumentCreateEntity from Array value".
     - No operation fails on every message, not at startup.
   - **neo4j:**
     - CREATE_NODE with no body fails with a NullPointerException.
     - VECTOR_SIMILARITY_SEARCH: a List of Double fails with a misleading 
conversion error, and a text body with a NullPointerException.
     - The Cypher retrieve fails when the first column is not a node.
     - The similarity results drop the score.
     - The header metadata is wrong:
       - CamelNeo4jQueryResultListNeo4jNodes is described as an execution time;
       - CamelNeo4jQueryResultRetrieveSize is declared Long but is an Integer;
       - the `query` option and the CamelNeo4jLabel header are not used.
   - **mongodb-gridfs:**
     - An unknown operation does nothing, with no error.
     - listAll prints the id as `BsonObjectId{value=...}`.
     - The consumer sets no CamelFileName header.
     - From the code: the consumer ignores the exception of a failed exchange, 
so a failed file is still marked done and never retried.
   - **influxdb2:**
     - The Map-to-Point converter removes the measurement key and puts it back, 
so an immutable Map fails. influxdb 1 has the same converter.
     - A Point with no fields is dropped, with no error.
     - The endpoint always calls the server at start, even with 
autoCreateOrg=false, so a route cannot start while InfluxDB is down.
   - **influxdb:** a server error in the QueryResult, such as an unknown 
database, does not fail the exchange.
   - **elasticsearch, opensearch:**
     - The operation is picked from a built request in the body 
(`IndexRequest`, `GetRequest`), but the converters only take builders. So a 
built IndexRequest is indexed as a document, with a generated id, and a built 
GetRequest fails.
     - DeleteIndex ignores the index named in a String body.
     - Index and Update with no body or a `File` give an unclear error.
     - From the code: a Search as JSON text keeps only `query`, and drops size, 
sort and aggs without a warning.
   - **elasticsearch-rest-client:**
     - SEARCH ignores a JSON query in the body and matches every document.
     - For GET_BY_ID and DELETE, a body left from an earlier step wins over the 
CamelElasticsearchId header.
     - The page names the headers `INDEX_NAME` and `ID`.
   - **cql:** a no-op `copyFrom` in the producer (minor).
   
   **Local checks**
   - The changed modules build, with no change to the generated files after the 
build.
   - The catalog copies equal their modules.
   - camel-catalog, camel-yaml-dsl-validator and camel-jbang-core tests pass.
   - The Endpoint and Component DSLs regenerate with no change.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to