Hi

Use the @user mailing list / forum for these kind of questions.
And please dont post the same question in private emails to the Camel
team members.
http://camel.apache.org/mailing-lists.html
http://camel.apache.org/discussion-forums.html

Apache Camel is a public project and all such kind of questions et all
should happen in the public.

About your question, see the shareUnitOfWork option
http://camel.apache.org/multicast.html

On Fri, Aug 16, 2013 at 12:33 PM, maneshbelchada
<manesh.belch...@gmail.com> wrote:
> Hi,
>
> We are using the below configuration to send a file from single source to
> multiple remote destinations.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:camel="http://camel.apache.org/schema/spring";
>         xmlns:util="http://www.springframework.org/schema/util";
>         xsi:schemaLocation="
>                 http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>                 http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util.xsd
>         http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>
>         <routeContext id="gcgRatesOutbound"
> xmlns="http://camel.apache.org/schema/spring";>
>                 <route id="gcgRatesFileOut">
>                         <from
> uri="file:{{nas.root}}/{{gcg.out.prices.dir}}?delay={{poll.delay}}&amp;initialDelay={{initial.delay}}&amp;readLock=rename&amp;scheduledExecutorService=#scheduledExecutorService"
> />
>                         <multicast stopOnException="true">
>
>                                 <to
> uri="scp://{{gcg.ste.Client1_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client1}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>
>                                 <to
> uri="scp://{{gcg.ste.Client2_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client2}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>
>                                 <to
> uri="scp://{{gcg.ste.Client3_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client3}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>                         </multicast>
>                 </route>
>         </routeContext>
> </beans>
>
> Using the above confirguration the file reaches the remote destinations,
> which confirmed that the connection to all the remote destinations were
> successfull.
>
>
> We need that the file should be moved to the archive folder after the file
> has been successfully transfered to all the remote destinations.
> And should move to error folder incase of any error.
>
>
> However, when I add the archival code (<To> element) as child  element to
> the multicast element in the above configuration and use the <doTry> and the
> <doCatch> tag to move the file to error folder incase of an error. The file
> does not reach the remote destinations.
> <doTry>
>         <multicast stopOnException="true" parallelProcessing="true">
>
>                                 <to
> uri="scp://{{gcg.ste.Client1_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client1}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>
>                                 <to
> uri="scp://{{gcg.ste.Client2_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client2}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>
>                                 <to
> uri="scp://{{gcg.ste.Client3_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client3}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>
>                 <to
> uri="file://{{nas.root}}/{{gcg.out.prices.dir}}?fileName={{archive.dir}}" />
>         </multicast>
> <doCatch>
>         <exception>java.lang.Exception</exception>
>                 <handled>
>                         <constant>true</constant>
>                 </handled>
>
>                 <to
> uri="file://{{nas.root}}/{{gcg.out.prices.dir}}?fileName={{error.dir}}" />
> </doCatch>
> </doTry>
> The file does not reach the remote destinations nor does it produce any log
> and the file is moved to archive folder.
>
>
> I tried placing the remote destinations, the archival code and the move to
> error code in seperate routes and have its reference in a single multicast
> as below
> <multicast stopOnException="true">
>
>                 <to uri="direct:Client1FileOut" />
>
>                 <to uri="direct:Client2FileOut" />
>
>                 <to uri="direct:Client3FileOut" />
>
>                 <to uri="direct:MoveToArchive" />
> </multicast>
>
>
> <route id="gcgFileOut1">
>                         <from uri="direct:Client1FileOut" />
>                         <doTry>
>
>                                 <to
> uri="scp://{{gcg.ste.Client1_User_Name}}@{{gcg.ste.Host_Name}}:{{gcg.ste.Port_Number}}/{{gcg.ste.Destination_Client1}}?knownHostsFile={{ssh.knownHosts}}&amp;privateKeyFile={{ssh.privateKey}}"
> />
>                                 <doCatch>
>                                                 
> <exception>java.lang.Exception</exception>
>                                                 <handled>
>                                                         
> <constant>true</constant>
>                                                 </handled>
>
>                                                 <to uri="direct:gcgError" />
>
>                                 </doCatch>
>                         </doTry>
>                 </route>
>
> However, The file does not reach the remote destinations nor does it produce
> any log  and the file is moved to archive folder.
>
> Request you to please suggest.
>
>
> Regards,
> Manesh Belchada
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Multicast-issue-tp5737388.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to