I have a bean which produces objects and sends them to a SEDA queue using the ProducerTemplate in Camel.
I send a body and a header:
producerTemp.sendBodyAndHeader(document, "sourceSystem", sourceSys);
Here the header name is sourceSystem
and the header object value is an ENUM (sourceSys
) which contains the source of the document
object containing a number of differnt attribs.
I want to pull messages in a concurrent fashion from the SEDA queue and send them to different endpoints depending on the value of the sourceSys enum.
What is the most efficient EIP in camel to use this and does anyone have an example using Java DSL, I'm not sure how I can test the value of the Enum?
I am thinking I do something like this:
from("seda:a")
.choice()
.when(header("foo").isEqualTo(SourceSysEnum.SYSTEM1))
.to("seda:b")
.when(header("foo").isEqualTo(SourceSysEnum.SYSTEM2))
.to("seda:c")
.otherwise()
.to("seda:d");
..?