ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Use Java to clear a local queue

Post new topic  Reply to topic
 Use Java to clear a local queue « View previous topic :: View next topic » 
Author Message
flahunter
PostPosted: Thu Nov 19, 2009 1:13 am    Post subject: Use Java to clear a local queue Reply with quote

Acolyte

Joined: 30 Oct 2008
Posts: 62

Does any one has used Java to clear a local queue before. I cannot find a method. Please help.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Thu Nov 19, 2009 1:57 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

what have you tried so far ??

what error are you facing ???
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
flahunter
PostPosted: Thu Nov 19, 2009 2:07 am    Post subject: Reply with quote

Acolyte

Joined: 30 Oct 2008
Posts: 62

I used clearMessage() before, but it's wrong. clearMessage() is used to clear the data buffer portion of the MQMessage object not MQQueue object. So as I said, I haven't find a proper method to meet this requirement.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Thu Nov 19, 2009 2:36 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

i would rather prefer calling MQGET(destructive read) and discard the message till i get RC 2033 ...
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
zpat
PostPosted: Thu Nov 19, 2009 3:28 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Clearing a queue is an administrative function. Are you coding an admin tool and do you have the necessary level of access for the queue?

Admin tools usually work using PCF. Alternatively an application type of interface can just get the messages (as suggested above).
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Nov 19, 2009 5:55 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Remember that there are times when a PCF/runmqsc "Clear QL" won't work.
That is why MQExplorer has two ways to clear queues built into its functionality.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
flahunter
PostPosted: Thu Nov 19, 2009 9:06 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Oct 2008
Posts: 62

Thank you for reply. I just created a tools to simplify my test task. As suggest, I will use MQGET function till 2033 exception. Thanks.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Thu Nov 19, 2009 9:48 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

So you were creating the tool

Many existing support packs do this task and you could have used one of them....

you are reinventing the wheel... smdavies99 singnature quote states the rest
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
John89011
PostPosted: Fri Nov 20, 2009 11:42 am    Post subject: Reply with quote

Voyager

Joined: 15 Apr 2009
Posts: 94

could have used qload
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Use Java to clear a local queue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.