seda logs "Queue full" Exception

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

seda logs "Queue full" Exception

dennisholu
Hi,

I have multiple seda queues in my route, all with blockWennFull=true
and limited size. In logs I can find the IllegalStateException:

08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
CaughtExceptionMessage: Queue full, StackTrace:
java.lang.IllegalStateException: Queue full
at java.util.AbstractQueue.add(AbstractQueue.java:98)
at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)

I'd expect that if queue is full nothing happens and all threads would
be just waiting. So why the exception is logged? Does seda component
internally ignore it or do I have to handle it in some way in my
route?

Dan
Reply | Threaded
Open this post in threaded view
|

Re: seda logs "Queue full" Exception

Claus Ibsen-2
Hi

Can you double check your endpoint configurations as it sounds like
that producer do not have blockWhenFull=true enabled.

And what version of Camel do you use?
On Tue, Sep 11, 2018 at 8:55 AM Dennis Holunder <[hidden email]> wrote:

>
> Hi,
>
> I have multiple seda queues in my route, all with blockWennFull=true
> and limited size. In logs I can find the IllegalStateException:
>
> 08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
> Exchange[ExchangePattern: InOnly, BodyType: com.Model,
> CaughtExceptionType: java.lang.IllegalStateException,
> CaughtExceptionMessage: Queue full, StackTrace:
> java.lang.IllegalStateException: Queue full
> at java.util.AbstractQueue.add(AbstractQueue.java:98)
> at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
> at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)
>
> I'd expect that if queue is full nothing happens and all threads would
> be just waiting. So why the exception is logged? Does seda component
> internally ignore it or do I have to handle it in some way in my
> route?
>
> Dan



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: seda logs "Queue full" Exception

dennisholu
double checked all seda endpoints have blockWhenFull=true, but not all
are limited in size.  Camel version 2.22.0
Am Di., 11. Sep. 2018 um 09:15 Uhr schrieb Claus Ibsen-2 [via Camel]
<[hidden email]>:

>
> Hi
>
> Can you double check your endpoint configurations as it sounds like
> that producer do not have blockWhenFull=true enabled.
>
> And what version of Camel do you use?
> On Tue, Sep 11, 2018 at 8:55 AM Dennis Holunder <[hidden email]> wrote:
>
> >
> > Hi,
> >
> > I have multiple seda queues in my route, all with blockWennFull=true
> > and limited size. In logs I can find the IllegalStateException:
> >
> > 08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
> > Exchange[ExchangePattern: InOnly, BodyType: com.Model,
> > CaughtExceptionType: java.lang.IllegalStateException,
> > CaughtExceptionMessage: Queue full, StackTrace:
> > java.lang.IllegalStateException: Queue full
> > at java.util.AbstractQueue.add(AbstractQueue.java:98)
> > at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
> > at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)
> >
> > I'd expect that if queue is full nothing happens and all threads would
> > be just waiting. So why the exception is logged? Does seda component
> > internally ignore it or do I have to handle it in some way in my
> > route?
> >
> > Dan
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
> To unsubscribe from Camel, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: seda logs "Queue full" Exception

dennisholu
In reply to this post by Claus Ibsen-2
Looks like there is new option offerTimeout which causes to ignore
blockWhenFull:

SedaProducer.java

log.trace("Adding Exchange to queue: {}", target);
if (blockWhenFull && offerTimeout == 0) {
    try {
        queue.put(target);
    } catch (InterruptedException e) {
        // ignore
        log.debug("Put interrupted, are we stopping? {}", isStopping()
|| isStopped());
    }
} else if (blockWhenFull && offerTimeout > 0) {
    try {
        offerTime = queue.offer(target, offerTimeout, TimeUnit.MILLISECONDS);
        if (!offerTime) {
            throw new IllegalStateException("Fails to insert element
into queue, "
                    + "after timeout of"  + offerTimeout + "milliseconds");
        }
    } catch (InterruptedException e) {
        // ignore
        log.debug("Offer interrupted, are we stopping? {}",
isStopping() || isStopped());
    }
} else {
    queue.add(target);
}

So if offerTimeout < 0  blockWhenFull is ignored. offerTimeout is not
documented?
Am Di., 11. Sep. 2018 um 09:15 Uhr schrieb Claus Ibsen-2 [via Camel]
<[hidden email]>:

>
> Hi
>
> Can you double check your endpoint configurations as it sounds like
> that producer do not have blockWhenFull=true enabled.
>
> And what version of Camel do you use?
> On Tue, Sep 11, 2018 at 8:55 AM Dennis Holunder <[hidden email]> wrote:
>
> >
> > Hi,
> >
> > I have multiple seda queues in my route, all with blockWennFull=true
> > and limited size. In logs I can find the IllegalStateException:
> >
> > 08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
> > Exchange[ExchangePattern: InOnly, BodyType: com.Model,
> > CaughtExceptionType: java.lang.IllegalStateException,
> > CaughtExceptionMessage: Queue full, StackTrace:
> > java.lang.IllegalStateException: Queue full
> > at java.util.AbstractQueue.add(AbstractQueue.java:98)
> > at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
> > at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)
> >
> > I'd expect that if queue is full nothing happens and all threads would
> > be just waiting. So why the exception is logged? Does seda component
> > internally ignore it or do I have to handle it in some way in my
> > route?
> >
> > Dan
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
> To unsubscribe from Camel, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: seda logs "Queue full" Exception

Andrea Cosentino-2
Yes, it is:

https://github.com/apache/camel/blob/camel-2.22.x/camel-core/src/main/docs/seda-component.adoc

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: [hidden email]
Twitter: @oscerd2
Github: oscerd






On Tuesday, September 11, 2018, 9:55:35 AM GMT+2, Dennis Holunder <[hidden email]> wrote:





Looks like there is new option offerTimeout which causes to ignore
blockWhenFull:

SedaProducer.java

log.trace("Adding Exchange to queue: {}", target);
if (blockWhenFull && offerTimeout == 0) {
    try {
        queue.put(target);
    } catch (InterruptedException e) {
        // ignore
        log.debug("Put interrupted, are we stopping? {}", isStopping()
|| isStopped());
    }
} else if (blockWhenFull && offerTimeout > 0) {
    try {
        offerTime = queue.offer(target, offerTimeout, TimeUnit.MILLISECONDS);
        if (!offerTime) {
            throw new IllegalStateException("Fails to insert element
into queue, "
                    + "after timeout of"  + offerTimeout + "milliseconds");
        }
    } catch (InterruptedException e) {
        // ignore
        log.debug("Offer interrupted, are we stopping? {}",
isStopping() || isStopped());
    }
} else {
    queue.add(target);
}

So if offerTimeout < 0  blockWhenFull is ignored. offerTimeout is not
documented?
Am Di., 11. Sep. 2018 um 09:15 Uhr schrieb Claus Ibsen-2 [via Camel]
<[hidden email]>:
>
> Hi
>
> Can you double check your endpoint configurations as it sounds like
> that producer do not have blockWhenFull=true enabled.
>
> And what version of Camel do you use?
> On Tue, Sep 11, 2018 at 8:55 AM Dennis Holunder <[hidden email]> wrote:

>
> >
> > Hi,
> >
> > I have multiple seda queues in my route, all with blockWennFull=true
> > and limited size. In logs I can find the IllegalStateException:
> >
> > 08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
> > Exchange[ExchangePattern: InOnly, BodyType: com.Model,
> > CaughtExceptionType: java.lang.IllegalStateException,
> > CaughtExceptionMessage: Queue full, StackTrace:
> > java.lang.IllegalStateException: Queue full
> > at java.util.AbstractQueue.add(AbstractQueue.java:98)
> > at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
> > at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)
> >
> > I'd expect that if queue is full nothing happens and all threads would
> > be just waiting. So why the exception is logged? Does seda component
> > internally ignore it or do I have to handle it in some way in my
> > route?
> >
> > Dan
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
> To unsubscribe from Camel, click here.
> NAML

Reply | Threaded
Open this post in threaded view
|

Re: seda logs "Queue full" Exception

dennisholu
So there are blockWhenFull, offerTimeout, defaultBlockWhenFull,
defaultOfferTimeout options. And if offerTimeout is not specified
blockWhenFull is ignored. It is a bit confusing to be honest
Am Di., 11. Sep. 2018 um 09:57 Uhr schrieb Andrea Cosentino-2 [via
Camel] <[hidden email]>:

>
> Yes, it is:
>
> https://github.com/apache/camel/blob/camel-2.22.x/camel-core/src/main/docs/seda-component.adoc
>
> --
> Andrea Cosentino
> ----------------------------------
> Apache Camel PMC Chair
> Apache Karaf Committer
> Apache Servicemix PMC Member
> Email: [hidden email]
> Twitter: @oscerd2
> Github: oscerd
>
>
>
>
>
>
> On Tuesday, September 11, 2018, 9:55:35 AM GMT+2, Dennis Holunder <[hidden email]> wrote:
>
>
>
>
>
> Looks like there is new option offerTimeout which causes to ignore
> blockWhenFull:
>
> SedaProducer.java
>
> log.trace("Adding Exchange to queue: {}", target);
> if (blockWhenFull && offerTimeout == 0) {
>     try {
>         queue.put(target);
>     } catch (InterruptedException e) {
>         // ignore
>         log.debug("Put interrupted, are we stopping? {}", isStopping()
> || isStopped());
>     }
> } else if (blockWhenFull && offerTimeout > 0) {
>     try {
>         offerTime = queue.offer(target, offerTimeout, TimeUnit.MILLISECONDS);
>         if (!offerTime) {
>             throw new IllegalStateException("Fails to insert element
> into queue, "
>                     + "after timeout of"  + offerTimeout + "milliseconds");
>         }
>     } catch (InterruptedException e) {
>         // ignore
>         log.debug("Offer interrupted, are we stopping? {}",
> isStopping() || isStopped());
>     }
> } else {
>     queue.add(target);
> }
>
> So if offerTimeout < 0  blockWhenFull is ignored. offerTimeout is not
> documented?
> Am Di., 11. Sep. 2018 um 09:15 Uhr schrieb Claus Ibsen-2 [via Camel]
> <[hidden email]>:
> >
> > Hi
> >
> > Can you double check your endpoint configurations as it sounds like
> > that producer do not have blockWhenFull=true enabled.
> >
> > And what version of Camel do you use?
> > On Tue, Sep 11, 2018 at 8:55 AM Dennis Holunder <[hidden email]> wrote:
>
> >
> > >
> > > Hi,
> > >
> > > I have multiple seda queues in my route, all with blockWennFull=true
> > > and limited size. In logs I can find the IllegalStateException:
> > >
> > > 08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
> > > Exchange[ExchangePattern: InOnly, BodyType: com.Model,
> > > CaughtExceptionType: java.lang.IllegalStateException,
> > > CaughtExceptionMessage: Queue full, StackTrace:
> > > java.lang.IllegalStateException: Queue full
> > > at java.util.AbstractQueue.add(AbstractQueue.java:98)
> > > at org.apache.camel.component.seda.SedaProducer.addToQueue(SedaProducer.java:261)
> > > at org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:166)
> > >
> > > I'd expect that if queue is full nothing happens and all threads would
> > > be just waiting. So why the exception is logged? Does seda component
> > > internally ignore it or do I have to handle it in some way in my
> > > route?
> > >
> > > Dan
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
> >
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion below:
> > http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
> > To unsubscribe from Camel, click here.
> > NAML
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823085.html
> To unsubscribe from Camel, click here.
> NAML