One way to do this is to assemble the list of destinations in a header,
then reference that. Here's a rough example:
.process( new Processor() {
public void process(Exchange exchange) {
Message in = exchange.getIn();
ListString mediaList = ((YourPojo) in.getBody()).getMedia();
I ended up with a Processor that built a new Map on a header iterating over
the media and prefixing each in the header variant.
I may in-line this in the camel route (as per your example) to level the
knowledge a little better though.
Thanks for the suggestions.
On 20 January 2015 at 15:16,
Map? I meant a ListString on the header, of course.
On 20 January 2015 at 16:00, James Green james.mk.gr...@gmail.com wrote:
I ended up with a Processor that built a new Map on a header iterating
over the media and prefixing each in the header variant.
I may in-line this in the camel route
.recipientList(simple(direct:${body.media}))
So media is a ListString property where each entry has a media value:
sms, email, etc.
What I get out of this is an exception (where sms is the only media):
org.apache.camel.component.direct.DirectConsumerNotAvailableException: No
consumers available
You can use a method call expression (aka java bean) where you add the
direct: prefix to the media headers.
Or try look at groovy or something which may be able to prefix to a
list. I think I have seen that done in fabric8 v1.
On Mon, Jan 19, 2015 at 6:32 PM, James Green
You mean a class implementing Expression?
On 19 January 2015 at 17:56, Claus Ibsen claus.ib...@gmail.com wrote:
You can use a method call expression (aka java bean) where you add the
direct: prefix to the media headers.
Or try look at groovy or something which may be able to prefix to a