I have a camel-spring-boot project where I load the destination url from a yml file with Spring's @ConfigurationProperties. As my destination is a HTTP url I am using camel-http4 component.
Now my URL is https://example.com/students/{id}/subject/{name}, which means I have to pass id and name parameter as path variables (not query parameter). My question is how can I pass these parameters? [Note: I can not put the URL in DSL or XML, it must be there in application.yml]
However, as a solution
//in some processor before toD()
headers.put("id", id);
headers.put("name", name);
//in yml
destination: https4://example.com/students/${header.id}/subject/${header.name}
But while loading this property from yml, Spring tries to evaluate ${header.id} as Spel expression (and throwing error that it could not find it) where as I mentioned it as Camel's simple expression. This same expression works with toD() if I use DSL, but not from yml.
Please let me know, if my approach is proper or not? If it is the way, then how can I get rid of this problem. Thanks in advance.