Skip to content

CAMEL-24625: camel-platform-http-starter - wire up stripUriPrefix consumer option - #1940

Open
Croway wants to merge 2 commits into
apache:mainfrom
Croway:CAMEL-24625-platform-http-strip-uri-prefix
Open

CAMEL-24625: camel-platform-http-starter - wire up stripUriPrefix consumer option#1940
Croway wants to merge 2 commits into
apache:mainfrom
Croway:CAMEL-24625-platform-http-strip-uri-prefix

Conversation

@Croway

@Croway Croway commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes CAMEL-24625. The Spring Boot (servlet) platform-http engine ignored the stripUriPrefix consumer option (added for the Vert.x engine in apache/camel#26114), so the reverse-proxy pattern did not work:

from("platform-http:/reverse-proxy?matchOnUriPrefix=true&stripUriPrefix=true")
        .to("http://backend?bridgeEndpoint=true");

Change

  • SpringBootPlatformHttpConsumer: when stripUriPrefix=true, strip the consumer path from CamelHttpPath before routing (using HttpHelper.stripUriPrefix).

Test

  • One integration test covering the reverse-proxy usecase end to end: a request to /reverse-proxy/get reaches the backend as /get.

Claude Code on behalf of Croway

…sumer option

The platform-http consumer option stripUriPrefix (added to PlatformHttpEndpoint
in apache/camel via CAMEL-24625 / apache/camel#26114) was a no-op on the Spring
Boot (servlet) platform-http engine: nothing stripped the registered consumer
path from CamelHttpPath. Wire it up in SpringBootPlatformHttpConsumer, mirroring
the Vert.x engine, so that combined with the http producer's bridgeEndpoint
option a platform-http route becomes a path-based reverse proxy:

    from("platform-http:/reverse-proxy?matchOnUriPrefix=true&stripUriPrefix=true")
        .to("http://backend?bridgeEndpoint=true")   // /reverse-proxy/get -> http://backend/get

Only CamelHttpPath is rewritten; CamelHttpUri/CamelHttpUrl are left untouched.
Drop the duplicate servlet-context-path test class and the two extra
scenarios in favor of one end-to-end integration test covering the
reverse-proxy usecase (stripUriPrefix + matchOnUriPrefix + bridgeEndpoint).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants