moving large number of messages from a queue

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

moving large number of messages from a queue

sanjan
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.
Reply | Threaded
Open this post in threaded view
|

Re: moving large number of messages from a queue

IIT Software
Administrator
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:

-Dswiftmq.request.timeout=300000

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:

router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
1000 messages processed.
router1/sys$q/usage> move testqueue -queue testqueue2 -index 0 999
0 messages processed.


Reply | Threaded
Open this post in threaded view
|

Re: moving large number of messages from a queue

sanjan
Hi,

Is it possible to have the destination queue in another router?

Regards,
Sanjan
Reply | Threaded
Open this post in threaded view
|

Re: moving large number of messages from a queue

IIT Software
Administrator
Yep.
Reply | Threaded
Open this post in threaded view
|

Re: moving large number of messages from a queue

sanjan
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?
OR
2. does it keep checking incoming messages and move them?
OR
3. does it stops accepting any message until the command completes execution?

I think option 3 is probably what will happen. Please confirm.
Reply | Threaded
Open this post in threaded view
|

Re: moving large number of messages from a queue

IIT Software
Administrator
It is #1. The selector is applied at command execution time. If you want repeated execution, just schedule a Queue Mover Job (look under Queue Manager Jobs).