'Clean way extract path parameters from Camel HTTP endpoints

Ideally I would like to have a route like this:

from("jetty:http://0.0.0.0:8080/{pathParam1}/{pathParam2)

So that a consumer would then be able to access the value using:

exchange.getIn().getHeader("pathParam1")

The camel rest component supports this but I would then need to repeat the route for each request method (GET, PUT, etc.) and I am not sure if using the rest component adds overhead that I don't need.

I see that camel does automatically parse out query parameters into exchange headers, but I can only find the full path and want to avoid my own parsing.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source