Hi Ravi,
When using the IBM MQ classes for JMS, you can specify a connection timeout by setting the Java system property com.ibm.mq.cfg.TCP.Connect_Timeout to a value in seconds. There are a few ways to do this:
1 ) One is to specify the argument -Dcom.ibm.mq.cfg.TCP.Connect_Timeout=<value>
on the command line when starting the application.
2 ) An alternative approach is to set it programmatically inside an application. To do this, the following line needs to be added before the application does any JMS work:
System.setProperty("com.ibm.mq.cfg.TCP.Connect_Timeout", "<value>");
I hope this helps! If you have any additional questions, feel free to ask.
Thanks
Paul Titheridge
IBM MQ Development : Java Service