I'm developing an application that uses JBoss 3.2.4 as a EAI/workflow server. Here's my situation:
I have a stateless session bean (call it Bean1) which is called every 30 seconds to look for new requests from a db table (I know...it's polling...no way around it). It reads a max of 5000 new rows and breaks each row into an individual message and sticks the message onto a queue (call it Queue1). A message driven bean (Bean2) gets the messages from Queue1 and creates two new messages: one for Queue2 and one for Queue3...It gets even more complicated from there.
This all works fine when I'm testing it with one new message at a time, but my first performance test of it (with 100 new requests in the db) yielded the following exception:
org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.io.IOException: Client is not connected)
This happens when Bean2 tried to do a jndi lookup of Queue2 or Queue3, and this didn't happen each time. It occurred approximately 6% of the time.
Use the JVM/IL for communication if you're working in one JVM. (java:/ConnectionFactory)
If you're on Windows, you may need to increase the number of sockets/threads available. Search around for this.