I have a strange problem. When I connect to a remote MQ server from an application server (by doing the following)
//Get the connection factory
UnicastConnectionFactory l_connectionFactory = new UnicastConnectionFactory(p_sHost, p_iPort);//"127.0.0.1", 3999);//
//Get a connection
Connection l_connection = l_connectionFactory.createConnection();
Then the writer NIO thread spins to 100%. Looking at the code, the thread will select on writeability which (unless the network send buffer is full) will not block.
We've seen this problem recur frequently with JDK 1.4.1, due to an implementation bug. If you're on 1.4.1, switching up to 1.4.2 fixes the problem.
This also unfortunately can be OS dependent. What are some details of the system you're running on?
The design of the writer thread is such that it will not select on Write unless another thread puts some information in the write buffer and makes a request that it be flushed. At this time, it changes the selection bits to include write, which will either release the select immediately or block until the write buffer has space, at which time the writer flushes its internal buffers, and cancels the write bit when the bytes are all written.
Thank you very much for your reply.
The OS we are using is Redhat 9. java -version returns
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
so this is conistent with the problem.
I will try upgrading the JDK.
Again, thank you for getting back to me.
I am still finding that this occurs on WinXP even with the sun jdk 1.4.2
The problem also occurs then starting a single server and trying to connect to it and subscribe to a topic (using UnicastConnectionFactory).
This is on JDK1.4.2_03.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.