Java Reference
In-Depth Information
3. Run the Producer program, sending three messages to the queue:
appclient -client client-jar/producerClient.jar queue 3
The output of the program looks like this (along with some additional output):
Click here to view code image
Destination type is queue
Sending message: This is message 1 from producer
Sending message: This is message 2 from producer
Sending message: This is message 3 from producer
The messages are now in the queue, waiting to be received.
Note
When you run an application client, the command often takes a long
time to complete.
4. In the same window, go to the synchconsumer directory:
cd ../synchconsumer
5. 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.
6. Run the SynchConsumer client, specifying the queue:
appclient -client client-jar/synchconsumerClient.jar queue
The output of the client looks like this (along with some additional output):
Click here to view code image
Destination type is queue
Reading message: This is message 1 from producer
Reading message: This is message 2 from producer
Reading message: This is message 3 from producer
7. Now try running the clients in the opposite order. Run the SynchConsumer
client:
Search WWH ::




Custom Search