Discussion:
seda logs "Queue full" Exception
Dennis Holunder
2018-09-11 06:55:38 UTC
Permalink
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
2018-09-11 07:14:50 UTC
Permalink
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?
Post by Dennis Holunder
Hi,
I have multiple seda queues in my route, all with blockWennFull=true
08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
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
Dennis Holunder
2018-09-11 07:37:08 UTC
Permalink
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]
Post by Claus Ibsen
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?
Post by Dennis Holunder
Hi,
I have multiple seda queues in my route, all with blockWennFull=true
08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
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
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
________________________________
http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
To unsubscribe from Camel, click here.
NAML
Dennis Holunder
2018-09-11 07:55:13 UTC
Permalink
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]
Post by Claus Ibsen
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?
Post by Dennis Holunder
Hi,
I have multiple seda queues in my route, all with blockWennFull=true
08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
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
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
________________________________
http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
To unsubscribe from Camel, click here.
NAML
Andrea Cosentino
2018-09-11 07:57:08 UTC
Permalink
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: ***@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Tuesday, September 11, 2018, 9:55:35 AM GMT+2, Dennis Holunder <***@gmail.com> 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]
Post by Claus Ibsen
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?
Post by Dennis Holunder
Hi,
I have multiple seda queues in my route, all with blockWennFull=true
08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
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
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
________________________________
http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
To unsubscribe from Camel, click here.
NAML
Dennis Holunder
2018-09-11 08:02:26 UTC
Permalink
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
Post by Andrea Cosentino
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]
Github: oscerd
Looks like there is new option offerTimeout which causes to ignore
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]
Post by Claus Ibsen
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?
Post by Dennis Holunder
Hi,
I have multiple seda queues in my route, all with blockWennFull=true
08:33:04 [Camel (camel-1) thread #56 - seda://worker] ERROR deadletter
Exchange[ExchangePattern: InOnly, BodyType: com.Model,
CaughtExceptionType: java.lang.IllegalStateException,
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
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
________________________________
http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823078.html
To unsubscribe from Camel, click here.
NAML
________________________________
http://camel.465427.n5.nabble.com/seda-logs-Queue-full-Exception-tp5823076p5823085.html
To unsubscribe from Camel, click here.
NAML
Loading...