|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
deleting message through MQExplorer |
« View previous topic :: View next topic » |
Author |
Message
|
joecherian |
Posted: Thu Jan 02, 2003 1:23 am Post subject: deleting message through MQExplorer |
|
|
Novice
Joined: 15 Dec 2002 Posts: 23 Location: India
|
Hello
I have got one doubt.I am having one Java application which is reading from one queue.While this application has read one message and is processing it, is it possible for me to delete this message from MQExplorer .?
when i tried to do that, i got an error as to the object is open
Thanks
Joe |
|
Back to top |
|
 |
kdavis |
Posted: Mon Jan 06, 2003 12:08 pm Post subject: Re: deleting message through MQExplorer |
|
|
Novice
Joined: 09 Dec 2002 Posts: 13
|
joecherian wrote: |
Hello
I have got one doubt.I am having one Java application which is reading from one queue.While this application has read one message and is processing it, is it possible for me to delete this message from MQExplorer .?
when i tried to do that, i got an error as to the object is open
Thanks
Joe |
If you use a JMS MessageConsumer (QueueReciever) and the transactional processing then your application should remove it for you. That is, your class implements MessageConsumer and at the end of the onMessage() method, you will call mySession.commit(); -- This will remove the message from the queue.
In my experience, if your application is running, then JMS has a "handle" on the queue and you are not permitted to remove it via the MQExplorer. I don't know that you would want to...
Along those lines, you should never remove a message from the topic queues (system.d.whatever---) via MQExplorer. The JMS broker will get screwed up and you will need to delete the broker and recreate it.
Keith |
|
Back to top |
|
 |
leongor |
Posted: Tue Jan 07, 2003 1:15 am Post subject: |
|
|
 Master
Joined: 13 May 2002 Posts: 264 Location: Israel
|
MQExplorer cannot delete particular message(s), it can only clear the queue.
For this action it wants to open the queue in exclusive mode.
So if some program opens a queue even in shared mode you cannot clear it from MQExplorer. _________________ Regards.
Leonid.
IBM Certified MQSeries Specialist. |
|
Back to top |
|
 |
kdavis |
Posted: Tue Jan 07, 2003 5:46 am Post subject: Re: deleting message through MQExplorer |
|
|
Novice
Joined: 09 Dec 2002 Posts: 13
|
kdavis wrote: |
If you use a JMS MessageConsumer (QueueReciever) and the transactional processing then your application should remove it for you. That is, your class implements MessageConsumer and at the end of the onMessage() method, you will call mySession.commit(); -- This will remove the message from the queue.
Keith |
If you aren't using JMS and just straight MQ,
MQMessage retrievedMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
// set the options
gmo.options = options;
gmo.waitInterval = getWaitInterval();
// get the message from the queue, populating the message object
queue.get(retrievedMessage, gmo);
...
qMgr.commit();
This retrieves the message, and in doing so removes it from the queue. The commit does exactly that -- this is opening the queue in a transactional mode. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|