"but unfortunately it seems that even if I set browseOnly to be true, it seems to remove the message from the queue when I use receiveImmediate() "
It's hard to believe this. Something else is happening. Something basic like this would have turned up long ago.
You need to provide a testcase replicating it. (You may eventually find the issue on the process)
As soon as I posted the message, I wished I could have deleted it, because I realised that I was indeed being a little stupid! It wasn't a queue that I was attempting to check that was empty, but a topic!!
So no more replies required, and I apologise for taking up valuable time on this forum!!
Glad you fixed it :-) No worries!