122
Chapter 9. Developing Message-Driven Beans
com.swiftmq.appserver.jonas.JmsAdminForSwiftMQ
class can be obtained from the
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
registry,security,jtm,dbm,jms,ejb
// The jms service must be added
jonas.service.ejb.descriptors
samplemdb.jar
jonas.service.jms.topics
sampleTopic
// not mandatory
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
sampleTopic
should be explicitly declared only if the JOnAS Server is going to create it first, even
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
sampleTopic
.
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
, which is specified in the
jonas.properties
file as
in the following example:
jonas.service.ejb.mdbthreadpoolsize
50
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
jonas.properties
file (as specified 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
jonas stop
command; it should
not be stopped directly by killing it.
Summary of Contents for Application Server
Page 1: ...Red Hat Application Server JOnAS User Guide ...
Page 8: ......
Page 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Page 58: ...50 Chapter 3 JOnAS Configuration ...
Page 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Page 78: ...70 Chapter 6 JOnAS Command Reference ...
Page 80: ......
Page 86: ...78 Chapter 7 Developing Session Beans ...
Page 136: ...128 Chapter 9 Developing Message Driven Beans ...
Page 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Page 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Page 158: ...150 Chapter 14 EJB Packaging ...
Page 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Page 164: ......
Page 176: ...168 Chapter 18 WAR Packaging ...
Page 178: ......
Page 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Page 186: ...178 Chapter 21 Client Packaging ...
Page 188: ......
Page 192: ...184 Chapter 23 EAR Packaging ...
Page 194: ......
Page 200: ...192 Chapter 24 JOnAS Services ...
Page 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Page 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Page 234: ...226 Chapter 29 Web Services with JOnAS ...
Page 236: ......
Page 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Page 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Page 296: ......