You can delete the messages in the queue through JMX upon startup or shutdown. Or, if you don't want the messages saved at all, call "setDeliveryMode" on the QueueSender with the value "DeliveryMode.NON_PERSISTENT"
Just a quick solution without using jmx-console or changing code:
Jboss uses hypersonic db as persistent storage for serialized jms
messages. We may prefer to preserve the default setting for Queues
or Topics to be persistent now because that is a good idea (don't
lose your messages).
The hypersonic database is set up by Jboss during its first run.
The original database/table structure resides in a flat file named "default.script". This file contains only 73 lines declaring
the database structure. Copy the first 73 lines to a backup file, say
If by scenario, you ran your application and spawned some
messages to the queue without any dequeuer or consumer,
definitely your message will pile-up over your Queue.
To discard all serialized messages on the Queue, you may
stop JBoss, overwrite the "default.script" with your "default.bak".
When you run your JBoss again, you'll never see any serialized
messages on the Queue being consumed by MDB (if any).
Finally, you may find the "default.script" file under your: