camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamie3 <jam...@gmail.com>
Subject Re: Shutting down route with jms
Date Sat, 30 Jan 2016 17:49:38 GMT
Thanks quinn! I'll try this out!

On Sat, Jan 30, 2016 at 10:30 AM, Quinn Stevenson [via Camel] <
ml-node+s465427n5777058h64@n5.nabble.com> wrote:

> I normally use the ControlBus EIP (
> http://camel.apache.org/controlbus.html <
> http://camel.apache.org/controlbus.html> ) for this kind of thing - then
> I don’t have to write any custom processors or other supporting code.
>
>
> > On Jan 30, 2016, at 12:16 AM, Claus Ibsen <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5777058&i=0>> wrote:
> >
> > See this FAQ
> > http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
> >
> > On Fri, Jan 29, 2016 at 8:24 PM, jamie3 <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5777058&i=1>> wrote:
> >> I have a Camel route as follows:
> >>
> >> onException(EmitException.class)
> >>                        .maximumRedeliveries(3)
> >>                        .handled(true)
> >>                        .delay(3000)
> >>                        .process(new ShutdownRoute("Failed to send
> email"))
> >>                        .end();
> >>
> >> from("jms:queue:someQueue?acknowledgementModeName=CLIENT_ACKNOWLEDGE")
> >> to(myProcessor);
> >>
> >> class ShutdownRoute implements Processor {
> >>        @Override
> >>        public void process(Exchange exg) throws Exception {
> >>                LOG.fatal("Shutting down service: " + message);
> >>                exg.getContext().stop();
> >>        }
> >> }
> >>
> >>
> >> myProcessor contains logic to send the message to another system. If
> that
> >> system becomes unavailable I want to shutdown the camel route and stop
> >> listening for JMS messages.
> >>
> >> The JMS connection factory fetched from JNDI using WebSphere
> Application
> >> Server and MQ.
> >>
> >> I do receive the call back for ShutdownRoute however when I stop the
> camel
> >> context, MQ shows that the JMS connections are still active. I've
> confirmed
> >> that I cannot send anymore messages to the queue, thus the connection
> >> factory is connected to MQ but not accepting messages.
> >>
> >> Even if I stop the EAR file in WAS (which contains my camel route) the
> jms
> >> connections are still active.
> >>
> >> Also since I have CLIENT_ACKNOWLEDGE mode enabled the messages are
> placed
> >> back onto the queue only when I restart WAS.
> >>
> >> What I am trying to do is completely shutdown Camel and the connections
> to
> >> MQ via JMS. Is this possible? Am I implementing this correctly, or is
> there
> >> a better way?
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777058.html
> To unsubscribe from Shutting down route with jms, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5777011&code=amFtaWUzQGdtYWlsLmNvbXw1Nzc3MDExfDE2Mjk2MjEyNTg=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
Jamie




--
View this message in context: http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777059.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message