Fix #1585: add an SAP NetWeaver sink Kamelet - #3011
Merged
Merged
Conversation
camel-sap-netweaver is producerOnly and still current in the 4.22 catalog
(not deprecated, first shipped in 2.12.0), so a sink is both the right shape
and the only one available.
The command is a Kamelet property rather than a per-message input. The
component reads it from CamelNetWeaverCommand as a *mandatory* header --
there is no endpoint option for it -- and turns it straight into the request
path:
String command = ExchangeHelper.getMandatoryHeader(exchange, COMMAND, String.class);
httpExchange.getIn().setHeader(HTTP_PATH, command);
Setting that header from the pinned property means an inbound value cannot
choose the request path, which is the same posture as the dispatch-header
work in apache#2978. Verified with the terminal endpoint swapped for a log:
in: CamelNetWeaverCommand=ATTACKER-COMMAND, keepMe=yes
out: CamelNetWeaverCommand=OPERATOR-COMMAND, keepMe=yes
Marked Preview, no Citrus test: this needs a real SAP NetWeaver Gateway and
there is no emulator for one.
Verified against the real component with `camel run`: every parameter binds,
the gateway URL survives being embedded in the endpoint URI, and the route
fails only with UnknownHostException against a deliberately invalid host --
so it got as far as making the call.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tz352mt7yzGWLfvYTBo2Dk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1585.
camel-sap-netweaveris still current in the 4.22 catalog — not deprecated, first shipped in 2.12.0 — and it isproducerOnly, 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:
So the Kamelet exposes
commandas a required property and sets the header from it:That also means an inbound
CamelNetWeaverCommandis 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:The operator's command wins and unrelated headers are untouched.
Properties
urlcommandusernamepasswordformat: password+ credentials descriptorjsontrue; when false the gateway returns XML in Atom formatjsonAsMaptrue; turns the returned JSON into a MapflatternMaptrue; single-entry Map is unwrapped to its valueflatternMapkeeps the component's spelling, typo and all, rather than inventing a corrected name the underlying option would not accept.Verification
script/validatorreports no errors,script/generatoradds thenav.adocentry,mvn clean installpasses 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: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
Previewwithoutkamelet.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