Monday 11 August 2014

MQ_MB_COMMANDS

http://www-01.ibm.com/support/knowledgecenter/SSFKSJ/mapfiles/product_welcome_wmq.html?lang=en

http://middlewarenews.blogspot.in/search/label/Websphere%20MQ


http://ibmmqadmin-madhu.blogspot.in/2012/09/mq-commands.html

http://ibmmqadmin-madhu.blogspot.in/2012/09/mq-commands.html

IBM MQ Commands

July 27, 2007 at 2:09 am | Posted in MQProgrammingTechnology | 5 Comments 
Some simple and useful IBM MQ Commands I found useful for debugging or testing the channels and queues. 
Some MQ Commands
Use ‘mqm' user
At : /usr/mqm/bin
Connect to Queue Manager
runmqsc <queue_manager_name>
Display Channel info
dis channel(<part_of_channel_name>*)
Display Channel full info
dis chs(<part_of_channel_name>*) all
Check channel is alive
ping channel(<channel_name>)
start channel(<channel_name>)
Display Queue Alias Info
dis qa(<part_of_queue_alias_name>*)
dis qa(<queue_alias_name>) all
Display Remote Queue Info
dis qr(<remote_queue_name>) all
Display Local Queue Info
dis ql(<part_of_queue_name>*) curdepth
Display Channel messages info including last message date and time
dis chs(<part_of_queue_name>*) msgs lstmsgda lstmsgti
Zerolize Counter (curdepth) in queue
runmqsc <queue_manager_name>
stop CHANNEL(<channel_name>)
start CHANNEL(<channel_name>)
It should then show zero messages :
dis chs(<channel_name>*) msgs lstmsgda lstmsgti
Perform a test put message

cd /usr/mqm/samp/bin./amqsput <queue_name><queue_manager_name>
Test message <Enter>


Websphere MQ Commands / ibm websphere mq commands

Websphere MQ Commands / ibm websphere mq commands
=================================================

MQ commands
Command namePurpose
amqccertCheck certificate chains
amqoamdOutput setmqaut commands
amqmdainConfigure or control WebSphere MQ services (Windows® systems only)
amqtcertTransfer certificates
crtmqcvxConvert data
crtmqmCreate a local queue manager
dltmqmDelete a queue manager
dmpmqautDump authorizations to an object
dmpmqlogDump a log [url]
dspmqDisplay queue managers
dspmqautDisplay authorizations to an object
dspmqcsvDisplay the status of a command server
dspmqflsDisplay file names
dspmqrteDisplay route application
dspmqtrcDisplay formatted trace output (UNIX® systems only)
dspmqtrnDisplay details of transactions [pareja de rsvmqtrn]
dspmqverDisplay version number
endmqcsvStop the command server on a queue manager
endmqdnmStop .NET monitor
endmqlsrStop the listener process on a queue manager
endmqmStop a local queue manager
endmqtrcStop tracing for an entity
mqftappRun the File Transfer Application
mqftrcvReceive file using the File Transfer Application (server)
mqftrcvcReceive file using the File Transfer Application (client)
mqftsndSend file using the File Transfer Application (server)
mqftsndcSend file using the File Transfer Application (client)
rcdmqimgWrite an image of an object to the log
rcrmqobjRecreate an object from their image in the log
rsvmqtrnCommit or back out a transaction [pareja dedspmqtrn]
runmqchiStart a channel initiator process
runmqchlStart a sender or requester channel
runmqdlqStart the dead-letter queue handler
runmqdnmRun .NET monitor
runmqlsrStart a listener process
runmqscIssue MQSC commands to a queue manager
runmqtmcInvoke a trigger monitor for a client (AIX® clients only)
runmqtrmInvoke a trigger monitor for a server
setmqautChange authorizations to an object
setmqcrlSet certificate revocation list (CRL) LDAP server definitions (Windows® systems only)
setmqprdEnroll production license
setmqscpSet service connection points (Windows® systems only)
strmqcsvStart the command server for a queue manager
strmqmStart a local queue manager
strmqtrcEnable tracing

Websphere MQ Basics


  1. Here is a list of key terms about message queuing .

    Term
    Description
    Queue managers
    The queue manager is responsible for maintaining the queues it owns, and for storing all the messages it receives onto the appropriate queues.
    Messages
    A message is a string of bytes that is meaningful to the applications that use it. Messages are used to transfer information from one application program to another. The applications can be running on the same or on different computers.
    Local queues
    A local queue is a data structure used to store messages. The queue can be a normal queue or a transmission queue. A normal queue holds messages that are to be read by an application that is reading the message directly from the queue manager. A transmission queue holds messages that are in transit to another queue manager.
    Remote queues
    A remote queue is used to address a message to another queue manager.
    Channels
    Channels are use to send and receive message between queue managers.
    Listeners
    Listeners are processes that accept network requests from other queue managers, or client applications, and start associated channels.

    Creating a queue manager called QM1

    1.      Create a queue manager with the name QM1 by typing the following command:
    crtmqm QM1
    When the system creates the queue manager, you see the following output:
    C:\IBM\WebSphereMQ\bin>crtmqm QM1
    WebSphere MQ queue manager created.
    Directory 'C:\IBM\WebSphereMQ\qmgrs\QM1' created.
    The queue manager is associated with installation 'Installation1'.
    Creating or replacing default objects for queue manager 'QM1'.
    Default objects statistics : 77 created. 0 replaced. 0 failed.
    Completing setup.
    Setup completed.

    The queue manager is stopped. You must start the queue manager to administer it, and read and write messages from its queues.
    2.      Start the queue manager by entering the following command:
    strmqm QM1
    When the queue manager successfully starts, you see the following output:

    C:\IBM\WebSphereMQ\bin>strmqm QM1
    WebSphere MQ queue manager 'QM1' starting.
    The queue manager is associated with installation 'Installation1'.
    5 log records accessed on queue manager 'QM1' during the log replay phase.
    Log replay for queue manager 'QM1' complete.
    Transaction manager state recovered for queue manager 'QM1'.
    WebSphere MQ queue manager 'QM1' started using V7.5.0.0.

    With the queue manager started, you can now create the queues.

    create a queue called LQ1

    A queue is a WebSphere MQ queue manager object. There are three ways to create WebSphere MQ objects:

    ·        Command-line.
    ·        WebSphere MQ Explorer.
    ·        Using a programmable interface.

    1.      Start the scripting tool by typing the following command.
    runmqsc QM1

    When the scripting tool starts, you see:
    C:\IBM\WebSphereMQ\bin>runmqsc QM1
    5724-H72 (C) Copyright IBM Corp. 1994, 2011.  ALL RIGHTS RESERVED.
    Starting MQSC for queue manager QM1.
    The tool is ready to accept MQSC commands.
    2.      Create a local queue called LQ1 by typing the following MQSC command:
    define qlocal(LQ1)
    When the queue is created, you see the following output:
    define qlocal(LQ1)
         2 : define qlocal(LQ1)
    AMQ8006: WebSphere MQ queue created.

    3.      Stop the scripting tool by typing the following MQSC command:
    end
    When the scripting tool ends, you see the following output:
    One MQSC command read.
    No commands have a syntax error.
    All valid MQSC commands were processed.

    C:\>

    Displaying Queue Manager Status

    To check the queue manager is running or not , type the following command: dspmq

     C:\IBM\WebSphereMQ\bin>dspmq
    QMNAME(QM1)   STATUS(Running)

    Putting a message to the Queue LQ1

    1.      Use the amqsput sample application to put a message to queue LQ1 by typing: amqsput LQ1 QM1

    When the sample application starts, you see:
    C:\>amqsput LQ1 QM1
    Sample AMQSPUT0 start
    target queue is LQ1
    Type Hello World and press Enter. You placed a message that contains the text “Hello World” on the queue LQ1 managed by the queue manager called QM1. To end amqsput, press Enter.

    You see the following output:
    C:\>amqsput LQ1 QM1
    Sample AMQSPUT0 start
    target queue is LQ1
    Hello World

    Sample AMQSPUT0 end

    Getting messages from the Queue LQ1
    Use the amqsget sample application to read a message on the queue LQ1 by typing: amqsget LQ1 QM1

    When the sample application starts, you see:

    C:\>amqsget LQ1 QM1
    Sample AMQSGET0 start
    message <Hello World>
    no more messages
    Sample AMQSGET0  end

    The amqsget application ends 30 seconds after reading the message.


    Resources

No comments:

Post a Comment