![Red Hat Application Server Скачать руководство пользователя страница 130](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406130.webp)
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.
Содержание Application Server
Страница 1: ...Red Hat Application Server JOnAS User Guide ...
Страница 8: ......
Страница 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Страница 58: ...50 Chapter 3 JOnAS Configuration ...
Страница 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Страница 78: ...70 Chapter 6 JOnAS Command Reference ...
Страница 80: ......
Страница 86: ...78 Chapter 7 Developing Session Beans ...
Страница 136: ...128 Chapter 9 Developing Message Driven Beans ...
Страница 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Страница 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Страница 158: ...150 Chapter 14 EJB Packaging ...
Страница 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Страница 164: ......
Страница 176: ...168 Chapter 18 WAR Packaging ...
Страница 178: ......
Страница 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Страница 186: ...178 Chapter 21 Client Packaging ...
Страница 188: ......
Страница 192: ...184 Chapter 23 EAR Packaging ...
Страница 194: ......
Страница 200: ...192 Chapter 24 JOnAS Services ...
Страница 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Страница 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Страница 234: ...226 Chapter 29 Web Services with JOnAS ...
Страница 236: ......
Страница 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Страница 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Страница 296: ......