You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bob Yetman <bo...@verizon.net> on 2009/08/17 19:49:05 UTC

Aggregator to Content Based Router

I'm just learning camel, and I want to take the output of an Aggregator
(which is working correctly when I route to a file endpoint), into a
content-based router.    If I understand the aggregator correctly, I need to
route to an endpoint (via the <to/>), so what kind of endpoint(s) do I need
to get the messages from the aggregator to the content-based router?

Spring DSL examples prefered.
-- 
View this message in context: http://www.nabble.com/Aggregator-to-Content-Based-Router-tp25011241p25011241.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator to Content Based Router

Posted by Bob Yetman <bo...@verizon.net>.
Thanks, I thought it was something that simple, but just wasn't sure.



willem.jiang wrote:
> 
> Hi,
> 
> You could using the direct endpoint to chain this two part of routing 
> rule together, or you just need to add the content-based router after 
> the aggregator.
> 
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>      <route>
>        ...your aggreagator
>        <to uri="direct:start"/>
>      <route>
>      <route>
>        <from uri="direct:start"/>
>        <choice>
>          <when>
>            <xpath>$foo = 'bar'</xpath>
>            <to uri="mock:x"/>
>          </when>
>          <when>
>            <xpath>$foo = 'cheese'</xpath>
>            <to uri="mock:y"/>
>          </when>
>          <otherwise>
>            <to uri="mock:z"/>
>          </otherwise>
>        </choice>
>        <to uri="mock:end"/>
>      </route>
>    </camelContext>
> 
> 
> or
> 
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>      <route>
>        ...your aggreagator
>        <choice>
>          <when>
>            <xpath>$foo = 'bar'</xpath>
>            <to uri="mock:x"/>
>          </when>
>          <when>
>            <xpath>$foo = 'cheese'</xpath>
>            <to uri="mock:y"/>
>          </when>
>          <otherwise>
>            <to uri="mock:z"/>
>          </otherwise>
>        </choice>
>        <to uri="mock:end"/>
>      </route>
>    </camelContext>
> 
> Willem
> 
> Bob Yetman wrote:
>> I'm just learning camel, and I want to take the output of an Aggregator
>> (which is working correctly when I route to a file endpoint), into a
>> content-based router.    If I understand the aggregator correctly, I need
>> to
>> route to an endpoint (via the <to/>), so what kind of endpoint(s) do I
>> need
>> to get the messages from the aggregator to the content-based router?
>> 
>> Spring DSL examples prefered.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Aggregator-to-Content-Based-Router-tp25011241p25022376.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator to Content Based Router

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You could using the direct endpoint to chain this two part of routing 
rule together, or you just need to add the content-based router after 
the aggregator.

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
       ...your aggreagator
       <to uri="direct:start"/>
     <route>
     <route>
       <from uri="direct:start"/>
       <choice>
         <when>
           <xpath>$foo = 'bar'</xpath>
           <to uri="mock:x"/>
         </when>
         <when>
           <xpath>$foo = 'cheese'</xpath>
           <to uri="mock:y"/>
         </when>
         <otherwise>
           <to uri="mock:z"/>
         </otherwise>
       </choice>
       <to uri="mock:end"/>
     </route>
   </camelContext>


or

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
     <route>
       ...your aggreagator
       <choice>
         <when>
           <xpath>$foo = 'bar'</xpath>
           <to uri="mock:x"/>
         </when>
         <when>
           <xpath>$foo = 'cheese'</xpath>
           <to uri="mock:y"/>
         </when>
         <otherwise>
           <to uri="mock:z"/>
         </otherwise>
       </choice>
       <to uri="mock:end"/>
     </route>
   </camelContext>

Willem

Bob Yetman wrote:
> I'm just learning camel, and I want to take the output of an Aggregator
> (which is working correctly when I route to a file endpoint), into a
> content-based router.    If I understand the aggregator correctly, I need to
> route to an endpoint (via the <to/>), so what kind of endpoint(s) do I need
> to get the messages from the aggregator to the content-based router?
> 
> Spring DSL examples prefered.