Thanks Claus, it helped a lot!

I can see the ‘Exchanges Inflight’ number in the jconsole 
org.apache.camel->routes->route-id->Attributes->Exchanges Inflight, but you 
mentioned there is some way to see the list of actual exchanges.
What is the path in jconsole to see it?

Dmitry



From: Claus Ibsen <claus.ib...@gmail.com>
Sent: Thursday, May 4, 2023 4:05 AM
To: users@camel.apache.org
Subject: Re: ProducerTemplate is waiting on something

Hi That indicates that a camel component is waiting for a reply that is taking 
a very long time, or not happening, or a timeout is not being triggered. You 
can use JMX and look in blocked exchanges to see a list and where they are in 
the route,
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
ZjQcmQRYFpfptBannerEnd

Hi



That indicates that a camel component is waiting for a reply that is taking

a very long time,

or not happening, or a timeout is not being triggered.



You can use JMX and look in blocked exchanges to see a list and where they

are in the route, and unblock them also.

hawtio also have a page to show that.



Also if you are using CXF then you can use it in synchronous=true mode as

its async mode may cause this situation (it did that in the past)



On Thu, May 4, 2023 at 12:44 AM Shultz, Dmitry 
<dmitry_shu...@kaltire.com<mailto:dmitry_shu...@kaltire.com>>

wrote:



> Hi All,

>

> We are having occasional problems with the some app using Camel 3.14.1

> rest routes and running in TomEE. After a while TomEE/Tomcat https

> interface became unresponsive.

> Looking at the thread dump I can see a lot of threads in such state:

>

> "https-jsse-nio-7443-exec-107" - Thread t@504

>    java.lang.Thread.State: WAITING

>         at sun.misc.Unsafe.park(Native Method)

>         - parking to wait for <78a7fac3> (a

> java.util.concurrent.CountDownLatch$Sync)

>         at

> java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)

>         at

> java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:836)

>         at

> java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:997)

>         at

> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304)

>         at

> java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231)

>         at

> org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.await(DefaultAsyncProcessorAwaitManager.java:107)

>         at

> org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:85)

>         at

> org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108)

>         at

> org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:199)

>         at

> org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)

>         at

> org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)

>         at

> org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153)

>         at

> org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:187)

>         at

> org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:195)

>         at

> org.apache.camel.ProducerTemplate$$OwbNormalScopeProxy0.sendBody(org/apache/camel/ProducerTemplate.java)

>

>    Locked ownable synchronizers:

>         - locked <59e6ab64> (a

> java.util.concurrent.ThreadPoolExecutor$Worker)

>

> this is how ProducerTemplate is produced (CDI):

>

>     @Produces

>     @ApplicationScoped

>     @MyProducerTemplate

>     ProducerTemplate getProducerTemplate() {

>         return context.createProducerTemplate();

>     }

>

> And this is how it is injected everywhere it is used (single

> ApplicationScoped instance):

>

>     @Inject

>     @MyProducerTemplate

>     ProducerTemplate producerTemplate;

>

> Is there anything wrong with re-using single instance? If not, what may be

> the problem?

>

> Thanks,

> Dmitry

>

>

>

>



--

Claus Ibsen

-----------------

@davsclaus

Camel in Action 2: 
https://urldefense.com/v3/__https://www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$<https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$>

Reply via email to