Hi You can call the controlbus component afterwards and tell it to stop the route
from foo to bla to controlbus action = stop route However it would be nice if you can more easily just say repeatCount=1 or something on the jpa endpoint. So I have logged a ticket about this https://issues.apache.org/jira/browse/CAMEL-14041 Another way is to use poll enrich from a timer where you say the timer is run once from timer ? repeatCount = 1 pollEnrich jpa to blah On Mon, Oct 7, 2019 at 4:05 PM Imran Raza Khan <[email protected]> wrote: > > I am refactoring legacy project and in which i have to read table which has > some meta data on the base of it i have to start activemq listeners. > > Now i want to read this tables only once at the start of application how i > can make sure that jpa consumer just get called once > > from("jpa:my.imran.TopicMapping" > + > "?consumer.namedQuery=select_topic_mapping&delay=5s&consumeDelete=false") > .to("log:my?showAll=true&multiline=true"); > > I know we can use @consume but in my scenario it will not work as if i have > to restart application it should re read these records from table. > > So how we can make sure to call JPA consumer only once in lifecycle of > application. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
