Re: suspend and resume routes

2014-01-03 Thread frida
Yes!

camelContext().getRouteStatus(id) returns Suspended as expected :)

I've noticed the same behaviour with route.resume(); VS
camelContext().resumeRoute(id);




2014/1/3 Claus Ibsen-2 [via Camel] ml-node+s465427n5745475...@n5.nabble.com


 Hi

 Can you try using getRouteStatus from CamelContext.


 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#getRouteStatus(java.lang.String)


 On Thu, Jan 2, 2014 at 8:39 PM, frida [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5745475i=0
 wrote:

  Hi Claus,
 
  to get the route status I'm just checking route.getStatus()
 
  this.getCamelContext().suspendRoute(route.getId(), 5, TimeUnit.SECONDS);
  //here I've also tried a brutal thread.sleep (7000);
  log.info(route {}  (status: {}), new Object[]{id,
 route.getStatus()});
  that turns in
  INFO  com.ste.controller.camel.CamelController  - route route1 (status:
  Started)
 
  and in my jsp:
  c:out value=${route.status} / == Started
  c:out value=${route.suspended} / == false
  c:out value=${route.suspending} / == false
 
 
  Thanks!
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/suspend-and-resume-routes-tp5745446p5745451.html

  Sent from the Camel - Users mailing list archive at Nabble.com.



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email]http://user/SendEmail.jtp?type=nodenode=5745475i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 Make your Camel applications look hawt, try: http://hawt.io


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://camel.465427.n5.nabble.com/suspend-and-resume-routes-tp5745446p5745475.html
  To unsubscribe from suspend and resume routes, click 
 herehttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5745446code=c3RlZmFub3B1ZGR1QGdtYWlsLmNvbXw1NzQ1NDQ2fC0xMzQ0NzkwMjc3
 .
 NAMLhttp://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://camel.465427.n5.nabble.com/suspend-and-resume-routes-tp5745446p5745477.html
Sent from the Camel - Users mailing list archive at Nabble.com.

suspend and resume routes

2014-01-02 Thread frida
Hi All,
I'm on my very first approach with Camel, and probably I'm missing (more
than) something :)

I would like to suspend and resume routes from a web interface.

I have a route:
DefaultRoute route = (DefaultRoute) this.getCamelContext().getRoute(id);
and a camelContext  (instance of SpringCamelContext)

By using
this.getCamelContext().suspendRoute(route.getId(), 5, TimeUnit.SECONDS);

my log says
INFO  org.apache.camel.spring.SpringCamelContext  - Route: route1 is
suspended, was consuming from: Endpoint[file:///tmp/camel_startfolder?

but when I check for the route status is always Started

I've noticed that route.suspend(); works fine...

I'm pom.xml I have:
camel.version2.12.2/camel.version
spring.version3.2.3.RELEASE/spring.version

Thanks.






--
View this message in context: 
http://camel.465427.n5.nabble.com/suspend-and-resume-routes-tp5745446.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: suspend and resume routes

2014-01-02 Thread frida
Hi Claus,

to get the route status I'm just checking route.getStatus()

this.getCamelContext().suspendRoute(route.getId(), 5, TimeUnit.SECONDS);
//here I've also tried a brutal thread.sleep (7000);
log.info(route {}  (status: {}), new Object[]{id, route.getStatus()});
that turns in
INFO  com.ste.controller.camel.CamelController  - route route1 (status:
Started)

and in my jsp:
c:out value=${route.status} / == Started 
c:out value=${route.suspended} / == false
c:out value=${route.suspending} / == false


Thanks!



--
View this message in context: 
http://camel.465427.n5.nabble.com/suspend-and-resume-routes-tp5745446p5745451.html
Sent from the Camel - Users mailing list archive at Nabble.com.