Configure timeout for get in MQ

Hi,
I have created a Q manager and queue in java and then try to get the message using get call
queue.get(msg, GMsgOpt);
The issue is the get call takes 6 mins to realize that the connection is gone. It blocks for 6 mins.Can i configure this time out to 20/30 seconds? I'm using waitInterval but no luck
Following is the piece of code:

Thanks Roger for the response...
Yup there is a message in the queue but the situation is that the connection is lost to MQ. The get method takes 6 mins to realize that there is no connection.. i think this is unacceptable. it should be somewhere around 20/30 secs.
I will change the code to include the options for open and get. Will that help? Any other pointers??
Thanks & Regards
Sumit

What is the MQ Reason Code that you are getting? i.e. 2059 or 2009, etc...

Regards,
Roger Lacroix

At 12:34 AM 3/23/2010, you wrote:
>
>[]
> Posted by sumit-sinha
>on Mar 23 at 12:41 AM <http://it.toolbox.com/api/ContentVote/3390854/1/1 />
>Mark this reply as helpful
><http://it.toolbox.com/api/ContentVote/3390854/1/ 1/>Mark as helpful
>Thanks Roger for the response...
>Yup there is a message in the queue but the
>situation is that the connection is lost to MQ.
>The get method takes 6 mins to realize that
>there is no connection.. i think this is
>unacceptable. it should be somewhere around 20/30 secs.
>I will change the code to include the options
>for open and get. Will that help? Any other pointers??
>Thanks & Regards
>
>Sumit
>
>

Thanks Roger.. The client connection is on LAN
The channel keep alive timer is set to auto. There is one more parameter heartbeat interval. what ideally should be the value of these two parameters? Does these to have any effect of detecting the connection lost time?
i have set the waitInterval to 30 seconds in the code for get message options. How can i shorten the "Get with Wait" to be for example 4 mins as you have told..
Many thanks in advance...
Regards
Sumit