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 API Support » Deleting messages with perl api

Post new topic  Reply to topic
 Deleting messages with perl api « View previous topic :: View next topic » 
Author Message
WLeideckDC
PostPosted: Wed Oct 06, 2004 4:00 am    Post subject: Deleting messages with perl api Reply with quote

Novice

Joined: 25 Aug 2004
Posts: 21
Location: Ludwigshafen, Germany

Hello.

I'm writing a small perl script that reads the SYSTEM.ADMIN.CHANNEL.EVENT
queue which is triggered. The defined process is the perl script, that reads the queue and mails the event data. I assumed that the queue will be cleared after getting the message but i'm wrong.
So my question is, how can i clear the queue after getting the messages with the perl api. I don't see any option or function to do that.

Here an excerpt from the script:
my $queue = MQSeries::Queue->new(
QueueManager => $QMGR,
Queue => $EVENTQ,
Mode => 'input_shared')
or die( "Unable to open queue.\n");


my $msg = MQSeries::Message::Event->new();
$queue->Get(
Message => $msg,
Sync => 1) or
die( "Unable to get message.\n" .
"CompCode = " . $queue->CompCode() . "\n" .
"Reason = " . $queue->Reason() . "\n" );
open(LOG, ">chmonitor.log") or die( "Unable to open logfile\n" );
for ( keys %{$msg->EventHeader()} ) {
if ($_ eq "Reason") {
print LOG "$_ : " . MQReasonToText($msg->EventHeader($_))
. "(" . $msg->EventHeader($_) . ")\n";
} else {
print LOG "$_ : " . $msg->EventHeader($_) . "\n";
}
}
Back to top
View user's profile Send private message
JasonE
PostPosted: Wed Oct 06, 2004 4:18 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

I know nothing about the perl interface... But at a rough guess, you are getting under syncpoint but not comitting.

There is no 'delete' option - gets are destructive unless you are browsing or the got message is under a unit of work which is eventually rolled back.
Back to top
View user's profile Send private message
WLeideckDC
PostPosted: Wed Oct 06, 2004 4:23 am    Post subject: Reply with quote

Novice

Joined: 25 Aug 2004
Posts: 21
Location: Ludwigshafen, Germany

Ups, yes you are right. The GET is running under syncpoint control. So i changed the Option "Sync => 0" and everything runs fine.

Thanks
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 API Support » Deleting messages with perl api
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.