|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Deleting messages with perl api |
« View previous topic :: View next topic » |
Author |
Message
|
WLeideckDC |
Posted: Wed Oct 06, 2004 4:00 am Post subject: Deleting messages with perl api |
|
|
 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 |
|
 |
JasonE |
Posted: Wed Oct 06, 2004 4:18 am Post subject: |
|
|
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 |
|
 |
WLeideckDC |
Posted: Wed Oct 06, 2004 4:23 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
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
|
|
|
|