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

   ## Backport of #28356
   
   **Original PR:** #28356 - CAMEL-26105: camel-aws2-athena - take the SQL from 
the message body only with useMessageBodyForSql
   **Original author:** @davsclaus
   **Target branch:** `camel-4.18.x`
   **JIRA:** [CAMEL-26105](https://issues.apache.org/jira/browse/CAMEL-26105) 
(fix version 4.18.6)
   
   Cherry-pick (`-x`) of the squash commit 78c989ec5182 of #28356 onto 
`camel-4.18.x`, **adapted** as planned in the JIRA for the maintenance lines, 
and the same as the `camel-4.22.x` backport: the order of where the SQL comes 
from changes, but no new option is added, so routes that set the SQL in the 
message body (as the component documentation examples do) keep working after a 
patch upgrade.
   
   **Behaviour on camel-4.18.x after this backport.** The `startQueryExecution` 
operation (the default operation) takes the SQL from the 
`CamelAwsAthenaQueryString` header, then from the `queryString` option, and 
from the message body only when neither is set. Before, the message body came 
first, so an endpoint configured with `queryString` ran the text of the message 
body whenever the message had one.
   
   **Adaptations (not a straight cherry-pick):**
   - `Athena2Producer.determineQueryString`: header, then `queryString`, then 
the message body. The `useMessageBodyForSql` option of `main` is not added. The 
error without any SQL names the header, the `queryString` option and the 
message body.
   - The `includeTrace` change is kept as on `main`: the from endpoint URI in 
the SQL comment is sanitized with `URISupport.sanitizeUri`, and left out when 
the exchange has no from endpoint (which failed with a `NullPointerException`).
   - The descriptions of the `queryString` option and of the 
`CamelAwsAthenaQueryString` header state this order. Generated files are 
regenerated by this branch's own build; the configurers and the URI factory do 
not change, because there is no new option. This branch has no generated copy 
of the component doc in the catalog, so none is added.
   - `Athena2ProducerQueryStringTest`: the tests of `useMessageBodyForSql` are 
replaced by tests of the branch order (header over body, body used without 
header and option, error without SQL), and the test uses 
`org.apache.camel.test.junit5.CamelTestSupport` as the other tests of this 
module on this branch. The changes of `main` to `AthenaComponentTest`, 
`AthenaEndpointTest`, `AthenaComponentConfigurationTest` and 
`AthenaComponentManualIT` (which only set or check the new option) are not 
backported.
   - Component docs: a short "Where the SQL comes from" section describing this 
order; the existing examples are unchanged, as they set no `queryString`.
   - Upgrade guide: the 4.24 entry of `main` is dropped; an entry for this line 
is added to `camel-4x-upgrade-guide-4_18.adoc` under "Upgrading from 4.18.5 to 
4.18.6". The same entry goes to that file on `main` in a follow-up doc-sync PR.
   
   Because the backport is adapted, it needs a normal review.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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