Thanks Claus! There is DefaultAsyncProcessAwaitManager and it has getThreadsBlocked() operation, but it returns 0. There is also DegfaultInflightRepository with browse() operation, but I can’t get anything because InflightBrowseEnabled (this is required to be enabled for the browse operations to function.) is false and not writable…
Anyway, I can see the problem now and have a question about how to solve it. The root cause is that our service is sending request to some third party service which apparently is not behaving sometimes… The easiest way would be to use ProducerTemplate async call instead of sync one because in this case we don’t care about response (the call just triggers some processing). I’m wondering if there is any default timeout on ProducerTemplate.asyncSendBody() or what is proper way to achieve the timeout behaviour (is this good enough https://stackoverflow.com/questions/49308074/apache-camel-timeout-synchronous-route ?). Btw, what will happen if we do nothing and these calls got stuck during Camel async processing? From: Claus Ibsen <claus.ib...@gmail.com> Sent: Thursday, May 4, 2023 11:09 AM To: users@camel.apache.org Subject: Re: ProducerTemplate is waiting on something Hi There is a mbean under services (I think) that has something with await manager - it has operations to list the blocked On Thu, May 4, 2023 at 8: 01 PM Shultz, Dmitry <Dmitry_Shultz@ kaltire. com> wrote: > Thanks Claus, it helped a ZjQcmQRYFpfptBannerStart This Message Is From an External Sender ZjQcmQRYFpfptBannerEnd Hi There is a mbean under services (I think) that has something with await manager - it has operations to list the blocked On Thu, May 4, 2023 at 8:01 PM Shultz, Dmitry <dmitry_shu...@kaltire.com<mailto:dmitry_shu...@kaltire.com>> wrote: > 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<mailto:claus.ib...@gmail.com>> > Sent: Thursday, May 4, 2023 4:05 AM > To: users@camel.apache.org<mailto: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$%3e> ><https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$%3e>< > https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$<https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$%3e> ><https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!aubXnsMfa8p3SGvMT22PbzynPg2GhFtqrjNMJf8wZfegju1ys3y474DqozOcS6QzNYI_-1xIEYHkk9n6UyiF1i8fWQ$%3e>> > -- Claus Ibsen ----------------- @davsclaus Camel in Action 2: https://urldefense.com/v3/__https://www.manning.com/ibsen2__;!!LdWlNaMnLCM!Y5Yw9mt0IKFhMX_4Ca7QkDvYwOuFi4IG5Hp0MM4Fa0C-PVEzhP8bASY5RbB_6iJKDpsa0RP0ZJakAgbs3qtxssp9_A$<https://urldefense.com/v3/__https:/www.manning.com/ibsen2__;!!LdWlNaMnLCM!Y5Yw9mt0IKFhMX_4Ca7QkDvYwOuFi4IG5Hp0MM4Fa0C-PVEzhP8bASY5RbB_6iJKDpsa0RP0ZJakAgbs3qtxssp9_A$>