Note the following tuning recommendations and best practices for configuring a JMS resource adapter for inbound communication:
Ensure that the JMS resource adapter allocates more threads than distributed destination members.
Always configure a clientID
when using topics. The JMS resource adapter uses a SHARABLE
subscription sharing policy when processing inbound messages, which requires a configured clientId
for either durable or nondurable subscribers.
If no clientID
is set, then the MDB does not receive the message and the error condition logged in the foreign application server log.
For more information, see The JMS Resource Adapter and Sharable Subscriptions.
For queues, increasing the value of maxListenerThreads
to more than one thread may increase the rate at which messages are consumed.
The JMS resource adapter does not support sharable connections. If you use the <resource-ref>
element in your application's deployment descriptor file (web.xml
, and ejb-jar.xml
) to identify the JMS connection factories that are looked up and used in that application, then you must set the <res-sharing-scope>
child element to unsharable
. The default value for this element is sharable
.
For example:
. . .
<resource-ref>
<res-ref-name>jms/ReplyFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>unsharable</res-sharing-scope>
</resource-ref>
If your application uses @Resource
injection, see http://docs.oracle.com/javaee/7/api/javax/annotation/Resource.html#shareable--
.