3 Replies Latest reply on Feb 28, 2012 7:22 AM by Claus Ibsen

    How to remove message's from a vm endpoint  ?

    san red Newbie



      i have a scenario where message's are getting accumulated in a vm endpoint due to slow consumers . I want to remove this old message's and process only new one's at regular intervals on reaching a threshold  .How can i do this ?


      i have recreated the scenario using a simple route like below , where i have made consumers intentionally slow such that message accumulation happens


      <route id="route1">

      <from uri="timer://Timer?period=1000" />

      <to uri="bean:producer?method=send" />

      <to uri="vm:simpleEp" />



      <route id="route2">

      <from uri="vm:simpleEp" />

      <to uri="bean:consumer?method=recv" />






      i have tried getting the endpoint and starting/stopping it such that it will delete the pending message's like below code  but its not working








      Is there a way to do this from camelcontext ? if not is there a jmx alternative ?