Interesting. Are you using the JCA adapter, i.e. "java:/JmsXA"? You should use this to obtain a new JMS connection each time.
Yes, I'm using the JmsXA to create a connection on each request.
Any idea what the createQueueSession method might be waiting on?
Is there a connection pool setting that I should play with? I tried changing the max-pool-size on the JmsXA resource but it didn't seem to have any effect.
Also, not sure if this matters but to simplify my database setup I have my app tables, jBPM tables, and JMS tables in the same schema. This way they are managed by one local datasource. Not sure that it is best practices but it got me up and running quickly for the proof of concept that I'm building.
Here's a code snippet:
InitialContext iniCtx = new InitialContext(); Object tmp = iniCtx.lookup("java:/JmsXA"); QueueConnectionFactory qcf = (QueueConnectionFactory) tmp; QueueConnection jmsConn = qcf.createQueueConnection(); jmsConn.start(); Session sess = jmsConn.createQueueSession(true, Session.SESSION_TRANSACTED);
Found the problem. I needed to increase the max-pool-size significantly (to 100 for now) to get past that bottleneck. I'll have to play with that number until I find the optimal setup for my app.