1 Reply Latest reply on Aug 25, 2009 12:29 AM by Claus Ibsen

    SedaProducer - How to implement a blocking producer ?

    Christian Bach Newbie

      Heya

       

      I posted some questions in regards to the Camel SedaProducer on the Camel-Users list which haven't got answered yet (http://www.nabble.com/SedaProducer-Questions-td25068491s22882.html#a25068491 ).

      Maybe someone of you could give me a hint on how to implement a blocking producer in Camel. I really would prefer not having to deal with an IllegalStateException being thrown at me once the queue gets full ....

       

      Is there a decent way to implement blocking semantics out of the box ? or do I have to introduce a processor faking blocking semantics by means of exception handling in intercepting the flow to the SedaProducer ? 

       

      Any help is greatly appreciated, thx, Christian.

        • 1. Re: SedaProducer - How to implement a blocking producer ?
          Claus Ibsen Master

          You could set the queue size to Integer.MAX to prevent the queue from being full.

           

          And do you really want to wait potential forever to hand over a message to the queue in case its full, and thus block?

           

          We could introduce such an option on the seda producer to block in case the queue is full. Please add a ticket in JIRA for this new feature.

           

          And we should add a timeout value as well so you can say I want to wait at most 30 sec. etc.