Author |
Message
|
flahunter |
Posted: Thu Nov 19, 2009 1:13 am Post subject: Use Java to clear a local queue |
|
|
 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 |
|
 |
AkankshA |
Posted: Thu Nov 19, 2009 1:57 am Post subject: |
|
|
 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 |
|
 |
flahunter |
Posted: Thu Nov 19, 2009 2:07 am Post subject: |
|
|
 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 |
|
 |
AkankshA |
Posted: Thu Nov 19, 2009 2:36 am Post subject: |
|
|
 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 |
|
 |
zpat |
Posted: Thu Nov 19, 2009 3:28 am Post subject: |
|
|
 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 |
|
 |
smdavies99 |
Posted: Thu Nov 19, 2009 5:55 am Post subject: |
|
|
 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 |
|
 |
flahunter |
Posted: Thu Nov 19, 2009 9:06 pm Post subject: |
|
|
 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 |
|
 |
AkankshA |
Posted: Thu Nov 19, 2009 9:48 pm Post subject: |
|
|
 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 |
|
 |
John89011 |
Posted: Fri Nov 20, 2009 11:42 am Post subject: |
|
|
Voyager
Joined: 15 Apr 2009 Posts: 94
|
|
Back to top |
|
 |
|