Embedded JavaMQ Broker Throwing the Exception 'No threads are available to process a new connection on service jms'

(Doc ID 1436513.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Java CAPS Enterprise Service Bus - Version R6.2 to R6.2 [Release 6.0]
Information in this document applies to any platform.

Symptoms

The following exception is logged in the JavaMQ logs when publishing messages via the JMS Binding Component to JavaMQ.

[12/Mar/2012:15:29:33 GMT] WARNING [B3004]: No threads are available to process a new connection on service jms. 200 threads out of a maximum of 200 threads are already in use by other connections. A minimum of 2 threads must be available to process the connection. Please either limit the # of connections or increase the imq.<service>.max_threads property. Closing the new connection.
[12/Mar/2012:15:29:34 GMT] [B1066]: Closing: ???@127.0.0.1:0->jms:0 because "[B3004]: No threads are available to process a new connection on service jms. 200 threads out of a maximum of 200 threads are already in use by other connections. A minimum of 2 threads must be available to process the connection. Please either limit the # of connections or increase the imq.<service>.max_threads property. Closing the new connection. ". Count: service=0 broker=100
[12/Mar/2012:15:29:44 GMT] [B1065]: Accepting: admin@127.0.0.1:58657->admin:57807. Count: service=1 broker=101
[12/Mar/2012:15:29:44 GMT] [B1066]: Closing: admin@127.0.0.1:58657->admin:57807 because "[B0059]: Client closed the connection". Count: service=0 broker=100
[12/Mar/2012:15:31:13 GMT] [B1065]: Accepting: admin@127.0.0.1:58689->admin:57807. Count: service=1 broker=101
[12/Mar/2012:15:31:13 GMT] [B1066]: Closing: admin@127.0.0.1:58689->admin:57807 because "[B0059]: Client closed the connection". Count: service=0 broker=100
[12/Mar/2012:15:32:24 GMT] [B1065]: Accepting: admin@127.0.0.1:58724->admin:57807. Count: service=1 broker=101
[12/Mar/2012:15:32:24 GMT] [B1066]: Closing: admin@127.0.0.1:58724->admin:57807 because "[B0059]: Client closed the connection". Count: service=0 broker=100
[12/Mar/2012:15:33:04 GMT] [B1065]: Accepting: admin@127.0.0.1:58738->admin:57807. Count: service=1 broker=101
[12/Mar/2012:15:33:04 GMT] [B1066]: Closing: admin@127.0.0.1:58738->admin:57807 because "[B0059]: Client closed the connection". Count: service=0 broker=100

Note that by default the imq.jms.max_threads property is set to 1000 instead of 200 as in the above message.

The client connections grow until there are no free threads. The connections can be checked as follows:

\JavaCAPS6\appserver\imq\bin>imqcmd.exe list cxn
Username: admin
Password: admin
Listing all the connections on the broker specified by:

-------------------------
Host Primary Port
-------------------------
localhost 7676

--------------------------------------------------------------------
Connection ID User Service Producers Consumers Host
--------------------------------------------------------------------
8164241105024305152 guest jms 1 0 127.0.0.1
8164241105024360960 guest jms 1 0 127.0.0.1
8164241105024364032 guest jms 1 0 127.0.0.1
...

It takes 2 threads to process one client so if imq.jms.max_threads is set to 1000 there will be 500 client connections.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms