Is there anyway I can get the count of messages that has a certain property in a queue?
I was trying to move out large number of messages with move command (filtered on jms property using selector argument). however the operation timed out.
So I want to write a script to do the operation in batches. (make use of -index argument). however to perform job in batches I need to know the total number of messages that has the matching property in the queue.
The timeout you got is a request timeout. The move command still runs at the router until all messages have been moved. You should see it at the changing message counts of the queues involved in the move command. You can increase the request timeout at your client (app, CLI, Explorer) by setting the following system property, e.g. to 5 minutes:
The move commands accepts a selector which you can use to reduce the number of messages to move. You can also use the -index option with always the same parameters as the index always starts at 0. Say you have 10000 messages in testqueue and want to move it to testqueue2 in batches of 1000 messages:
Thanks. I need another clarification.
Let's say I decide to move messages using -selector option and the queue keeps receiving messages that matches the jms property.
What will happen in this case?
1. does the command take a snapshot and only move messages that were in the queue at the time of execution of the command?
2. does it keep checking incoming messages and move them?
3. does it stops accepting any message until the command completes execution?
I think option 3 is probably what will happen. Please confirm.