Author Message
NobuyukiIzumi
Joined: Apr 20, 2009
Messages: 7
Offline
I'd like to know the design for assigning ThreadPool(TP) thread while delivering events.
I believe JTAPI meta events are delivered to application by TP thread. Is this TP thread dedicated to each CallObserver thread (or anything else) in some situation?
In my system TP thread is assigned and delivers events but sometimes does not return for several seconds. In this situation other events for the same CallObserver were stacked and not delivered until the TP thread returned. JTAPI client does not run out TP thread, but other thread is not assigned.
Is there any parameter to allow JTAPI to assign other TP thread?


2017-09-26 11:31:52,625 [pool-1-thread-211] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:52,625 [pool-1-thread-211] DEBUG TsapiCallMonitor - TP thread Locked TsapiCallMonitor: removing events, itself for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:52,625 [pool-1-thread-211] DEBUG TsapiCallMonitor - TP thread Unlocked TsapiCallMonitor: calling callChangedEvent, delivering events for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189


// TP thread does not return for 2 seconds. //
// Other events were stucked and not delivered until the TP thread returned //



2017-09-26 11:31:54,598 [pool-1-thread-211] DEBUG TsapiCallMonitor - TP thread returned from callChangedEvent, Unlocked callChangedEvent for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,598 [pool-1-thread-209] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,598 [pool-1-thread-209] DEBUG TsapiCallMonitor - TP thread Locked TsapiCallMonitor: removing events, itself for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,598 [pool-1-thread-209] DEBUG TsapiCallMonitor - TP thread Unlocked TsapiCallMonitor: calling callChangedEvent, delivering events for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-209] DEBUG TsapiCallMonitor - TP thread returned from callChangedEvent, Unlocked callChangedEvent for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-234] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-234] DEBUG TsapiCallMonitor - TsapiCallMonitor: events delivered by previous thread; no events to deliver in this thread
2017-09-26 11:31:54,600 [pool-1-thread-180] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-180] DEBUG TsapiCallMonitor - TsapiCallMonitor: events delivered by previous thread; no events to deliver in this thread
2017-09-26 11:31:54,600 [pool-1-thread-210] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-210] DEBUG TsapiCallMonitor - TsapiCallMonitor: events delivered by previous thread; no events to deliver in this thread
2017-09-26 11:31:54,600 [pool-1-thread-174] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-174] DEBUG TsapiCallMonitor - TsapiCallMonitor: events delivered by previous thread; no events to deliver in this thread
2017-09-26 11:31:54,600 [pool-1-thread-206] DEBUG TsapiCallMonitor - TP thread woke up: Locked callChangedEvent, attempting to Lock TsapiCallMonitor for CallObserver com.avaya.sce.cticonnector.servlet.server.CTIConnectorManager$CTICallObserver@46af4189
2017-09-26 11:31:54,600 [pool-1-thread-206] DEBUG TsapiCallMonitor - TsapiCallMonitor: events delivered by previous thread; no events to deliver in this thread

Filename tsapi_trace.txt.zip [Disk] Download
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
I think I have found that JTAPI uses a single thread to deliver all the JTAPI events that are generated by a single TSAPI event. So, you will receive a MetaStart, one or more JTAPI Call events and a MetaEnd event with one thread. When the next TSAPI event is received, the JTAPI events will be delivered using a different thread.

Usually problems like this are caused by the application using the JTAPI thread to perform time consuming operations or even to make API calls. You should only use the JTAPI event threads to collect the events and place them on an internal queue. All processing and API calls should be performed using an application thread or threads.

Martin
NobuyukiIzumi
Joined: Apr 20, 2009
Messages: 7
Offline
Actually this JTAPI is used for EP/aesconnector. Should we check on aesconnector side to find a reason why TP thread did not return for 2 seconds?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
If you are using aesconnector, you should investigate from that end. However, I still suggest that the application is probably causing the delay.

Martin
Go to:   
Mobile view