Websphere MQ Everyplace

examples.administration.commandline
Class QueueInquire

java.lang.Object
  |
  +--examples.administration.commandline.MQeAbstractCmdLineAdminTool
        |
        +--examples.administration.commandline.QueueInquire

public class QueueInquire
extends MQeAbstractCmdLineAdminTool

A command-line tool to allow someone to inquire on a queue without programming anything in Java. This version uses the admin messages to send the request to either a local or a remote queue manager. It can be called from the command line or from a Java program. The tool can be used to inquire on all types of queue.

Syntax

java examples.administration.commandline.QueueInquire <queueName> <destinationQMgrOfQueue> <qMgr> <ini_file>

queue_name
the name of the queue being inquired on.
destinationQMgrOfQueue
is the name of the queue manager that hosts the queue. For local queues the local queue definition is hosted on the same queue manager as the local queue. For remote queues, the remote queue definition is normally hosted on a different queue manager to the destination queue.
qMgr
the name of the queue manager where the inquire request will be sent. This is the queue manager where the inquire action will be performed.
iniFile
The fully qualified path of the .ini file used by this tool to instantiate a queue manager, send the admin message, and wait for the reply. Works with MQe 1.x style .ini files.

Examples

Assume two queue manangers: 1) ClientQM 2) ServerQM. ServerQM has a local queue called OrderQ and ClientQM has a remote queue called OrderQ on ServerQM. If the inquiry requests are issued from ClientQM and ClientQM startup parameters are provided in ini file ClientQM.ini, the following invocations could be made:

To inquire on the remote queue definition on ClientQM from ClientQM issue
QueueInquire OrderQ ServerQM ClientQM C:\MQe\...\ClientQM.ini
To inquire on the local queue definition on ServerQM from ClientQM issue
QueueInquire OrderQ ServerQM ServerQM C:\MQe\...\ClientQM.ini


Field Summary
static short[] version
           
 
Fields inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
ADMIN_Q_NAME, REPLY_TO_Q, TIMEOUT_MILLISECS
 
Constructor Summary
QueueInquire()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Gathers command-line parameters into variables, and calls the method which inquires on the queue.
static MQeFields inquireQueue(java.lang.String queueName, java.lang.String queueQMgrName, java.lang.String targetQMgr, MQeQueueManager myQMgr)
          Creates an admin message which will inquire on a queue and then it send it to a queue manager.
static void main(java.lang.String[] args)
          Entry point from the command line.
 
Methods inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
checkAdminReply, primeAdminMsg, processAdminMsg, sendWaitMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version
Constructor Detail

QueueInquire

public QueueInquire()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point from the command line.

Parameters:
args - Command-line arguments being passed in.

activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Gathers command-line parameters into variables, and calls the method which inquires on the queue.

Parameters:
args -
Returns:
void
Throws:
java.lang.Exception

inquireQueue

public static MQeFields inquireQueue(java.lang.String queueName,
                                     java.lang.String queueQMgrName,
                                     java.lang.String targetQMgr,
                                     MQeQueueManager myQMgr)
                              throws java.lang.Exception
Creates an admin message which will inquire on a queue and then it send it to a queue manager.

Parameters:
queueName - The name of the queue
queueQMgrName - The name of the queue manager that hosts the queue. For local queues the local queue definition is hosted on the same queue manager as the local queue. For remote queues, the remote queue definition is normally hosted on a different queue manager to the destination queue.
targetQMgr - The name of the queue manager to which the admin message will be sent.
myQMgr - The reference to an active MQe queue manager object, which will be used to send the admin message, and receive the reply.
Returns:
MQeFields contaning result
Throws:
java.lang.Exception

Websphere MQ Everyplace