Ad 1)
Do you mean path parameters such as "/foo/{name}" or what exactly?Ad 2) Its detected for components that support toD optimizations (only a handful does) but most of the http based does. Ad 3) The toD http optimization logic is here https://github.com/apache/camel/blob/main/components/camel-http-base/src/main/java/org/apache/camel/http/base/HttpSendDynamicAware.java Its for rewriting the url to be static and provide dynamic parts as headers. So if you have a RAW query header then that will be taken into account if the http component supports that. Ad 4) Sounds like its affected by #1 On Tue, Jun 22, 2021 at 11:26 AM Calle Andersson <[email protected]> wrote: > > The most important questions (from my previously mail) which I hope to find > an answer to is: > > 1. How come the CamelHttpPath header is empty when a Camel REST DSL endpoint > doesn't consists of any path parameters? Is it by design or a bug? > > 2. In the toD documentation it says that for the optimisation to work, then > "The optimisation is detected and activated during startup of the Camel > routes with `toD's.". What does that mean? Could the URI of the camel-http > component (when used in toD) be written in a way which causes the > optimisation to not be detected? Could the usage of bridgeEndpoint(true) > affect the optimisation detection? > > Would optimization of the following example be detected (given that dynamic > computed path and query parameters exists): > .setHeader(Exchange.HTTP_RAW_QUERY, header(Exchange.HTTP_QUERY)) > > .toD(http("dummyHost:8181/dummySystem${header.CamelHttpPath}").bridgeEndpoint(true)) > > 3. Is the above usage of Exchange.HTTP_RAW_QUERY a valid way of using the > header with toD or is it a hack that happens to work now and might stop > working in later Camel releases? > > 4. Is there a way of handling paths with and without path parameters the same > way (when using toD with the camel-http component)? Currently I have to use > header.CamelServletContextPath when my REST endpoint doesn't consist of any > path parameter, e.g: > > .toD(http("dummyHost:8181/dummySystem${header.CamelServletContextPath}").bridgeEndpoint(true)) > > Thanks in advance, > Calle > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
