Hi Pasan,
Thanks for your reply. I was rather thinking about maintainability and stability - what if we move to a newer version of JBoss and they change the way the messages are internally stored? As this seems to be no public API, I guess they could change it any time. Then we would have to change our code as well.
We ended up creating our own database table to log whenever a message is produced or consumed, so we keep track of the existing messages "manually".