Pasan,
would you say this solution is suitable for production code or just for debugging? Would it work for retrieving all messages in a clustered queue? It might be just the thing I'm looking for - see my post at https://community.jboss.org/thread/197924. But I feel like this is meddling with JBoss internals, so maybe it shouldn't be used in production?