Claus Ibsen created CAMEL-26272:
-----------------------------------

             Summary: camel-duckdb - the CamelDuckDbDatabasePath header should 
only change the database when an option allows it
                 Key: CAMEL-26272
                 URL: https://issues.apache.org/jira/browse/CAMEL-26272
             Project: Camel
          Issue Type: Improvement
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of duckdb (CAMEL-24961, PR #28393).

The {{CamelDuckDbDatabasePath}} header ({{DuckDbProducer}}, main 2a465aa4814c, 
line 49) makes the producer open a short-lived connection to the DuckDB file at 
that path, and creates the file when it does not exist. It bypasses the 
{{jdbcUrl}} or DataSource the endpoint is configured with. The 
{{CamelDuckDbQuery}} header (line 193) replaces the SQL of the endpoint. 
Checked on 4.24.0-SNAPSHOT: a header with a new path created the file.

A header that picks another database file is a strong override for a default: 
an endpoint configured with a DataSource does not expect a message to move it 
to another file.

Proposed:
* honour {{CamelDuckDbDatabasePath}} only with a new endpoint option (for 
example {{allowDatabasePathHeader}}, default false), with an entry in the 
upgrade guide;
* document on the page that the {{CamelDuckDbQuery}} and 
{{CamelDuckDbOperation}} headers override the endpoint.

_Claude Code on behalf of davsclaus_



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

Reply via email to