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 » IBM MQ Java / JMS » deleting message through MQExplorer

Post new topic  Reply to topic
 deleting message through MQExplorer « View previous topic :: View next topic » 
Author Message
joecherian
PostPosted: Thu Jan 02, 2003 1:23 am    Post subject: deleting message through MQExplorer Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
kdavis
PostPosted: Mon Jan 06, 2003 12:08 pm    Post subject: Re: deleting message through MQExplorer Reply with quote

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
View user's profile Send private message
leongor
PostPosted: Tue Jan 07, 2003 1:15 am    Post subject: Reply with quote

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
View user's profile Send private message
kdavis
PostPosted: Tue Jan 07, 2003 5:46 am    Post subject: Re: deleting message through MQExplorer Reply with quote

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
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 » IBM MQ Java / JMS » deleting message through MQExplorer
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.