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 » Perl: How to read all queue-handles ?

Post new topic  Reply to topic
 Perl: How to read all queue-handles ? « View previous topic :: View next topic » 
Author Message
helmutundarnold
PostPosted: Sat Mar 19, 2011 5:23 am    Post subject: Perl: How to read all queue-handles ? Reply with quote

Newbie

Joined: 19 Mar 2011
Posts: 2

Hello
in our aix environment we have many mq-series queues having more than one QUEUE-HANDLE. With the below InquireQueueStatus I always get the first handle in the attribute-hash.

How to walk through all of the other handles?

I've installed the CPAN MQSeries perl-modules version 1.28.

Code:
        eval {
            $attr3 = $command->InquireQueueStatus(
                QName => $qname,
                StatusType => 'Handle',               
            )
            or die "InquireQueueStatus handle: " . MQReasonToText( $command->Reason() ) . "\n";
        };
        if ( $@ ) {
            logs(7,"   warning 1: MQReasonToText( $command->Reason() \n");
        }


The result from the debugger shows:

Code:
DB<2> x \%$attr3
0  HASH(0x3114b08c)
   '' => 0
   'ApplTag' => 'amqrmppa'
   'ApplType' => 'QMGR'
   'ChannelName' => 'channel-name'
   'Conname' => 'some ip'
   'HandleState' => 'Inactive'
   'OpenBrowse' => 0
   'OpenInputType' => 'No'
   'OpenInquire' => 0
   'OpenOptions' => 43024
   'OpenOutput' => 1
   'OpenSet' => 0
   'ProcessId' => 680012
   'QMgrUOWId' => 0000.....
   'QName' => 'queue-name'
   'StatusType' => 'Handle'
   'ThreadId' => 5
   'UOWIdentifier' => 00000.....
   'UOWType' => 'QMgr'
   'UserIdentifier' => 'mqm'
  DB<3> x \%$attr3-1
0  823439499


Best Regards
Helmut Arnold
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sat Mar 19, 2011 6:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You might be getting a single result because you are assigning the result to a scalar value... But I can't tell from what you have posted per se. Try assigning it to a hash rather than a scalar.

Also not sure why you are using the eval block.
Back to top
View user's profile Send private message
helmutundarnold
PostPosted: Tue Mar 29, 2011 2:51 am    Post subject: Reply with quote

Newbie

Joined: 19 Mar 2011
Posts: 2

mqjeff wrote:
....Try assigning it to a hash rather than a scalar....


That was the trick. I'm now using an array with foreach ...
Code:

   @attr3Handles = $command->InquireQueueStatus(


... now I can walk through all handles.


Thank you very much, appreciate your help.
Helmut
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 » Perl: How to read all queue-handles ?
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.