Re: suspend and resume routes
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 stefanopu...@gmail.com 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: cib...@redhat.com 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
Re: suspend and resume routes
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.
Re: suspend and resume routes
You can connect to JMX port of camel to accomplish this. There are a couple of user interfaces that use web technology such as Hawtio. Writing one would also not be that big of a deal. See the following link: http://camel.apache.org/camel-jmx.html *Robert Simmons Jr. MSc. - Lead Java Architect @ EA* *Author of: Hardcore Java (2003) and Maintainable Java (2012)* *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39 http://www.linkedin.com/pub/robert-simmons/40/852/a39* On Thu, Jan 2, 2014 at 11:02 AM, frida stefanopu...@gmail.com wrote: 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
On Thu, Jan 2, 2014 at 6:02 PM, frida stefanopu...@gmail.com wrote: 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 How do you check the route status? What code do you use? 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. -- 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 Make your Camel applications look hawt, try: http://hawt.io
Re: suspend and resume routes
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.