background image

Starting the JMS Provider

<< Consume System Resources | The SynchConsumer Example >>
<< Consume System Resources | The SynchConsumer Example >>

Starting the JMS Provider

Starting the JMS Provider
When you use the Application Server, your JMS provider is the Application Server. Start the
server as described in
"Starting and Stopping the Application Server" on page 68
.
Creating JMS Administered Objects for the Synchronous Receive
Example
Creating the JMS administered objects for this section involves the following:
Creating a connection factory
Creating two destination resources
If you built and ran the SimpleMessage example in
Chapter 23, "A Message-Driven Bean
Example"
and did not delete the resources afterward, you need to create only the topic resource.
You can create these objects using the Ant tool. To create all the resources, do the following:
1. In a terminal window, go to the producer directory:
cd producer
2. To create all the resources, type the following command:
ant create-resources
To create only the topic resource, type the following command:
ant create-topic
These Ant targets use the asadmin create-jms-resource command to create the connection
factory and the destination resources.
To verify that the resources have been created, use the following command:
asadmin list-jms-resources
The output looks like this:
jms/Queue
jms/Topic
jms/ConnectionFactory
Command list-jms-resources executed successfully.
Compiling and Packaging the Clients for the Synchronous Receive
Example
The simplest way to run these examples using the Application Server is to package each one in
an application client JAR file. The application client JAR file requires a manifest file, located in
the src/conf directory for each example, along with the .class file.
Writing Simple JMS Client Applications
Chapter 31 · The Java Message Service API
915