2008/8/7 Aidan Skinner <[EMAIL PROTECTED]>: > On Thu, Aug 7, 2008 at 6:26 AM, lahiru gunathilake <[EMAIL PROTECTED]> wrote: > >> On Thu, Aug 7, 2008 at 9:13 AM, lahiru gunathilake <[EMAIL PROTECTED]>wrote: > > Hey dude, > >>> I have implemented the delete command. It works like this, >>> queue delete -n ping -v development -t 3 <have to specify the virtualhost >>> in order to get a single queue object> : This delete top three messages from >>> the specified queue. > > Sweet! Now our users can unclog stuck brokers! > >>> If user didn't give the -t argument all the messages will be deleted from >>> the queue. > > I think that's a little risky, I'm quite forgetful and often try to do > things before I've had my 3rd cup of tea (which is the one that turns > me into a functional person) and I know I'd end up blowing away a > queue by mistake. I think this should be an error, or at least a "are > you sure? y/N" prompt > >>> I think the method I'm suppose to call moveMessages and I have to give >>> three arguments ( from MessageId, to MessageId,Queue). Could you please tell >>> me what does those mean. >>> >> Do you know any way to get MessageId's ? > > They should be part of the Message object, > Queue.getMessagesOnQueue().getMessage().getMessageId() > > - Aidan > -- > Apache Qpid - World Domination through Advanced Message Queueing > http://cwiki.apache.org/qpid > "Nine-tenths of wisdom consists in being wise in time." - Theodore Roosevelt
When thinking about the usecase for moving message from queue A to queue B I think the best thing to do might be to implement the viewing of Messages first. This will allow the user to identify the messages on the queue and select then provide you with the message ids they wish to move. Having a view command that starts by displaying message ID and header information would be a good start. This will allow the identification of a message which can then be used in the move command. Looking at the jmx method you can do view <queue> <num msgs> [<offset>] viewMessages(<offset>, <num msg>) This will return details of all the messages currently on the queue. Which includes the messageID in the reply. ViewUtility.populateCompositeWithCompositeData shows how the current Management interface extracts this information, although it is quite generic code I hope it is reasonable clear to read. from this you can print the msgID list then work up to extracting the header and other values for the message which it would be nice to be able to specify on command line: view <queue> <num msgs> [<offset>] [-show-headers] [-show-content] This should make implementing move much easier as you don't need to progamatically find the ids as the user will provide them hope that helps Martin -- Martin Ritchie
