If you go to native MQ APIs there is a getAndWait method that, um, waits and gets. We use it for synchronous request-response MQ all the time. If you use a JMS wrapper over MQ I think there are synchronous methods, too. Use these solid APIs if you possibly can.
If you have to roll your own make use of the correlation id. MQ gives you this id when it sends a message and includes the id on the response so you can match things up. I'm in deep
water for me here, but maybe put some object in a shared Map with correlation id as key then wait() on it. The event handler for the asynchronous response could get the object by key and notify(). Does that kind of thing makes sense?