background image

Deploys a Message-Driven Bean on Two Servers

<< Deploy the earthmdb Module | Overviewof the sendremote Example >>
<< Deploy the earthmdb Module | Overviewof the sendremote Example >>

Deploys a Message-Driven Bean on Two Servers

Undeploy the message-driven bean after you finish running the client. To undeploy the
earthmdb
module, perform these steps:
1. Change to the directory earthmdb.
2. Type the following command:
ant undeploy
You can also delete the jupiterclient.jar file from the remote filesystem.
To remove the generated files, use the following command in both the earthmdb and
jupiterclient
directories:
ant clean
An Application Example That Deploys a Message-Driven Bean
on Two Servers
This section, like the preceding one, explains how to write, compile, package, deploy, and run a
pair of Java EE modules that use the JMS API and run on two Java EE servers. The modules are
slightly more complex than the ones in the first example.
The modules use the following components:
An application client that is deployed on the local server. It uses two connection factories,
one ordinary one and one that is configured to communicate with the remote server, to
create two publishers and two subscribers and to publish and to consume messages.
A message-driven bean that is deployed twice: once on the local server, and once on the
remote one. It processes the messages and sends replies.
In this section, the term local server means the server on which both the application client and
the message-driven bean are deployed (earth in the preceding example). The term remote
server means the server on which only the message-driven bean is deployed (jupiter in the
preceding example).
The section covers the following topics:
"Overview of the sendremote Example Modules" on page 986
"Writing the Module Components for the sendremote Example" on page 987
"Creating Resources for the sendremote Example" on page 988
"Using Two Application Servers for the sendremote Example" on page 989
"Building, Deploying, and Running the sendremote Modules Using NetBeans IDE" on
page 989
"Building, Deploying, and Running the sendremote Modules Using Ant" on page 992
An Application Example That Deploys a Message-Driven Bean on Two Servers
Chapter 32 · Java EE Examples Using the JMS API
985