background image

Resources for the consumeremote Example

<< Writing the Module Components | Building the consumeremote Modules >>
<< Writing the Module Components | Building the consumeremote Modules >>

Resources for the consumeremote Example

Creating Resources for the consumeremote Example
For this example, the message-driven bean uses the connection factory named
jms/JupiterConnectionFactory
, which you created in
"Creating Administered Objects for
Multiple Systems" on page 931
. Use the Admin Console to verify that the connection factory
still exists and that its AddressList property is set to the name of the remote system. Because
this bean must use a specific connection factory, the connection factory is specified in the
mdb-connection-factory
element of the sun-ejb-jar.xml file.
If you deleted the connection factory, you can recreate it as follows:
1. Go to the following directory:
tut-install/javaeetutorial5/examples/jms/consumeremote/earthmdb/
2. Type the following command:
ant create-remote-factory -Dsys=
remote-system-name
Replace remote-system-name with the actual name of the remote system.
The application client can use any connection factory that exists on the remote server; it uses
jms/ConnectionFactory
. Both components use the queue named jms/Queue, which you
created in
"Creating JMS Administered Objects for the Synchronous Receive Example" on
page 915
.
Using Two Application Servers for the consumeremote
Example
As in
"Running JMS Client Programs on Multiple Systems" on page 931
, the two servers are
named earth and jupiter.
The Application Server must be running on both systems.
Which system you use to package and deploy the modules and which system you use to run the
client depend on your network configuration (which file system you can access remotely).
These instructions assume that you can access the file system of jupiter from earth but cannot
access the file system of earth from jupiter. (You can use the same systems for jupiter and
earth
that you used in
"Running JMS Client Programs on Multiple Systems" on page 931
.)
You can package both modules on earth and deploy the message-driven bean there. The only
action you perform on jupiter is running the client module.
An Application Example That Consumes Messages from a Remote Server
Chapter 32 · Java EE Examples Using the JMS API
981