Tuning The Message-Driven Bean Pool - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

126
with known values in order to check the results of updates at the end of the test (see
$JONAS_ROOT/examples/src/mdb/sampleappli/EnvBean.java). Eleven messages are sent, the
corresponding transactions are committed, and the last message sent causes the transaction to be
rolled back.
9.6.1. Compiling This Example
To compile the sample application
$JONAS_ROOT/examples/src/build.xml
9.6.2. Running This Example
The default configuration of the JMS service in
jonas.services
jonas.service.ejb.descriptors
jonas.service.jms.topics
jonas.service.jms.queues
jonas.service.jms.collocated
This indicates that the JMS Server will be launched in the same JVM as the JOnAS Server, and the
JMS-administered objects
and registered in JNDI, if it does not already exist.
1. Run the JOnAS Server.
service jonas start
2. Deploy the
sampleappli
jonas admin -a sampleappli.jar
3. Run the EJB client:
jclient sampleappli.SampleAppliClient
4. Stop the server:
service jonas stop

9.7. Tuning the Message-Driven Bean Pool

A pool is handled by JOnAS for each Message-Driven Bean. The pool can be configured in the
JOnAS-specific deployment descriptor with the following tags:
min-pool-size
This optional integer value represents the minimum instances that will be created in the pool
when the bean is loaded. This will improve bean instance creation time, at least for the first
beans. The default value is 0.
max-cache-size
This optional integer value represents the maximum number of instances in memory. The purpose
of this value is to keep JOnAS scalable. The policy is that, at bean-creation time, an instance is
taken from the pool of free instances. If the pool is empty, a new instance is always created.
When the instance must be released (at the end of the
pool, except if the current number of instances created exceeds the
case this instance is dropped. The default value is no limit.
examples/src/mdb/sampleappli
file.
jmx,security,jtm,dbm,jms,ejb
// The jms service must be added
sampleappli.jar
StockHandlerTopic
OrdersQueue
true
StockHandlerTopic
container:
Chapter 9. Developing Message-Driven Beans
jonas.properties
(Topic) and
OrdersQueue
onMessage
, use Ant with the
is:
(Queue) will be created
method), it is pushed into the
max-cache-size
, in which

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents