Hi

I got a problem with a seda-endpoint when I should send more than 1000 messages at a time.

I suggest you create a property value for the maximum queue size (today this is 1000)

public class SedaComponent extends DefaultComponent {
   public BlockingQueue<Exchange> createQueue() {
             return new LinkedBlockingQueue<Exchange>(1000);
}


You should also alter the process(Exchange) method in SedaEndpoint from

   queue.add(exchange.copy());

to something like this.

public void process(Exchange exchange) {
           try{
               if(queue.offer(exchange.copy(), 180, TimeUnit.SECONDS))
                   ;
               else
System.out.println("Problem, did not find capasity in queue within 3 minutes");
           }catch(Exception e){
System.out.println("Error processing exchange "+ e.toString());
           }
       }

This would make it much more reliable.

Regards

Ole Andreas Hegle
Software developer at Businesscape AS

Reply via email to