oscerd opened a new pull request, #3011:
URL: https://github.com/apache/camel-kamelets/pull/3011

   Fixes #1585.
   
   `camel-sap-netweaver` is still current in the 4.22 catalog — not deprecated, 
first shipped in 2.12.0 — and it is `producerOnly`, so a sink is both the right 
shape and the only one available.
   
   ## The command is a property, not a per-message header
   
   This is the one design decision worth explaining. The component takes the 
OData command from a **mandatory header**; there is no endpoint option for it, 
and it becomes the request path:
   
   ```java
   String command = ExchangeHelper.getMandatoryHeader(exchange, 
NetWeaverConstants.COMMAND, String.class);
   ...
   httpExchange.getIn().setHeader(NetWeaverConstants.HTTP_PATH, command);
   ```
   
   So the Kamelet exposes `command` as a required property and sets the header 
from it:
   
   ```yaml
         - setHeader:
             name: CamelNetWeaverCommand
             constant: "{{command}}"
   ```
   
   That also means an inbound `CamelNetWeaverCommand` is overwritten rather 
than honoured, so a caller cannot pick the request path — the same posture as 
the dispatch-header work in #2978. Verified with the terminal endpoint swapped 
for a log:
   
   ```
   in:  CamelNetWeaverCommand=ATTACKER-COMMAND, keepMe=yes
   out: CamelNetWeaverCommand=OPERATOR-COMMAND, keepMe=yes
   ```
   
   The operator's command wins and unrelated headers are untouched.
   
   ## Properties
   
   | property | notes |
   |---|---|
   | `url` | **required** — the gateway server URL |
   | `command` | **required** — the OData command, sent as the request path |
   | `username` | **required** by the component; credentials descriptor |
   | `password` | **required** by the component; `format: password` + 
credentials descriptor |
   | `json` | default `true`; when false the gateway returns XML in Atom format 
|
   | `jsonAsMap` | default `true`; turns the returned JSON into a Map |
   | `flatternMap` | default `true`; single-entry Map is unwrapped to its value 
|
   
   `flatternMap` keeps the component's spelling, typo and all, rather than 
inventing a corrected name the underlying option would not accept.
   
   ## Verification
   
   `script/validator` reports no errors, `script/generator` adds the `nav.adoc` 
entry, `mvn clean install` passes **with tests** from the repository root.
   
   Binding checked against the real component with `camel run` — worth doing 
here because the gateway URL contains `://` and gets embedded in the endpoint 
URI, which is exactly the sort of thing that fails quietly:
   
   ```
   Routes startup (total:1 started:1 kamelets:1)
   ... java.net.UnknownHostException: gateway.example.invalid
   ```
   
   Every parameter binds, the URL survives, and the route gets as far as 
attempting the HTTP call, failing only on the deliberately invalid host.
   
   **No Citrus test** — this needs a real SAP NetWeaver Gateway and there is no 
emulator for one, so it ships `Preview` without `kamelet.verified=true`.
   
   The icon is a plain SVG glyph authored for this Kamelet, consistent with how 
other non-vendor Kamelets are handled.
   
   ---
   _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]

Reply via email to