10.2. Writing and Compiling the Application Components

Writing and compiling the components of the applications involve

  • Coding the application client
  • Coding the message-driven bean
  • Compiling the source files

10.2.1. Coding the Application Client: MultiAppServerRequester.java

The application client class, MultiAppServerRequester.java, does the following.

1.
It uses the Java Naming and Directory Interface (JNDI) API naming context java:comp/env to look up two connection factories and a topic.
2.
For each connection factory, it creates a connection, a publisher session, a publisher, a subscriber session, a subscriber, and a temporary topic for replies.
3.
Each subscriber sets its message listener, ReplyListener, and starts the connection. ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.