Configure your connection-factory object as follows:
imqobjmgr add -t cf -l "cn=myConnectionFactory" \ -o "imqAddressList=mq://jpgserv/jms" \ -o "imqReconnect=true" \ -o "imqReconnectAttempts=10" |
This command creates a connection-factory object with a single address in the broker address list. If connection fails, the client runtime will try to reconnect with the broker 10 times. If an attempt to reconnect fails, the client runtime will sleep for three seconds (the default value for the imqReconnectInterval attribute) before trying again. After 10 unsuccessful attempts, the application will receive a JMSException .
You can ensure that the broker starts automatically with at system start-up time. See Sun Java System Message Queue 3.7 UR1 Installation Guide for information on how to configure automatic broker start-up. For example, on the Solaris platform, you can use /etc/rc.d scripts.