JMS queues are fairly queue-like, in that you can't scan if a particular message exists in the queue very easily or very quickly. Once you enqueue the message, you know it exists in the queue, and once you process it you know it is no longer in the queue. You can create a database table to track this information. You insert into the DB when the enqueue takes place, and delete from it when the dequeue takes place.
You can create a database table to track this information.
Yes, I guess that's the way to go. This solution also allows certain usage statistics to be collected, though a simple solution would have been nice.