synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <asan...@apache.org>
Subject Enhancements to the JMS transport
Date Wed, 12 Nov 2008 15:37:39 GMT
Hi all

As promised.. here is the current diff from my JMS updates.. I will not 
commit it right away since its easier for me to see the diffs clearly on 
my IDE, and allows me to complete the cleanup and dead code elimination 
this way.. also it will let anyone have a look at the code and comment..

The general state of the code is as follows:
 - Passes all unit tests / Transport Test kit tests except for a 
possible intermittent deadlock in QPID code for one test (see comment [1])
 - Has a few System.out.println's which will be made log.trace calls
 - Some dead methods and code needs to be cleaned up and removed

The approach basically re-uses most of the code and the architecture we 
had, but with improvements to handle concurrency, transactions and load 
etc. This will also allow us to fix issues like SYNAPSE-435 now.. 
(actually we need to fix this for all transports from the base). The 
basic architecture creates a new ServiceTaskManager instance for each 
service interested in the JMS transport, and the STM would create one 
(default) or more worker tasks (run off the transport worker pool) to 
read and process messages transactionally - both local and JTA. The 
transactions could be detached when required and supported by  
mediators, or else, the thread pool will commit (unless asked not to) 
when a listener thread returns after processing. The STM will scale up 
the number of tasks per service according to user defined parameters, 
and reduce extra tasks when load reduces. It also manages 
disconnection/re-connection from the JMS provider using the same 
geometric series enhancements we used for Endpoint failure recovery..

Of course, there could be a few more bugs.. and more cleanup.. I have 
intentionally left some sout's as well for my convenience.. My plan is 
to complete this and check this in by this Friday, so all comments are 
most welcome. I have perf tested the initial version of the STM (before 
Axis code) using the perf harness, and I will load test again with it 
before the final commit..

Documentation, samples and unit tests are to follow next week.. I must 
say that I am really impressed with the Transport TestKit that Andreas 
developed.. it was initially a black box for me, but soon it started to 
show me many bugs in the code and other issues, and was a really 
pleasant test bench to work with.. I think Andreas has started some Wiki 
documentation that will help others write new tests for other/new 
transports as well this way..

asankha

Comments
[1] When run from the IDE, I have sometimes (not always) seen QPID 
getting deadlocked with the following stack which seems close to 
https://issues.apache.org/jira/browse/QPID-849, Thus I have commented it 
out from the JMSTransportTest for now.. but it still runs on a mvn clean 
install and seems to work .. I've yet to fully understand the issue here..

"main" prio=1 tid=0x000000004011be70 nid=0x628a waiting on condition 
[0x00007fff1f912000..0x00007fff1f914c70]
    at sun.misc.Unsafe.park(Native Method)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
    at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1841)
    at 
org.apache.qpid.client.protocol.BlockingMethodFrameListener.blockForFrame(BlockingMethodFrameListener.java:196)
    at 
org.apache.qpid.client.protocol.AMQProtocolHandler.writeCommandFrameAndWaitForReply(AMQProtocolHandler.java:630)
    at 
org.apache.qpid.client.protocol.AMQProtocolHandler.syncWrite(AMQProtocolHandler.java:653)
    at org.apache.qpid.client.AMQSession.close(AMQSession.java:617)

[2] http://www.alphaworks.ibm.com/tech/perfharness

-- 
Asankha C. Perera
http://adroitlogic.org

http://esbmagic.blogspot.com


Mime
View raw message