Hi Serge,
It's not a splitter, trust me :).
Again, it is not possible to solve the semantic ambiguity (or at least I
don't know how) in the case
from(a).to(b)
from(a).to(c)
unless an implicit multicast is assumed. So this case we treat as
illegal. If a multicast is indeed desired there is a MulticastProcessor
and a multicast verb in the dsl to achieve that:
from("a").multicast().to("b", "c");
I get your point on policies. i suspect there are some gremlins there
that need revisiting. James introduced the concept of block recently,
so if you want to limit the scope of a policy you'd probably want
something like this:
from(a).policy(requiresnew).to(b).to(c).end().to(d)
if you want the policy applied say only for the interaction and b and c.
You are right about the pipeline.
from("jms:A").pipeline("bean:example", "jms:B")
would work just as well.
Cheers
Hadrian
ssv wrote:
Thanks for so rapid response :)
I'm still a bit confused :).
1. I still think it's a splitter (next rule in router if you preffer). In
sources you can see that abstract processor (ProcessorType class) return
ref. to itself after the processing URI:
public Type to(String uri) {
addOutput(new ToType(uri));
return (Type) this;
}
For me it means: from("a").to("b").to("c") is just the short form for this
two rules: from("a").to("b") and from("a").to("c")
if not - than I'm a bit confused with transactions :)
from("a").policy(requiresnew).to("b").to("c").to("d")
if it's a chain - policy "requiresnew" applyed only to the route a->b or to
rotes b->c and c->d (tx could be toooooo long)?
2. Pipeline looks like the right way to define from "A" via the "B" to "C":
from("jms:A").pipeline("bean:example").to("jms:B")
I'm reading the sources and trying to understand the DSL semantic, basically
it's clear - but would be nice to have a short confirmation from the
commiters.
//sv
Hadrian Zbarcea wrote:
Hi,
Thanks for your interest in camel.
1. Your syntax defines a chain. Your answer 1a is the correct one. If
you need a splitter there is Splitter processor you could use:
http://activemq.apache.org/camel/splitter.html.
2. Again your first answer is the correct one. The chain can be
interrupted though if a Processor in the chain throws an exception.
That is if your bean:example throws an exception jms:queueB won't be
invoked anymore.
br,
Hadrian