Once both the Primary and the Secondary Servers are running in HA mode, in order to verify the installation, perform the following steps:
- Open \fmq\samples\pubsub\DurableSubscribers\Publisher.java and DurableSubscriber.java in the same directory as your preferred Java IDE.
Include the parameter BackupConnectURLs in the environment being passed to InitialContext. This variable should point to the Backup Server's URL. For example, if the Backup Server is running on a host called 'backup-server' on port 1856, the following tag should be added to the environment.
Make this modification in both Publisher.java as well as in DurableSubscriber.java .
Start the Durable Subscriber and Publisher applications using the following command line:
To publish a message, type a string through the console and press enter. These messages are received by the subscriber, which prints the text on the console.
Now, shutdown the Primary Server using the shutdown script.
The Secondary Server initiates its startup sequence within the HA. ping_interval as set in Fiorano eStudio
If another message is published before the Backup Server completes its start up, the message is not delivered to the subscriber immediately.
As soon as the Secondary Server starts up, the durable subscriber's connection is re-established, and any pending messages are delivered.