Java Reference
In-Depth Information
Click here to view code image
Destination type is queue
To end program, type Q or q, then <return>
Reading message: This is message 1 from producer
Reading message: This is message 2 from producer
Reading message: This is message 3 from producer
Message is not a TextMessage
6. Type Q or q in the Output window and press Return to stop the client.
To Build and Package the AsynchConsumer Client Using Ant
1. In a terminal window, go to the asynchconsumer directory:
cd ../asynchconsumer
2. Type the following command:
ant
The targets package both the main class and the message listener class in the JAR
file and place the file in the dist directory for the example.
To Deploy and Run the Clients for the Asynchronous Receive Example Using Ant and the
appclient Command
1. Deploy the client JAR file to the GlassFish Server, then retrieve the client
stubs:
ant getclient
Ignore the message that states that the application is deployed at a URL.
2. Run the AsynchConsumer client, specifying the topic destination type.
appclient -client client-jar/asynchconsumerClient.jar topic
The client displays the following lines (along with some additional output) and ap-
pears to hang:
Destination type is topic
To end program, type Q or q, then <return>
3. In the terminal window where you ran the Producer client previously, run
the client again, sending three messages.
Search WWH ::




Custom Search