Java Reference
In-Depth Information
FIGURE 21-5. A Java EE Application That Consumes Messages from a Remote
Server
Writing the Module Components for the
consumeremote
Example
Writing the components of the modules involves
• Coding the application client
• Coding the message-driven bean
The application client,
jupiterclient/src/java/SimpleClient.java
, is al-
Similarly, the message-driven bean,
earthmdb/src/java/MessageBean.java
,
is almost identical to the one in “
The Message-Driven Bean Class
” on page
229
.
The only
significant difference is that the activation config properties include one property that spe-
cifies the name of the remote system. You need to edit the source file to specify the name
of your system.
Creating Resources for the
consumeremote
Example
The application client can use any connection factory that exists on the remote server;
in this example, it uses
jms/ConnectionFactory
. Both components use the queue
nection factory; the resource adapter creates one for it.
Any missing resources will be created when you deploy the example.
Using Two Application Servers for the
consumeremote
Example
As in “
Running JMS Clients on Multiple Systems
” on page
398
,
the two servers are re-
ferred to as
earth
and
jupiter
.