camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcostello <jeff.coste...@manheim.com>
Subject Re: Dynamic JMS selector question (camel-jms)
Date Mon, 27 Apr 2015 13:49:31 GMT
Gdubya,

I spent some time hacking on this over the weekend and figured out that it was happening because
of the spring caching connection factory. If you set cacheConsumers=false, the consumers are
removed when the polling is complete.

Thanks!

From: "gdubya [via Camel]" <ml-node+s465427n5766378h38@n5.nabble.com<mailto:ml-node+s465427n5766378h38@n5.nabble.com>>
Date: Monday, April 27, 2015 at 5:09 AM
To: Jeff Costello <jeff.costello@manheim.com<mailto:jeff.costello@manheim.com>>
Subject: Re: Dynamic JMS selector question (camel-jms)

We recently did something similar for a JMS selector. In our case we
need to select a particular JMS message from a dead letter queue (based
on the message ID).

In short, we add the route dynamically, give it 10 seconds to process,
then remove the route from the context. We then also need to remove the
endpoints because, as you said, they are generated for a particular JMS
selector and it does not appear to be possible to modify this dynamically..

E.g. something like this:
             camelContext.addRoutes(new
DynamicEndpointRouteBuilder(fromUri, toEndpointUri, routeId,
countDownLatch, username));
             camelContext.stopRoute(routeId, 10000, TimeUnit.MILLISECONDS);
             camelContext.removeRoute(routeId);
             camelContext.removeEndpoints(fromUri);

So... have you tried removing the endpoints like this?



On 24. april 2015 22:58, jcostello wrote:

> I'm trying to build a very simple route that periodically moves messages from
> one queue to another until the from queue is empty. The catch is that route
> needs to check the message age each time and only move the messages that
> were in the queue when it started. I typically do this by calculating the
> time when the process starts and setting a JMS selector based on that.
>
> I've tried this two ways. One using a polling consumer and the other using a
> route policy to start / stop the route. In both cases, I notice that the
> camel-jms component doesn't actually change the message selector of the
> current consumers. Instead, it creates new consumers with the new message
> selector *and leaves the old ones in place*.
>
> I need a way to either kill the old consumers or simply change the selector
> on the existing consumers. I've tried the various stop() methods, but those
> did not work. What is the best way to do this?
>
> Thanks for your help!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamic-JMS-selector-question-camel-jms-tp5766313.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



________________________________
If you reply to this email, your message will be added to the discussion below:
http://camel.465427.n5.nabble.com/Dynamic-JMS-selector-question-camel-jms-tp5766313p5766378.html
To unsubscribe from Dynamic JMS selector question (camel-jms), click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5766313&code=amVmZi5jb3N0ZWxsb0BtYW5oZWltLmNvbXw1NzY2MzEzfC01MDE5MDMwNjg=>.
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>




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