Running A Message-Driven Bean - Red Hat APPLICATION SERVER - JONAS Manual

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

Advertisement

122
com.swiftmq.appserver.jonas.JmsAdminForSwiftMQ
SwiftMQ site.
For the purpose of this implicit administration phase, the deployer must add the "jms" service in
the list of the JOnAS services. For the example provided, the jonas.properties file should contain the
following:
jonas.services
jonas.service.ejb.descriptors
jonas.service.jms.topics
The destination objects may or may not pre-exist. The EJB server will not create the corresponding
JMS destination object if it already exists. (Refer also to Section 26.4 JMS Administration). The
should be explicitly declared only if the JOnAS Server is going to create it first, even
sampleTopic
if the Message-Driven Bean is not loaded, or if it is use by another client before the Message-Driven
Bean is loaded. In general, it is not necessary to declare the
JOnAS uses a pool of threads for executing Message-Driven Bean instances on message reception,
thus allowing large volumes of messages to be processed concurrently. As previously explained,
MDB instances are stateless and several instances can execute concurrently on behalf of the same
MDB. The default size of the pool of thread is 10, and it may be customized via the jonas property
jonas.service.ejb.mdbthreadpoolsize
in the following example:
jonas.service.ejb.mdbthreadpoolsize

9.4. Running a Message-Driven Bean

To deploy and run a Message-Driven Bean, perform the following steps:
Verify that a registry is running.
Start the Message-Oriented Middleware (the JMS provider implementation). See Section 9.4.1
Launching the Message-Oriented Middleware or Section 26.5.1 Accessing the Message-Oriented
Middleware as a Service.
Create and register in JNDI the JMS destination object that will be used by the MDB.
This can be done automatically by the JMS service or explicitly by the proprietary administration
facilities of the JMS provider (Section 26.4 JMS Administration). The JMS service creates the
destination object if this destination is declared in the
previous section).
Deploy the MDB component in JOnAS.
Note that, if the destination object is not already created when deploying an MDB, the container
asks the JMS service to create it based on the deployment descriptor content.
Run the EJB client application.
Stop the application.
When using JMS, it is very important to stop JOnAS using the
not be stopped directly by killing it.
Chapter 9. Developing Message-Driven Beans
class can be obtained from the
registry,security,jtm,dbm,jms,ejb
// The jms service must be added
samplemdb.jar
sampleTopic
sampleTopic
, which is specified in the
50
jonas.properties
// not mandatory
.
jonas.properties
file (as specified in the
command; it should
jonas stop
file as

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents