Java Reference
In-Depth Information
c. Select the durablesubscriberexample folder.
d. Select the Open as Main Project check box.
e. Click Open Project.
f. In the Projects tab, right-click the project and select Build.
2. To run the client, right-click the durablesubscriberexample project
and select Run.
The output looks something like this (along with some additional output):
Click here to view code image
Connection factory without client ID is jms/ConnectionFactory
Connection factory with client ID is jms/DurableConnectionFactory
Topic name is jms/Topic
Starting subscriber
PUBLISHER: Publishing message: Here is a message 1
SUBSCRIBER: Reading message: Here is a message 1
PUBLISHER: Publishing message: Here is a message 2
SUBSCRIBER: Reading message: Here is a message 2
PUBLISHER: Publishing message: Here is a message 3
SUBSCRIBER: Reading message: Here is a message 3
Closing subscriber
PUBLISHER: Publishing message: Here is a message 4
PUBLISHER: Publishing message: Here is a message 5
PUBLISHER: Publishing message: Here is a message 6
Starting subscriber
SUBSCRIBER: Reading message: Here is a message 4
SUBSCRIBER: Reading message: Here is a message 5
SUBSCRIBER: Reading message: Here is a message 6
Closing subscriber
Unsubscribing from durable subscription
3. After you run the client, you can delete the connection factory jms/Dur-
ableConnectionFactory by using the following command:
asadmin delete-jms-resource jms/DurableConnectionFactory
To Run durablesubscriberexample Using Ant
1. In a terminal window, go to the following directory:
tut-install /examples/jms/advanced/durablesubscriberexample/
2. To compile and package the client, type the following command:
ant
Search WWH ::




Custom Search