There are several ways you can do this in HQ, e.g. using the management API.
However, the portable JMS way to do this would be to attempt to create a consumer on the queue and catch any exception thrown.
Thank you very much. This works for a producer as well.