You could use the Control Bus EIP ( https://camel.apache.org/controlbus.html <https://camel.apache.org/controlbus.html> ) to shutdown the ActiveMQ route when it’s complete.
> On Dec 19, 2016, at 5:55 AM, DanielArias <dar...@koghi.com> wrote: > > Hi, good morning > > I'm trying to read from an activemq route after a specific condition. > So when this condition happens I trigger the second route placing a file > into a folder, this route will start/trigger the first route so it would > start consuming all messages from the activemq. > > So the first time it works fine, but the route that read the messages from > the activeMQ remain on. > I want to stop after it consumes all the messages from the activemq. > > Here is my code: > > from("activemq:queue:facturaBackUp?autoStartup=false") > .noAutoStartup().routeId("reintentar") > .shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks) > .to("activemq:queue:factura"); > > from("file://D:/my/path?noop=true&delete=true") > .to("controlbus:route?routeId=reintentar&action=start"); > > So How could I accomplish it ?? > > Thanks in advance > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Start-and-Stop-ActiveMQ-consuming-tp5791701.html > Sent from the Camel - Users mailing list archive at Nabble.com.