I have an apache camel application which runs as three identical services
in production environment for scalability. I want to add email server
polling to this application using camel-mail api. Since I dont want  all
these three instances poll the server concurrently, I want to put some
locking mechanism before camel polls. However since mail consumers are
polling consumer, I can not use them in this situation. Is there an easy
way to do this ?

In short, I have a route like below:

     from("imaps://mymail...")//This polls periodically
        .to(Processmail.class)

But I need something like below in camel dsl


       from("timer:mytimer")
         .to("direct:checkDistributedLock")
         .choice()
          .when(header("gotlock").isEqualTo("true"))
             .from("imaps://..") // can not use from here!!!
         .end()


-- 
Kasim Sert

Reply via email to