Multicast - Pass through all messages, aggregate from different branches

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multicast - Pass through all messages, aggregate from different branches

lakshmi.prashant
Options for multi-cast

Hi,  

The multicast always blocks till the last message from the multicast branches and only uses the last reply as the outgoing message, at the end of multi-cast.

At the end of the multi-cast:
 

a) Is it possible to pass through / send each message out of each branch to the receiver / next common steps in the main route?
 

b) Compositing Messages: If we use an aggregation strategy to join the messages at the end of multi-cast:  

    i) if different message types emerge  from the different branches after processing and  cannot be easily correlated, is there an easy way to identify them as belonging to the same message and aggregate?  

    ii)  Is there an easy way to stop the aggregation on exception?
   

 iii) Is there an easy way to stop the aggregation if the messages get split in the multicast, but had orginated from the same message at the start of the multicast..    

        E.g. In route 1, Message A is mulicast to route 2, route 3.
 
        In route 2, it gets split into A1, A2
         
        In route 3, it is transformed into A3.

 
             After  that, the aggregated messages have to be sent to route1 and processed via some steps and then sent to the receiver.
   
        Since all the messages A1, A2, A3 originated from A after the start of the multicast, is it possible to join A1, A2, A3 at the end of the multicast and combine them into 1 message?

please let me know if i, ii & iii are possible?

Thanks,
Lakshmi
Reply | Threaded
Open this post in threaded view
|

Re: Multicast - Pass through all messages, aggregate from different branches

Claus Ibsen-2
On Fri, May 30, 2014 at 10:37 AM, lakshmi.prashant
<[hidden email]> wrote:

> <http://camel.465427.n5.nabble.com/file/n5751739/multicast.png>
>
> Hi,
>
> The multicast always blocks till the last message from the multicast
> branches and only uses the last reply as the outgoing message, at the end of
> multi-cast.
>
> At the end of the multi-cast:
>
>
> a) Is it possible to pass through / send each message out of each branch to
> the receiver / next common steps in the main route?
>
>

No

> b) Compositing Messages: If we use an aggregation strategy to join the
> messages at the end of multi-cast:
>
>     i) if different message types emerge  from the different branches after
> processing and  cannot be easily correlated, is there an easy way to
> identify them as belonging to the same message and aggregate?
>
>     ii)  Is there an easy way to stop the aggregation on exception?
>

Yes read the docs

>
>  iii) Is there an easy way to stop the aggregation if the messages get split
> in the multicast, but had orginated from the same message at the start of
> the multicast..
>
>         E.g. In route 1, Message A is mulicast to route 2, route 3.
>
>                 In route 2, it gets split into A1, A2
>
>                 In route 3, it is transformed into A3.
>
>
>              After  that, the aggregated messages have to be sent to route1 and
> processed via some steps and then sent to the receiver.
>
>         Since all the messages A1, A2, A3 originated from A after the start of the
> multicast, is it possible to join A1, A2, A3 at the end of the multicast and
> combine them into 1 message?
>

Yes read the docs. You can apply a custom agg strategy on your mutlicast


> please let me know if i, ii & iii are possible?
>
> Thanks,
> Lakshmi
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Multicast-Pass-through-all-messages-aggregate-from-different-branches-tp5751739.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [hidden email]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Reply | Threaded
Open this post in threaded view
|

Re: Multicast - Pass through all messages, aggregate from different branches

lakshmi.prashant
Hi,

 If we want a pass through of all the messages from the different branches, is it right to use the GroupedExchangeAggregationStrategy as the aggrgationstrategy for the multicast and use a splitter , thereafter?

If so, should a custom bean be used as the splitter (or) is it possible for the camel splitter to automatically split the GROUPED_EXCHANGE and pass the individual exchanges?

Pls. help.

  <bean id="groupStrategy" class="org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy"/>

 <route>     
           <from uri="..."/>
            <multicast strategyRef="groupStrategy" >
                     <to uri="direct://X" />
                    <to uri="direct://Y" />
            </multicast >
            <split>
                 <to uri="direct://Z" />
            </split>
  </route>

  <route>
         <from uri=="direct://X" />
          .....
  </route>

  <route>
         <from uri=="direct://Y" />
          .....
  </route>

 



Thanks,
Lakshmi