Re: Can I cancel a Route suspension.

2012-07-14 Thread smadarapu
Thanks for the response, that what i thought.

The reason...

I have a route that is listening to a folder for a particular file. As soon
as it finds the file the route starts, takes the contents of the file and
produces a bunch of events that are consumed and processed by other routes.
The job of this route is to produce events.

While the events are being processed i don't want any other files to be
processed, so I am suspending the route immediately after getting a file.
After the produced events are processed another event COMPLETED is
generated and the file route gets resumed.

While the file route producing the events if an irrecoverable exception
happens, the processing will be stopped and i want to resume the file route.
But i have already issued the suspend call. That's why I had the need to
cancel the suspension, which i solved differently.

HTH.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Can-I-cancel-a-Route-suspension-tp5715878p5716017.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Exception handling in Camel Routes.

2012-07-14 Thread smadarapu
Can you please elaborate A route can have a N+ route scoped onException's.
That is possible.

In my case when I had the onException on the route, whatever the code i put
for onException got executed immediately after a message arrived to that
route (without an actual exception), and not when that exception really
happened.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Exception-handling-in-Camel-Routes-tp5715952p5716018.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ProducerTemplate

2012-07-14 Thread Claus Ibsen
On Fri, Jul 13, 2012 at 6:04 PM, ceclabaugh ceclaba...@gmail.com wrote:
 Is there a non-test example of this? Does the xml context file for any route
 need to be named after its producer?


No you can name the XML file anything you like. That naming scheme is
just a spring test pattern.

See here
http://camel.apache.org/producertemplate.html


 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/ProducerTemplate-tp4552750p5716019.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Can I cancel a Route suspension.

2012-07-14 Thread Claus Ibsen
On Fri, Jul 13, 2012 at 5:53 PM, smadarapu srikanth.madar...@adp.com wrote:
 Thanks for the response, that what i thought.

 The reason...

 I have a route that is listening to a folder for a particular file. As soon
 as it finds the file the route starts, takes the contents of the file and
 produces a bunch of events that are consumed and processed by other routes.
 The job of this route is to produce events.

 While the events are being processed i don't want any other files to be
 processed, so I am suspending the route immediately after getting a file.
 After the produced events are processed another event COMPLETED is
 generated and the file route gets resumed.

 While the file route producing the events if an irrecoverable exception
 happens, the processing will be stopped and i want to resume the file route.
 But i have already issued the suspend call. That's why I had the need to
 cancel the suspension, which i solved differently.


Just resume it when its done suspending. Its super fast to
suspend/resume a file consumer route.


 HTH.

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Can-I-cancel-a-Route-suspension-tp5715878p5716017.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: proxy

2012-07-14 Thread Claus Ibsen
On Fri, Jul 13, 2012 at 10:22 PM, BL jessbringlar...@gmail.com wrote:
 Hi,

 I need to create a Camel proxy such that a http request is fronted by a soap
 webservice exposed by Camel.
 The webservice arguments has to be extracted from the soap webservice and
 added as request parameters to the http request.
 My plan is to created the webservice via cxf to expose a webservice, a
 processor to extract the soap webservice arguments and add them to the in
 message header with the key: Exchange.HTTP_QUERY to build up the http query
 string.
 Would the this be the proper way to do such a thing or is there another
 cleaver way of doing this in Camel?


No this sounds like a good approach.

There is also the FAQ
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

Just mind about http error codes, so if the http call fails, then you
may need to map that to soap faults or something.
And as well have to map the response from http back to the soap response.

 Regards

 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/proxy-tp5716023.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Testing Restlet endpoints after refactoring to using servlet container

2012-07-14 Thread Claus Ibsen
Hi

Maybe if its/was possible to setup the host and port on the
RestletComponent, then the endpoint can fallback and use those options
if non specified in the uri. Then for production they can be / to
indicate servlet, and for unit test, you can set it up to a localhost
8080 or whatever.



On Fri, Jul 13, 2012 at 2:50 PM, Magnus Palmér
magnus.palmer.w...@gmail.com wrote:
 After following the Using the Restlet servlet within a webapp
 documentation at http://camel.apache.org/restlet.html I refactored my
 Restlet endpoints by removing protocol, host and port.
 So from restlet:http://host:port/path/{id}; to restlet:/path/{id}.
 This works great when running in a servlet container.

 However my JUnit tests no longer works since, the reason for this is that
 when using the applicationContext the protocol and host is set to null and
 port is defaulted to 80 in
 the org.apache.camel.component.restlet.RestletComponent.createEndpoint(String
 uri, String remaining, Map parameters).

 The only resolution that I know will work is to manipulate the URI by using
 http://host:port; in test and  otherwise.
 Any ideas is highly appreciated otherwise I will have to satisfy with
 manipulating the URIs.
 (I am using both the real applicationContext and a test applicationContext
 in my JUnit tests that extends CamelSpringTestSupport, and they have among
 other things a Spring context:property-override definition where I can put
 configuration).

 Looking at the JUnit tests in Camel source all routes are configured using
 restlet:http://host; + portnum + /path for the camel-restlet component.


 Kind regards, Magnus



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: camel+quartz schedulers

2012-07-14 Thread Sudhakar.kaithepalli
Hi Good Morning...

 Thanks for ur response Pontus...
But i don't want to interact with Active-MQ in between camel route and FTP
server. And on more thing How can i get no. of files in FTP server through
camel route? plz tell me its very urgent to me..

ThanksRegards..
Sudhakar Kaithepalli



-
Sudhakar Kaithepalli
--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-schedulers-tp5715992p5716030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Exception handling in Camel Routes.

2012-07-14 Thread Christian Müller
It's documented here [1].

You can e.g. do:
from(direct:start)

.onException(MyTechnicalException.class).maximumRedeliveries(0).handled(true).end()

.onException(MyFunctionalException.class).maximumRedeliveries(0).handled(true).to(bean:myOwnHandler).end()
  .choice()
.when().xpath(//type = 'myType').to(bean:myServiceBean)
  .end()
  .to(mock:result);


[1] http://camel.apache.org/exception-clause.html

Best,
Christian

On Fri, Jul 13, 2012 at 5:57 PM, smadarapu srikanth.madar...@adp.comwrote:

 Can you please elaborate A route can have a N+ route scoped onException's.
 That is possible.

 In my case when I had the onException on the route, whatever the code i put
 for onException got executed immediately after a message arrived to that
 route (without an actual exception), and not when that exception really
 happened.

 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Exception-handling-in-Camel-Routes-tp5715952p5716018.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



problem with camel:multicast

2012-07-14 Thread Marco Mistroni
hello all
   i might be missingn something big here with regards to camel:multicast.

I have following routes configures with camel:multicast

Multicast works for the following route, where all the  camel:to are seda

   camel:route
camel:from uri=seda:processShares /
camel:multicast
camel:to uri=seda:fetchShareData /
camel:to uri=seda:fetchShareNews /
camel:to uri=seda:fetchEdgarNews /
!-- Add Edgar News --
/camel:multicast
/camel:route


but it does not work for this route, where one of the camel:to  URI is a
bean:  and others are seda:

camel:route
camel:from uri=seda:fetchShareData /
camel:bean ref=serviceActivator method=fetchData /
camel:multicast
camel:to
uri=bean:sharesEndpointBean?method=handleShareData /
camel:to
uri=bean:camelVolatilityBean?method=loadVolatility/
camel:to uri=seda:report /
/camel:multicast
/camel:route

the message gets delivered to the first bean:sharesEndpointBean and
seda:report but the message
never reaches bean:camelVolatilityBean.

anyone could assist?

w/kindest regards
 marco


Re: problem with camel:multicast

2012-07-14 Thread Christian Müller
Hello Marco!

You should start on this page [1]. We have to know a few things more than
you provided:
- which Java version do you use
- which Camel version do you use

And because your route looks really similar to the one on our web site [2],
I'm pretty sure it will work.
Could you please provide a unit test which demonstrate this issue? This
will help to figure out what you are doing wrong or what the bug is. And it
will definitely help you to get your answer quicker...

[1] http://camel.apache.org/how-can-i-get-help.html
[2] http://camel.apache.org/multicast.html

Best,
Christian

On Sat, Jul 14, 2012 at 6:38 PM, Marco Mistroni mmistr...@gmail.com wrote:

 hello all
i might be missingn something big here with regards to camel:multicast.

 I have following routes configures with camel:multicast

 Multicast works for the following route, where all the  camel:to are seda

camel:route
 camel:from uri=seda:processShares /
 camel:multicast
 camel:to uri=seda:fetchShareData /
 camel:to uri=seda:fetchShareNews /
 camel:to uri=seda:fetchEdgarNews /
 !-- Add Edgar News --
 /camel:multicast
 /camel:route


 but it does not work for this route, where one of the camel:to  URI is a
 bean:  and others are seda:

 camel:route
 camel:from uri=seda:fetchShareData /
 camel:bean ref=serviceActivator method=fetchData /
 camel:multicast
 camel:to
 uri=bean:sharesEndpointBean?method=handleShareData /
 camel:to
 uri=bean:camelVolatilityBean?method=loadVolatility/
 camel:to uri=seda:report /
 /camel:multicast
 /camel:route

 the message gets delivered to the first bean:sharesEndpointBean and
 seda:report but the message
 never reaches bean:camelVolatilityBean.

 anyone could assist?

 w/kindest regards
  marco