camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: seda blockWhenFull not acknowledged
Date Fri, 22 Jan 2016 15:06:04 GMT
You need to set the blockWhenFull on the producer, eg where you send

 template.send("seda:myqueue?blockWhenFull",exchange);

On Fri, Jan 22, 2016 at 9:55 AM, Bhuvan Gupta <bhuvangu@gmail.com> wrote:
> Hello,
>
> "BlockWhenFull" not acknowledged  i.e if size is set to 2 and i send 3 msg
> in a loop with body as "1" , "2" and "3" than i get sleep msg for only "1"
> and "2" and i guess third msg is silently dropped even when i have set the
> "BlockWhenFull" as true.
>
> *What am i doing wrong?*
>
> version: 2.15.3
>
> from("seda:myqueue?size=2&blockWhenFull=true").process(sleep());
>
>
> private Processor sleep() {
>                 return new Processor() {
>                     @Override
>                     public void process(Exchange exchange) throws Exception {
>                         String body = exchange.getIn().getBody(String.class);
>                         System.out.println(curTime() + " Going for
> sleep sleepid=" + body );
>                         Thread.sleep(5000l);
>                         System.out.println(curTime() + " Done sleep
> sleepid=" + body );
>                     }
>                 };
>
> for (Integer i = 0; i <5; i++) {
>             Exchange exchange = new DefaultExchange(context);
>             exchange.setPattern(ExchangePattern.InOnly);
>             exchange.getIn().setHeader("header", i);
>             exchange.getIn().setBody(i.toString());
>            System.out.println("sending msg to seda");
>            Exchange send = template.send("seda:myqueue",exchange);
>            System.out.println("done:"+i);
>
>         }



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message