Hey guys,
I have a bunch of routes very similar:
> from("direct:repo")
> .setHeader(HttpHeaders.AUTHORIZATION).constant("Basic XXX")
> .convertBodyTo(String.class, UTF_8.name())
... more steps
> .to("http4://{{service.url}}")
> .setHeader("repo", body());
from("direct:art")
> .setHeader(HttpHeaders.AUTHORIZATION).constant("Basic XXX")
> .convertBodyTo(String.class, UTF_8.name())
>
... same extra steps
.to("http4://{{service.url}}")
> .setHeader("art", body());
They are very similar... and there are more. The difference is this header
on the last line
I wonder if there is a better way to reuse this routes...
Would be nice if I could consolidate both into a direct:store
And then just call as direct:store?value=repo or direct:store?value=art
Them on setHeader(uri("value"), body());
Is there anything like this available?