The link @amol provided will not help for this situation.
It's been a while since I worked with WebsphereMQ, but IIRC, you configure a local connection definition table (or something named similarly) that knows about the HA broker locations and the URL you provide to the connection factory points to the local client and it deals with failover transparently.
I suggest you dig around in the IBM documentation. I'll see if I can find any more info in my email archive.
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware