|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Need help to find the application connected to Queue |
« View previous topic :: View next topic » |
Author |
Message
|
sselva86 |
Posted: Mon Oct 25, 2010 11:14 am Post subject: Need help to find the application connected to Queue |
|
|
Novice
Joined: 25 Oct 2010 Posts: 17
|
Hi All ,
I need your help ,
I am doing small script in Perl which have to get the applications which are connected to the queue which may push or pull the message .
I have checked with the libraries for MQ but its not helping me to find .
Please give me some suggestion .
Regards
Selva |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 25, 2010 11:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
http://search.cpan.org/~mqseries/MQSeries-1.31/MQSeries.pm
particularly the MQSeries::QueueManager, MQSeries::Queue, and MQSeries::Message modules...
Code: |
# The best way to do error checking. Handle the object
# instantiation and connection to the queue manager independently.
#
my $qmgr = MQSeries::QueueManager->new
(
QueueManager => 'some.queue.manager',
AutoConnect => 0,
) || die "Unable to instantiate MQSeries::QueueManager object\n";
$qmgr->Connect() ||
die("Unable to connect to queue manager\n" .
"CompCode => " . $qmgr->CompCode() . "\n" .
"Reason => " . $qmgr->Reason() .
" (", MQReasonToText($qmgr->Reason()) . ")\n");
#
# Put a message under syncpoint, then commit/backout (in most cases,
# a Put is done using an MQSeries::Queue object instead)
#
my $msg = MQSeries::Message->new(Data => $msg_data);
$qmgr->Put1(Message => $msg,
Queue => 'SOME.QUEUE.NAME',
Sync => 1,
);
if (some_other_work_succeeds()) {
$qmgr->Commit();
} else {
$qmgr->Backout();
}
|
(above code happily stolen from module docs, and otherwise untested.) |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 25, 2010 11:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
sselva86 |
Posted: Mon Oct 25, 2010 11:54 am Post subject: |
|
|
Novice
Joined: 25 Oct 2010 Posts: 17
|
Actually i am able to connect the qmgr and able to get the data from queue .
Now suppose have to get the application or programs ( like Perl or MQ-monitor or RFHUtil ...) which are connected to the queue .
suppose if am trying to get message from queue using above applications or programs , then my open input count will be more than one .
How do i get the list of applications rather name of applications connected to queue .
Please give some more suggestion . |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 25, 2010 12:21 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You use the PCF Module to construct PCF messages that Inquire after the appropriate things to return the information you're after, at least to the level of the detail that the queue manager actually knows about. |
|
Back to top |
|
 |
sselva86 |
Posted: Tue Oct 26, 2010 8:49 am Post subject: |
|
|
Novice
Joined: 25 Oct 2010 Posts: 17
|
thanks to all ,
I tried with PCF commands and its worked fine .
I have found another way also using runmqsc command .
(thought of sharing my experience with all )
$command=qq/echo "display qstatus(queue) type(HANDLE) OPENTYPE(OUTPUT) appltag"|runmqsc qmgr/;
open FILE,"$command|" or die "cannot $_"; |
|
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
|
|
|
|