oscerd opened a new issue, #2973:
URL: https://github.com/apache/camel-kamelets/issues/2973
`http-sink` and `http-secured-sink` establish a pattern the rest of the
catalog does not follow:
```yaml
- removeHeader:
name: CamelHttpUri
- setHeader:
name: CamelHttpMethod
constant: "{{method}}"
- to: "{{url}}"
```
The Kamelet pins the destination as an operator-bound property and drops the
inbound header that would otherwise redirect it.
Across 95 `*-sink` Kamelets, only 7 contain any
`removeHeader`/`removeHeaders` step at all: `http-sink`, `http-secured-sink`,
`azure-functions-sink`, `mail-sink`, `solr-sink`, `salesforce-delete-sink`,
`salesforce-update-sink`. The rest pass every inbound header through to the
component producer, including headers the template never intended to expose and
that the producer treats as dispatch instructions.
Concretely, families where the producer documents header precedence over the
endpoint URI:
- **SQL/CQL sinks** (9) — `CamelSqlQuery` is documented as *"Query to
execute. This query takes precedence over the query specified in the endpoint
URI"*. No SQL sink strips it.
- **Cloud API sinks** (~15 aws2-*) — the aws2 producers resolve the
operation header-first; `aws-ddb-sink` even documents its own header as
"Overwrites the operation".
- **Broker sinks** (~11) — no destination-override header is stripped.
`kafka.OVERRIDE_TOPIC` is notable because it is not `Camel`-prefixed, so it
also survives an operator's `removeHeaders "Camel*"` mitigation.
- **HTTP sinks** — strip `CamelHttpUri` but not `CamelHttpPath` or
`CamelHttpQuery`.
- **`exec-sink`** — deliberately maps `args`/`ce-args` into
`CamelExecCommandArgs` (its documented contract) but does not strip
`CamelExecCommandExecutable`, `CamelExecCommandWorkingDir` or
`CamelExecCommandOutFile`, which are not part of that contract.
Whether a given inbound header actually reaches the exchange depends on the
source in front of the sink — several Camel source components apply a header
filter on ingest that drops `Camel`-prefixed names. That makes the practical
reach vary by topology, and it is the reason this is filed as consistency work
rather than as a defect in any one Kamelet. The non-`Camel`-prefixed cases
(`kafka.OVERRIDE_TOPIC`, `operation`) do not depend on that question.
Proposal: extend the `http-sink` discipline to the rest — each sink strips
the dispatch headers of its own component that the template does not
deliberately consume, immediately before `to:`. Best done per family rather
than as one sweep, since each needs its component's header list checked.
Related: #2871 (Kafka kamelets should use kamelet properties instead of
leaking Camel internal headers) covers the Kafka slice of this. Also #929.
_Claude Code on behalf of Andrea Cosentino_
--
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]