-
1. Re: Delete messages from queue
genman Oct 7, 2003 12:34 PM (in response to parthi_10)
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"
References:
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/MessageProducer.html#setDeliveryMode(int)
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/DeliveryMode.html#NON_PERSISTENT -
2. Re: Delete messages from queue
adrian.brock Oct 7, 2003 5:22 PM (in response to parthi_10)If you locate the queue on
http://localhost:8080/jmx-console
it is in jboss.mq.destinations unless you changed the mbean
name.
There is a removeAllMessages() operation.
Regards,
Adrian -
3. Re: Delete messages from queue
edelarosa Oct 8, 2003 4:04 AM (in response to parthi_10)Hi Parthi,
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
"default.bak".
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:
$JBOSS_HOME/server/default/data/hypersonic folder.
cheers!