0
votes

I'd like to know if it's possible to have a camel component in a route that could accept two different components. Something like:

from("abc-component:queue.name.a")
   .doSomething
   .to("def-component:queue.name.b")

and the abc-component will accept both a jms-component and a file-component

1
I remember there being that exact scenario in the docs, with pollEnrich(). - Kayaman
your requirement is not very clear. Can you explain your use case. when you say it shud accept both jms and file component how exactly doyou mean? - pvpkiran

1 Answers

1
votes

Yes, you can implement such component yourself if you need that. No, there is not such component OOTB in Apache Camel. You can achieve the same result by separating common logic with direct route.

from("jms:something")
    .to("direct:common_logic");

from("file:somewhere")
    .to("direct:common_logic");

from("direct:common_logic")
    //do something
    .to("log:hi");