home / infca / mq (navigation links) El placer da lo que el pensamiento promete - Voltaire  

AMQMDAIN | Open count | Create Qmgr | script samp | Start channel | v 6.0, v 7.0 (ext) | RCs | Best Practices | QN resolution | Guidelines Auditoria | Other | URLs | End

MQ and me

MQ Homepage, Homepage, Fixes, Library, InfoCenter v 6 v 7, v 7.1, v 7.5 - Support Packs,

Hints Trigger [ext] Commands Trace Samples / tools Objects
Aliasing Clustering [ext] DLQ Distribution API [ext] Headers (RFH2)
Code Put Convert Dynamic lng rcv Default QmgrName Cmd Server
Namelists Backout SSL [ext] Channels DCOM WMI
Explorer [ext] Admin [ext] TTL RUNMQSC [ext] Create Qmgr Sys Objects
Processes AS/400 jExplorer Forums 2 QMs Exits
Transaccions [ext] File Extender Linux Borland / Dev-C++ MSCS File In Use
MQ Client [ext] Persistence Logging TroubleShooting Checklist FDC
Msg Size V 6.0 / save / v 7.0 RCs Monitoring (ext) FTP PHP
JavaScriptHP .Net MQ over Inet [ext] Eines Certify Sonic / uSoft
Auditoria Dubtes / millores MQ web Pend (2) URLs, links

gAddS 20170728

Atencio : fes servir un navegador "sense bloquejador de anuncis" !

2018 :

2019 : va al <head> !

What is it ?


Read some (v6) Fundamentals.

Hw & Sw requirements

Best url

Hardware requirements of MQ Server on Windows

Hardware requirements of MQ Explorer

If you want to use the MQ Explorer, you will need a minimum of:

MQ for Windows v 6.0 Quick Beginnings, amqtac05.pdf

Software requirements of MQ Server on Windows

Hardware requirements of MQ server on Solaris

MQ for Sun Solaris, Version 6.0 runs on all Sun SPARC and Sun UltraSPARC desktop and server systems, supported by the appropriate release of the Solaris operating environment.

MQ Server requirements on Linux

MQ for Linux, Version 6.0 (x86 platform) runs on any machine that supports the x86 machine architecture.
MQ for Linux, Version 6.0 (x86-64 platform) runs on any machine that supports the x86-64 (AMD64 or Intel© EM64T) machine architecture.
MQ for Linux, Version 6.0 (POWER platform) runs on any machine that supports the POWER machine architecture.
MQ for Linux, Version 6.0 (zSeries platform) runs on any machine that supports the zSeries machine architecture.
MQ for Linux, Version 6.0 (zSeries s390x platform) runs on any machine that supports the zSeries s390x machine architecture.

Operating System
MQ for Linux, Version 6.0 (x86 platform) has been tested with the following distributions:

Amunt! Top Amunt!
Fem que MQ perdi un msg ...
  1. a la maquina remota, definim una cua per rebre missatges, QL2
  2. a la maquina local, definim una cua remota que apunti a una cua local del gestor remot, QR1
  3. mitjançant RFHUTIL, posem missatges a QR1 i apareixen a QL2
  4. inhibim la cua QL2 per posar-hi missatges - els missatges apareixen a la DLQ del gestor remot, QM2
  5. inhibim la cua DLQ del gestor remot QM2 - el missatge desapareix !

El resum de les comandes es :

echo "DEFINE QLOCAL(QL2)" | runmqsc QM2 echo "DEFINE QREMOTE(QR1) RNAME('QL2') RQMNAME('QM2') XMITQ(QM2)" | runmqsc QM1 echo "ALTER QLOCAL(QL2) PUT(DISABLED)" | runmqsc QM2 echo "ALTER QLOCAL(DLQ) PUT(DISABLED)" | runmqsc QM2

Si el msg es no persistent, es perd i al fitxer AMQERR01.LOG trobem :

----- amqrmrca.c : 1562 ------------------------------------------------------- 09/09/2012 00:07:12 - Process(6252.3) User(MUSR_MQADMIN) Program(amqrmppa.exe) Host(DOGO902SEC) AMQ9511: Messages cannot be put to a queue. EXPLANATION: The attempt to put messages to queue 'DLQ' on queue manager 'QMM2' failed with reason code 2051. ACTION: Ensure that the required queue is available and operational. ----- amqrmmqa.c : 1830 ------------------------------------------------------- 09/09/2012 00:07:12 - Process(6252.3) User(MUSR_MQADMIN) Program(amqrmppa.exe) Host(DOGO902SEC) AMQ9511: Messages cannot be put to a queue. EXPLANATION: The attempt to put messages to queue 'QL2' on queue manager 'QMM2' failed with reason code 2051. ACTION: Ensure that the required queue is available and operational. ----- amqrmmqa.c : 1830 -------------------------------------------------------

Si el msg es persistent, no es perd doncs s'atura el canal a la banda de recepcio i al fitxer AMQERR01.LOG trobem :

----- amqrmmqa.c : 1830 ------------------------------------------------------- 09/09/2012 00:15:50 - Process(6252.3) User(MUSR_MQADMIN) Program(amqrmppa.exe) Host(DOGO902SEC) AMQ9999: Channel program ended abnormally. EXPLANATION: Channel program 'QMM1.QMM2' ended abnormally. ACTION: Look at previous error messages for channel program 'QMM1.QMM2' in the error files to determine the cause of the failure. ----- amqrmrsa.c : 533 -------------------------------------------------------- 09/09/2012 00:16:01 - Process(6252.4) User(MUSR_MQADMIN) Program(amqrmppa.exe) Host(DOGO902SEC) AMQ9002: Channel 'QMM1.QMM2' is starting. EXPLANATION: Channel 'QMM1.QMM2' is starting. ACTION: None. -------------------------------------------------------------------------------

Cajón de "sastre"

Hints, or Tips & Tricks Up
  • Problemes de MQ ==
    • problemes de Permisos (AIX)
    • problemes de Filesystem (own) or Comunicacions (not own)
    Problemes al AIX ? Permisos ! (98 %)
    Resta : Filesystem [/MQHA/qmgrname/log]

  • Instead of defining a Receiver channel, define a Requester channel, so it can be initiated from the receiver end.
    You have to specify the remote's site Listener port (and IP), as SYSTEM.REQUESTER channel will be used.

    Read "Intercommunication"

  • if you change your hostname, MQ wont start and a FDC will be generated containing
    Active LockFile and current MQM SID mismatch

  • To allow Remote Administration, a Queue Manager must define a Server Connection Channel, ( SYSTEM.ADMIN/DEF.SVRCONN may be used ) have the Commans Server running, as well as the Listener.

    DEFINE CHANNEL(MY.ADMIN) CHLTYPE(SVRCONN) DESCR('Admin connection') MCAUSER('mqm_cli_user') dspmqcsv <queue_manager_name> = display Command Server status strmqcsv <queue_manager_name> = start Command Server ps -ef | grep runmqlsr runmqlsr -m <queue_manager_name> -t TCP -p <port_number> alter channel(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN) mcauser('mqm_cli_user')


  • Como activar la Configuración / Administración Remota de un QMgr ? Hace falta :
    • QMgr funcionando : dspqm/strmqm SUNQM1
    • Listener running : runmqlsr -m SUNQM1 -t TCP -p 1415
    • Command Server running : strmqcsv/dspmqcsv SUNQM1
    • canales (at FMCQM) FMCQM.SUNQM1 (sender) y SUNQM1.FMCQM (receiver)

    En el explorador MQ remoto, damos :

    • Show Queue Manager
    • Remote (not Local)
    • Name ( nom REAL del Qmgr )
    • Conexion ( @ IP amb Listener Port !!! )

  • Channel names are restricted to 22 chars length !

  • Display listeners : use netstat -an | find "14" (win) or TCPVIEW.EXE

  • DISCINT := 0 ;
    On a channel Properties, Extended tab, define Disconnect Interval as 0 (Sender channels only).

    Improvment {092008} : 900 (usual) / 300.000 (special apps)

    Resources wasted :

    • Heartbeat - communications resource
    • amqrmppa thread - memory
      Performance support packs have stats on how much memory a running chanel takes.

    Another "con" : "an Inactive channel can't be effected by temporary network problems".

    A "pro" :
    If we use triggered channels, we will recognize connection problems at the time the channel is started, which is then very close to the deadline.
    If we start the channels at night or keep them running all day, we detect problems communicating with the remote end quite early (remote queuemanager not available, bad network changes, ....) which gives us time to investigate and fix the error a long time before the deadline is reached.

  • En el mensaje se especifica la ReplyQueueManager y el ReplyQueue. El Qmgr y Cola de destino se especifican al escribir en una cola remota. Ésta define :
    • un QMgr
    • una Cola Local a ese QMgr
    • una Cola de Transmisión, Local al QMgr Local.

  • On "QMgr name + Properties + Communication", enable the "Automatic Channel Definition" - once the Sender channel is defined, the corresponding Received channel "magically" appears.
    This feature uses the System Object AAA.BBB.CCC !
    See Intercommunication manual : "Auto-definition of receiver and server-connection channels", page 58, SC34-6587, MQ v 6.0, "Intercommunication".

  • Install "JMS = Java Message Service", rotulado al instalar como "envio de mensajes en Java" ...

  • Truco : "Add Snap_IN" to MQ Console - allows to see
    • MQ Services (local)
    • (w2k) Event Log
    • (w2k) Services
    • a Folder (with MQ logs)
    • etc
    Excelent !!

  • para leer mensajes específicos (a un Correl-ID), hay que
    • definir una "match options"
    • definir un intervalo de espera
    • establecer el campo a comparar

     gmo.matchOptions = MQC.MQMO_MATCH_CORREL_ID ;
     gmo.Options      = MQGMO_WAIT ;
     gmo.waitInterval = 3000 ;
     retrieveMsg.correlationId = szCorrelID.getBytes() ;

  • si estamos visualizando un cluster, y queremos acceder al queue manager remoto, y al dar "Connect" nos dice "Not Authorized" (AMQ4036) ... hay que asignar un usuario al MCA UserId del canal SYSTEM.ADMIN.SRVCONN !

    Si nos dice
    "Queue Manager not available for Connection" (AMQ4043) ...
    definim "DDBBVA" a c:\winnt\system32\drivers\etc\HOSTS ... as "ping DDBBVA" was also failing ... ("DDBBVA" not known at DNS)

  • las colas del host no se pueden administrar remotamente, pues el PDF de Host (API de Administración) no es el mismo que en las demás plataformas
    Fixed in version 6

  • You can read only a local queue, not a remote.
    You can write to a local or remote queue.

  • You are advised to give the transmission queue the same name as the target queue manager so that the queue is found by default.
    When you define a Remote Queue, you can provide the name of a transmission queue. You do not have to specify this. If you do not, a transmission queue with the same name as the target queue manager is used, or, if this does not exist, the default transmission queue is used.

    The XMITQ name must match the remote queue manager name in order for remote administration to work, unless you are using a queue manager alias.

    System Admin, SC34-6068-01, page 62

  • You are advised to create a DLQ for any queue manager you define

  • You are advised to know the name of the default queue manager and verify it exists : remote admin

  • there is a parameter only available at Queue Manager creation time : Log File Size !
    See MQS.INI

  • How to copy a MQ configuration from one machine to another ?

    • use runmqsc, edit the output file a little bit, and run runmqsc again - (chklst)

    • use saveqmgr.exe ( requires MQM.DLL ) or saveqmgrc.exe ( requires MQIC32.DLL / AMQZSAIC.DLL). MQjeff @ mqseries.net, replaced by dmpmqcfg

      Mind it requires the Qmgr "Running" (or "MQCONN failed for MQCFGDES, CC=2 RC=2059"). It could be a problem in a cluster ...


  • How to dump a queue to a file ?

    Use QLOAD (MO03) - it preserves Message ID !

  • How to know who's increasing the "Open Input Count" of a local queue, OPPROCS ? Use
    dis qstatus(QUEUE.NAME) type(handle) all
    that will show you the PID, CONNAME, USERID, CHANNEL name and APPLTAG !
    The DataFlowEngine.exe is MB ...

    dis qstatus(MQPRD01) type(handle) all 13 : dis qstatus(MQPRD01) type(handle) all AMQ8450: Display queue status details. QUEUE(MQPRD01) TYPE(HANDLE) APPLTAG(runmqchl_nd) APPLTYPE(SYSTEM) BROWSE(NO) CHANNEL(MQCFGPRD.TO.MQPRD01) CONNAME( HSTATE(ACTIVE) INPUT(EXCL) INQUIRE(YES) OUTPUT(YES) PID(671864) QMURID(0.5) SET(YES) TID(1) URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[]) URTYPE(QMGR) display qstatus(Q.FEM49.NAR_FAZ_REPLY.1) type(handle) all 4 : display qstatus(Q.FEM49.NAR_FAZ_REPLY.1) type(handle) all AMQ8450: Display queue status details. QUEUE(Q.FEM49.NAR_FAZ_REPLY.1) TYPE(HANDLE) APPLTAG(r\runtime\progr\FazSrv.exe) APPLTYPE(USER) BROWSE(NO) CHANNEL(CLI.MARECOS.1) CONNAME( HSTATE(ACTIVE) INPUT(SHARED) INQUIRE(NO) OUTPUT(NO) PID(508) QMURID(0.5) SET(NO) TID(3) URID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[]) URTYPE(QMGR) USERID(mqm)

  • MQVER - display MQ version and CSD level.

  • DSPMQ - display all queue manages names and status.

    Uses Registry ( HKLM/Software/IBM/MQSeries/CurrentVersion/Configuration/ ) to store its values

    • QueueManager
    • Services : [Protocol := 2 (TCP)], [Listener := x'1784 (6020)]

    Solaris still uses qm.ini at /var/mqm/qmgrs/SUNQM1/

  • CRTMQM / STRMQM / ENDMQM / DLTMQM - create / start / stop / delete a queue manager.

    CRTMQM parameters
    Usage: crtmqm [-z] ; suppress error messages. [-q] ; make this one the default queue manager. [-c Text] ; descriptive text (64 chars). [-d DefXmitQ] ; default transmission queue. There is no default. [-h MaxHandles] ; max num of handles any application can have open. Default value is 256. [-g ApplicationGroup] ; name of the group containing members allowed to run MQI applications, update IPCC resources and change contents of QM directories. Default value is -g all = unrestricted access. [-t TrigInt] ; trigger interval when triggering is suspended. Default is 999 999 999 milliseconds, more than 11 days. [-u DeadQ] ; name of the local queue that is to be used as dead-letter queue. The default is no dead-letter queue. [-x MaxUMsgs] ; max num of uncommitted messages under any one syncpoint. Default value is 10 000 uncommitted messages. [-lp LogPri] ; number of log primary files (*). Default = 3, min = 2, max = 254 (win), 510 (unix). [-ls LogSec] ; number of log secondary files. Default = 2, min = 1, max = 253 (win), 509 (unix). [-lc | -ll] ; circular (default) vs linear logging. [-lf LogFileSize] ; log file pages (* specified at creation time only *) [-ld LogPath] ; directory used to hold log files. QMgrName (*) $ CRTMQM es el únic moment per especificar Log File Pages size ! Flag "-lf" = Log File pages, units of 4 KB. Unix : default is -lf=1024, giving a log file size of 4 MB (1024 pages pf 4 KB each). Min 64, max 65535, this is 256 MB (65.535 * 4 KB). Solaris : max is 16384, giving 65.535 KB log file size, 65 MB (16.384 pages of 4 KB each) Win : default is -lf=4096, giving a log file size of 16 MB (4096 pages of 4 KB each). Min 32, max 65535, If we need to store 2,5 GB of persistent messages, we shall use "-lp 10 -lf 65535" (4 KB * 10 * 65.535) To store 650 MB, we use "-lp 10 -lf 16384" (4 KB * 10 * 16.384) lp = pre-formatted disk space, used for anticipated workload ls = not-formatted disk space, used for un-anticipated traffic

    En canvi, -lp i -ls es poden canviar al QM.INI a posteriori.



    When you open a MQ queue, the MQOPEN call performs a name resolution function on the queue name that you specify. This determines on which queue the queue manager performs subsequent operations.
    The name that you supply in ObjectQMgrName is resolved before that in ObjectName.

    You can use a local definition of a remote queue to define an alias for the name of a queue manager. This allows you to select which transmission queue is used when you put messages on a remote queue, so you could, for example, use a single transmission queue for messages destined for many remote queue managers.

    The default transmit queue is used when all previous fail in "queue-name resolution". See table 5, "Resolving queue names when using MQOPEN", MQ v7 Application Programming Guide, pg 113/615, SC34-6939-00 : if ObjectQMgrName does not match any local object then DEFXMITQ is used


    If we connect to MQ4 and put a message with destination qmgr="PRUEBA" and queue="MICOLA", it reaches its destination flawlessly.

    DEFXMITQ is used to build a HUB-like network, with request messages going to a central site
    Improvements to system objects default values / millores als objectes del sistema

    Here are some improvements to default system objects

    // SYSTEM.DEFAULT.(alias, local, remote).QUEUE to DEFBIND(NOTFIXED) // CLWLPRTY := 5 ; // so we can "lower" it // close external connections by default ALTER CHANNEL ('SYSTEM.DEF.SVRCONN') CHLTYPE(SVRCONN) MCAUSER('nobody') // set DISCINT to 0 in cluster channels alter channel('SYSTEM.DEF.CLUSRCVR') DISCINT(0) alter channel('SYSTEM.DEF.CLUSSDR') DISCINT(0) // ( HBINT > 0 ) & ( HBINT & DISCINT) // dont use SYSTEM.CLUSTER.TRANSMIT.QUEUE for all Cluster Channels DEFCLXQ(SCTQ) -> DEFCLXQ(CHANNEL)

    Some interesting system settings

    STRMQM parameters
    Usage: strmqm [-a|-c|-r][-d none|minimal|all][-z][-ns] [QMgrName] -c recreate the system objects with the default values and create SYSTEM.MQEXPLORER.REPLY.MODEL
    ENDMQM parameters
    Usage: endmqm [-z] [([-c | -w | -i | -p] [-r] [-s]) | -x] QMgrName -c Controlled (or quiesced) shutdown. = stops after all applications have disconnected. Control returns immediatelly. -i Immediate shutdown. = QM stops after it has completed all the MQI calls being processed -p Preemptive shutdown. Use only in exceptional circumstances. = does not wait for applications neither MQI calls -r Start trying to reconnect reconnectable clients. -s Switch over to a standby queue manager instance after shutting down. -w Wait shutdown. Waits until controlled shutdown is complete. = as "controlled" but control returns only after QM has stopped. -x End standby queue manager instance, without ending the active instance. -z Suppress error messages.

  • put/get/browse tools : (2-nd param is QueueManager)

    AMQSPUT - *** 1 msg per line ***


    AMQSGBR - browse all messages in queue - Data only

    AMQSBCG - browse all messages in queue - Data and Headers

    Latest are in e:\mq\tools\c\samples\bin !

    Use RFHutil ! (IH03 here) - requires IMQS23VN.DLL !
    RFHUTILC requires IMQC23VN.DLL !?

    How to connect the client to a (remote) Qmgr ?
    qmn := 'SYSTEM.DEF.SVRCONN/TCP/' ;

  • \\MQ\Eines\WorkLoader\WLG_SRV.exe - Work Load Generator (SAG)

    Input params : qMgr, qName, numConnect, delayConnect, numMsgs, delayMsgs, sizeMsg, fileMsg, verbose.
    Get it !

  • AMQICLEN - release System V IPC resources allocated by the queue manager but not freed.

  • SETmqaut / DSPmqaut / DMPmqaut -

  • RUNMQLSR / ENDMQLSR - manage Listener

  • STRMQCSV / ENDMQCSV / DSPMQCSV - manage Command Server

  • MQRC - interpret a Return Code
    Requires AMQZST.DLL (MQ Server)
    Usual values here

  • AMQAPI - GUI tool to test the MQ API

  • RUNMQSC - run MQSC command line commands.

  • SETMQCAP 2 ??? {gone on v6}

  • Interoperability url :
    Interoperability with later versions is a contract between WebSphere MQ clients and queue managers, and between queue managers. Earlier clients and queue managers can connect to, and exchange messages with, later versions. An application connected to an earlier version of the WebSphere MQ client and queue manager is not affected by upgrading the queue manager. WebSphere MQ client applications do not need to change to connect to new versions of a queue manager. It also means that an application that exchanges messages with applications connected to other queue managers will continue to work if the other queue managers are upgraded to new versions, and the applications do not change. WebSphere MQ clients and queue managers are interoperable with later versions.

Amunt! Top Amunt!
MQ commands (MQ/bin/*.exe) v 7.5
Command name Purpose
amqccert check certificate chains
amqmdain configure or control WebSphere MQ services (Windows® systems only)
amqoamd output setmqaut commands
amqtcert transfer certificates
crtmqcvx convert data
crtmqm create a local queue manager
dltmqm delete a queue manager
dmpmqaut dump authorizations to an object
dmpmqlog dump a log [url]
dspmq display queue managers
dspmqaut display authorizations to an object
dspmqcsv display the status of a command server
dspmqfls display file names
dspmqrte display route application
dspmqtrc display formatted trace output (UNIX® systems only)
dspmqtrn display details of transactions [pareja de rsvmqtrn]
dspmqver display version number
endmqcsv stop the command server on a queue manager
endmqdnm stop .NET monitor
endmqlsr stop the listener process on a queue manager
endmqm stop a local queue manager
endmqtrc stop tracing for an entity
mqftapp run the File Transfer Application
mqftrcv receive file using the File Transfer Application (server)
mqftrcvc receive file using the File Transfer Application (client)
mqftsnd send file using the File Transfer Application (server)
mqftsndc send file using the File Transfer Application (client)
rcdmqimg write an image of an object to the log {sg24-5222}
rcrmqobj recreate an object from their image in the log {sg24-5222}
rsvmqtrn commit or back out a transaction [pareja de dspmqtrn]
runmqchi start a channel initiator process
runmqchl start a sender or requester channel
runmqdlq start the dead-letter queue handler
runmqdnm run .NET monitor
runmqlsr start a listener process
runmqsc issue MQSC commands to a queue manager
runmqtmc invoke a trigger monitor for a client (AIX® clients only)
runmqtrm invoke a trigger monitor for a server
setmqaut change authorizations to an object
setmqcrl set certificate revocation list (CRL) LDAP server definitions (Windows® systems only)
setmqprd enroll production license
setmqscp set service connection points (Windows® systems only)
Publish the client-connection channel definitions in Active Directory instead of using environment variables MQCHLLIB and MQCHLTAB
strmqcsv start the command server for a queue manager
strmqm start a local queue manager
strmqtrc enable tracing

url, o chapter 17, "Control Commands", llibre MQ v 6.0 System Admin Guide, amqzag08.pdf, SC34-6584-01.

AIX specific commands.

Amunt! Top Amunt!
MQ trace

STRMQTRC / ENDMQTRC / DSPMQTRC - start / stop / display MQ trace.

strmqtrc [-t TraceType] [-x TraceType] [-l MaxSize] [-d MaxUserDataSize]

$ STRMQTRC -e -t all -t "detail" Please note that "detail" is in lower case and in double quotes.

Trace files ubication. During the installation process, you can choose the drive on which trace files are to be located. The trace files are always placed in the directory \<mqmwork>\errors (mq v 5.3) or \<mqmwork>\trace (mq v 6), where <mqmwork> is the directory selected when MQ was installed to hold MQ data files. Trace-file names have the following format: AMQppppp.TRC

System Administration Guide SC34-6068-02, page 228 [252/567]

UNIX special feature :
Start trace for all MQ operations occurring on a system by issuing the following command:

strmqtrc -e -t detail -t all

To format all trace files in the current directory use the following command:

dspmqtrc *.TRC => *.FMT at /var/mqm/trace/ directory

Windows :

strmqtrc [-t TipoRastreo] [-x TipoRastreo] [-l TamMaxArch] [-d TamDatosUsuario] Sample : strmqtrc -e -t all -t "detail"

MQ for Windows trace does not require any formatting. Browse *.TRC files in "c:\MQ\trace\" directory.

Filter RC's by :

type *.trc | find "rc=MQRC"

Amunt! Top Amunt!
c:\> dmpmqlog ? Utilización: dmpmqlog [-b | -s LSNInicial | -n NúmExtensión] [-e LSNFinal] [-f VíaArchAnot] [-m NombGstcolas]

Dumping the contents of the log using the dmpmqlog command

Use the dmpmqlog command to dump the contents of the queue manager log. By default all active log records are dumped, that is, the command starts dumping from the head of the log (usually the start of the last completed checkpoint). The log can usually be dumped only when the queue manager is not running. Because the queue manager takes a checkpoint during shutdown, the active portion of the log usually contains a small number of log records. However, you can use the dmpmqlog command to dump more log records using one of the following options to change the start position of the dump:

c:\> dmpmqlog -b -m X1

Amunt! Top Amunt!

Administrar SERVICIOS de MQ ...

AMQMDAIN [command] [object] [options] Where [command] is one of: start end auto manual status refresh regsec spn reg qmgr start qmgr end qmgr alter svc list svc view svc start svc end svc alter svc define svc delete

Compte amb els canvis (listener) amb la versió 6

amqmdain start qmgrname = start a queue manager
amqmdain end qmgrname = stop a queue manager
amqmdain auto qmgrname = fer que s'engegui automaticament
amqmdain manual qmgrname
amqmdain crtlsr qmgrname -t tcp -p portnumber // v 6.0 => Listener creation no longer supported
amqmdain crttrm qmgrname QueueName
amqmdain crtchi qmgrname SYSTEM.CHANNEL.INITQ
amqmdain status qmgrname / ALL
amqmdain cstmig FileName
amqmdain regsec

Starting a queue manager service with amqmdain is not the same as using strmqm from the command line, because the MQ service executes in a non-interactive session, running under a different user account.

System Admin v 6.0, page 297 [319/647]

Amunt! Top Amunt!
MQ sample programs / tools

Compte : moving to API module
Sample / file name Purpose
amqsaicq.c Create a local queue using the MQ Administration Interface (MQAI)
amqsaiem.c Event monitor using the MQ Admin Interface (MQAI)
amqsailq.c Inquire the current depth of all local queues using MQAI
amqsaxe0.c ApiExit which traces MQAPI calls
amqsbcg0.c Browse messages, text and header (use amqsgbr for text only)
amqsblst.c Bandwidth and connectivity tester
amqscnxc.c Client connection information on MQCONNX
amqsecha.c (triggered program) MQPUT1() a msg to ReplyToQueue (sent by amqsreq maybe) - see QM_resolution_sample or AMQSECHA_modificat o QNR.C  
amqsgbr0.c Browse messages, text only (use amqsbcg for text and header)
amqsget0.c MQGET() sample - Get a message
amqsgrma.c Get reference messages from a queue. Checks that the objects, identified in the messages, exist
amqsinqa.c (triggered program) - MQINQ() sample - inquiry Queue Depth, Get Inhibited and Input Count.
amqsldpc.c Look up the MQ host name, channel name and queue name in an LDAP directory + MQPUT
amqsmon0.c Get an statistics or accounting message
amqsprma.c Create a reference message
amqsptl0.c Put messages to a list of queues
amqspuba.c Publish messages to a topic {subscribed by amqssuba}
amqsput0.c MQPUT() sample - Put a message
amqsqrma.c Channel message exit program to process reference messages
amqsreq0.c Put request messages to a queue, and show the reply message (sent by amqsecha, maybe)
amqsseta.c (triggered program) - MQSET() sample
amqsspin.c SSPI Channel Exit routines (Security)
amqsstop.c Inquire on all the connections for a selected process and request them to be stopped
amqssuba.c Subscribe and get messages from a topic using a managed destination queue {published by amqspuba}
amqstrg0.c Trigger monitor - read an initiation queue, and start the program associated with trigger message  
amqstxgx.c Get transaction for Tuxedo
amqstxpx.c Put transaction for Tuxedo
amqstxsx.c Server for Tuxedo
amqsvfc0.c Skeleton of a Data Conversion exit
amqswlm0.c CLWL exit that chooses a destination QMgr
amqsxae0.c Sample Encina program
amqsxrma.c Channel message exit to process reference messages
amquregn.c Dump MQ values from Registry (NT)
amqzscgn.c CICS Global User Exit (GLUE) program for the CICS Task termination user exit (UE014015)
amqzscin.c XA switch program for CICS XA Initialisation

Amunt! Top Amunt!
MQ objects

MQ | .--- channel initiator [SYSTEM.CHANNEL.INITQ] (1) runmqchi (1) | .--- command server [SYSTEM.ADMIN.COMMAND.QUEUE] (2) dspmqcsv (2) | .--- trigger monitor [SYSTEM.DEFAULT.INITIATION.QUEUE] (3) runmqtrm(c) | .--- queue manager ------. | | | .--- queue | | | | | .--- local QL | | .--- remote QR | | .--- transmit QX | | .--- alias QA | | .--- model QM | | .--- dynamic QD | | .--- cluster QC | | .--- init QI | | | | | . | | | .--- message channels (uni-directional) | | | | | .--- sender SDR | | .--- receiver RCVR | | .--- server SVR | | .--- requester RQSTR | | .--- cluster sender CLUSSDR | | .--- cluster receiver CLUSRCVR | | | | | . | | | .--- MQI channel (bi-directional) | | | | | .--- server-connection SVRCONN | | .--- client-connection CLNTCONN | | | | | . | | | .--- process | | | | | . | | | .--- listener runmqlsr | | | | | .

(1) dis qstatus(SYSTEM.CHANNEL.INITQ) type(handle) all => runmqchi
(2) dis qstatus(SYSTEM.ADMIN.COMMAND.QUEUE) type(handle) all => amqpcsea
(3) dis qstatus(SYSTEM.DEFAULT.INITIATION.QUEUE) type(handle) all =>

Local queue details

Queue config

MSGDLVSQ(FIFO/PRIORITY) - messages are delivered in order, regardless of priority

Queue status

AMQ8450: Display queue status details. QUEUE(QL.IN) TYPE(QUEUE) CURDEPTH(0) IPPROCS(0) LGETDATE( ) LGETTIME( ) LPUTDATE( ) LPUTTIME( ) MEDIALOG( ) MONQ(OFF) MSGAGE( ) OPPROCS(0) QTIME( , ) UNCOM(NO) - how many uncommitted changes are pending (except zOS)
Remote queue

Use DEFINE QREMOTE to define a new local definition of a remote queue, a queue manager alias, or a reply-to queue alias, and to set its parameters.

Page 178, MQ v 6.0, "MQSC Command Reference", SC34-6597-00

The remote queue definition supplies the name of the destination queue, the destination queue manager, and optionally, a transmission queue.

"Using LDAP with WebSphere MQ", page 374, Application Programing Guide, MQ v 6.0, SC34-6595-01.

If an application opens the local definition of a remote queue, RQMNAME must not be blank or the name of the local queue manager. When the open occurs, if XMITQ is blank there must be a local queue of this name, which is to be used as the transmission queue.

Page 196, MQ v 6.0, "MQSC Command Reference", SC34-6597-00

When you use remote queue definitions to specify a transmission queue, your applications must not specify the location (that is, the destination queue manager) themselves. If they do, the queue manager will not make use of the remote queue definitions. Remote queue definitions make the location of queues and the transmission queue transparent to applications. Applications can put messages to a logical queue without knowing where the queue is located and you can alter the physical queue without having to change your applications.

Page 27/525196, MQ v 7, "Intercommunication", SC34-6931-00

Model and dynamic queues

A model queue is a template of a queue definition used only when you want to create a dynamic local queue. You can create a local queue dynamically from a MQ program, naming the model queue you wish to use as the template for the queue attributes. You may now, if you wish, change some attributes of the new queue. However, you cannot change the DefinitionType (see bellow).

MQ 5.3, "Application Programming Guide", SC34-6064-02, page 38 [60/643]

MQopen() + ObjDesc : If the ObjectName field in the ObjDesc parameter is the name of a model queue, a dynamic local queue is created with the attributes of the model queue.

MQ v 6.0, Application Programming Reference, SC34-6596-00, page 385 [409/665]


DEFTYPE : queue definition type (MQLONG) - indicates how the queue was defined

MQQDT_PREDEFINED The queue is a permanent queue created by the system administrator; only the system administrator can delete it. Predefined queues are created using the DEFINE MQSC command, and can be deleted only by using the DELETE MQSC command. Predefined queues cannot be created from model queues. MQQDT_PERMANENT_DYNAMIC - DEFTYPE(PERMDYN) The queue is a permanent queue that was created by an application issuing an MQOPEN call - object descriptor MQOD := name of a model queue ; The model queue definition had the value MQQDT_PERMANENT_DYNAMIC for the DefinitionType attribute. This type of queue can be deleted using the MQCLOSE call. The value of the QSGDisp attribute for a permanent dynamic queue is MQQSGD_Q_MGR. MQQDT_TEMPORARY_DYNAMIC - (NON-PERSISTENT MESSAGES ONLY) - DEFTYPE(TEMPDYN) The queue is a temporary queue that was created by an application issuing an MQOPEN call - object descriptor MQOD := name of a model queue ; The model queue definition had the value MQQDT_TEMPORARY_DYNAMIC for the DefinitionType attribute. This type of queue is deleted automatically by the MQCLOSE call when it is closed by the application that created it. The value of the QSGDisp attribute for a temporary dynamic queue is MQQSGD_Q_MGR.

Page 445, MQ v 6.0, "MQSC Command Reference", SC34-6597-00

Server Connection channel details
2 : display CHANNEL(CHNAME.USRGRP.SVRCONN) CHLTYPE(SVRCONN) all AMQ8414: Display Channel details. CHANNEL(CHNAME.USRGRP.SVRCONN) CHLTYPE(SVRCONN) ALTDATE(2012-09-16) ALTTIME(21.49.08) COMPHDR(NONE) COMPMSG(NONE) DESCR( ) HBINT(300) KAINT(AUTO) MAXINST(999999999) // max number of simultaneous instances of a server-connection channel that can be started MAXINSTC(999999999) // max number of simultaneous instances of a server-connection channel that can be started from a single client MAXMSGL(4194304) MCAUSER(usr_grp) MONCHL(QMGR) RCVDATA( ) RCVEXIT( ) SCYDATA( ) SCYEXIT( ) SENDDATA( ) SENDEXIT( ) SHARECNV(10) SSLCAUTH(REQUIRED) // number of threads per socket SSLCIPH( ) SSLPEER( ) TRPTYPE(TCP)

Mind MaxInstances - maximum number of simultaneous instances of an individual server-connection channel that can be started.

Also "MaxChannels=1000" in qm.ini

CHANNELS: MaxChannels=200 MaxActiveChannels=100

How can I display the actual value in use ?

MQClose() and related objects
Object other than a queue Retained Not valid Not valid
Predefined queue Retained Not valid Not valid
Permanent dynamic queue Retained Deleted if empty and no pending updates Messsages deleted; queue deleted if no pending updates
Temporary dynamic queue (call issued by creator of queue) Deleted Deleted Deleted
Temporary dynamic queue (call not issued by creator of queue) Retained Not valid Not valid
Distribution list Retained Not valid Not valid

MQ v 6.0, Application Programming Reference, SC34-6596-00, page 334 [359/665]

Amunt! Top Amunt!
Queue name resolution

Queue name resolution occurs at every queue manager each time a queue is opened. Its purpose is to identify the target queue, the target queue manager (which may be local), and the route to that queue manager (which may be null). The resolved name has three parts: the queue manager name, the queue name, and, if the queue manager is remote, the transmission queue.

When a remote queue definition exists, no alias definitions are referenced. The queue name supplied by the application is resolved to the name of the destination queue, the remote queue manager, and the transmission queue specified in the remote queue definition.

If there is no remote queue definition and a queue manager name is specified, or resolved by the name service, the queue manager looks to see if there is a queue manager alias definition that matches the supplied queue manager name. If there is, the information in it is used to resolve the queue manager name to the name of the destination queue manager. The queue manager alias definition can also be used to determine the transmission queue to the destination queue manager.

MQ v 7 Intercommunication [34/525]

You do not need to provide a remote queue definition to enable the replies to be returned to QM1. The message descriptor of the message retrieved from local queue PAYROLL contains both the reply-to queue and the reply-to queue manager names. Therefore, as long as QM2 can resolve the reply-to queue manager name to that of a transmission queue on queue manager QM2, the reply message can be sent. In this example, the reply-to queue manager name is QM1 and so queue manager QM2 simply requires a transmission queue of the same name.

MQ v 7 Intercommunication [290/525]

Queue name resolution is vital to DQM.

The sequence of events is as follows:

  1. The putting application issues MQOPEN and MQPUT calls to put messages to the target queue.
  2. During the MQOPEN call, the name resolution function detects that the target queue is not local, and decides which transmission queue is appropriate. Thereafter, on the MQPUT calls associated with the MQOPEN call, all messages are placed on this transmission queue.
  3. The sending MCA gets the messages from the transmission queue and passes them to the receiving MCA at the remote computer.
  4. The receiving MCA puts the messages on the target queue, or queues.
  5. The getting application issues MQOPEN and MQGET calls to get the messages from the target queue.

Chapter 7, MQ v 7 Intercommunication [499/525]

Name resolution
When you open a WebSphere MQ queue, the MQOPEN call performs a name resolution function on the queue name that you specify. This determines on which queue the queue manager performs subsequent operations. This means that when you specify the name of an alias queue or a remote queue in your object descriptor (MQOD), the call resolves the name either to a local queue or to a transmission queue.

MQ v6.0 Application Programming Guide, page 113/601.

.---. .---. .---. .---. |qm1|-->| 2 |-->| 3 |-->|qm4| .---. .---. .---. .---. Posar a QM1 un missatge amb destinacio QL4 a QM4. A QM1 cal una cua anomenada QM4 que apunti a QM2. A QM2 cal una cua anomenada QM4 que apunti a QM3. A QM3 cal una cua anomenada QM4 que apunti a QM4.
T400 QN resolution sample

Working directory = \\MQ\Eines\QM_resolution_sample

QMM1(2411) QMM2(2412) .-----------------------------. .-------------------------------. | | | | | QL.NAMERES.RESPOSTA | | | AMQSECH.exe | | QMM1.QMM2 | | | TxQ=QMM2 | ---------------> | QL.NAMERES.DESTINACIO | | | | | .-----------------------------. .-------------------------------. 1) conectar RFHUTIL a QMM1 i posar a la cua QL.NAMERES.RESPOSTA un missatge amb ReplyToQueue = QL.NAMERES.DESTINACIO i ReplyToQueueManager = QMM2 2) a QMM1, llençar RU.CMD, que incorpora AMQSECH amb parametre QL.NAMERES.RESPOSTA de QMM1 - compte amb el procés RSP - ha d'estar aturat 3) el missatge "resposta" apareix a la cua QL.NAMERES.DESTINACIO del gestor QMM2, sense definició de QREMOTE a QMM1.

En definitiva, al gestor QMM1 es fa un MQ_Put1() a la cua i gestor indicats al missatge. Evidentment, no existeixen a QMM1.

Fast QN resolution sample

\\MQ\Eines\AMQSPUT_modificat\$_ru_qnr.cmd - modificar parametre NOMCUAPOSAR !

c:\Sebas\mq\eines\AMQSPUT_modificat> ru.cmd run AMQSPUT modified program Params : (1) target queue name - MQ_OPEN() (2) queue manager name - MQ_CONN() (3) open options (4) close options (5) target queue manager name - MQ_OPEN() (6) dynamic queue name to be created if ObjectName specifies the name of a model queue (7) Reply To Queue (for COA) (8) Reply To Queue Manager ### MY PUT. Versio 20150220a - buffersize(4194304). Argument (0) = (MYPUT). Argument (1) = (QL.DESTI). Argument (2) = (QM_CNT). Argument (3) = (8208). Argument (4) = (0). Argument (5) = (QM_CNT2). Argument (6) = (-). Argument (7) = (QL.RESP). Argument (8) = (QM_CNT). >>> MQCONN start - QM name [QM_CNT]. +-+-+- MQCONN(). RC/CC [0x00/0x0000]. >>> MQOPEN start - QM name [QM_CNT2]. >>> Queue Name is [QL.DESTI]. >>> Queue Open options are [8208]. >>> Target queue for MQOPEN() is [QL.DESTI]. >>> Target queue manager is [QM_CNT2]. <<< aquest es el truc del almendruc !!! >>> Dynamic queue name is [-]. +-+-+- MQOPEN(). RC/CC [0x00/0x0000]. >>> gimme a message to send. NULL to end. >>> Lets send a Msg of [1156] bytes. >>> replyToQueue is [QL.RESP]. >>> replyToQueueMgr is [QM_CNT]. >>> MQPUT start - reply to QM name [QM_CNT]. >>> MQPUT start - reply to Q name [QL.RESP]. +-+-+- MQPUT(). RC/CC [0x00/0x0000]. >>> gimme a message to send. NULL to end. >>> Lets send a Msg of [0] bytes. >>> MQCLOSE(). Close options are [0]. >>> MQDISC(). ### MY PUT (AMQSPUT0 modified) end.

Els missatges apareixen al gestor CNT2 :

c:\Sebas\mq\cmds\cnt2> echo display ql (QL.DESTI) curdepth | runmqsc QM_CNT2 5724-H72 (C) Copyright IBM Corp. 1994, 2011. TODOS LOS DERECHOS RESERVADOS. Se está iniciando MQSC para el gestor de colas QM_CNT2. 1 : display ql (QL.DESTI) curdepth AMQ8409: Ver detalles de la cola. QUEUE(QL.DESTI) TYPE(QLOCAL) CURDEPTH(3) Se ha leído un mandato MQSC. Ningún mandato tiene un error de sintaxis. Se han procesado todos los mandatos MQSC válidos.

Aliasing Up

When a queue manager receives a message, it looks in the transmission header to see the name of the destination queue and queue manager. If it has a queue-manager alias definition with the same name as the queue manager referenced, it substitutes the RQMNAME from its definition for the queue manager name in the transmission header.

Clustering, page 40.

Types of ALIAS

There are three types of alias :

  1. queue-manager aliases,
  2. reply-to queue aliases,
  3. and queue aliases.

These apply in a clustered environment just as well as in a distributed-queuing environment.

Amunt! Top Amunt!
Queue-manager aliases

The concept of queue-manager aliasing is described in detail in the "MQ Intercommunication book", SC34-6587.

Queue-manager aliases, which are created using a remote-queue definition with a blank RNAME, have four uses:

  1. remapping the queue-manager name when sending messages
  2. altering or specifying the transmission queue when sending messages
  3. determining the destination when receiving messages
  4. using a queue manager as a gateway into the cluster.
Reply-to queue aliases

A reply-to queue alias definition is used to specify alternative names for reply information.

Queue aliases

A QALIAS definition is used to create an ALIAS by which a queue is to be known. You might do this if, for example, you want to start using a different queue but you do not want to change your applications. You might also do this if for some reason you do not want your applications to know the real name of the queue to which they are putting messages, or because you have a naming convention that differs from the one where the queue is defined. Another reason might be security; your applications might not be authorized to access the queue by its real name but only by its alias.

MQ v 6.0, "Queue Manager Clusters", page 42 to 44 [60/201].

Few intersting things about Alias queues :

  • you can't MQInq() its depth !
  • you can't RUNMQSC for CURDEPTH !!
  • you can't Mirror it !
Attributes for queues


Amunt! Top Amunt!
Microsoft Cluster

System Admin Guide, chapter 13 - Supporting MSCS

Amunt! Top Amunt!

Dead Letter Queue must exist if you dont want to have problems with the channels and/or the messages.

You can define it to the qmgr by using the DEADQ attribute on the ALTER QMGR command (see sample bellow), if you did not do it when qmgr was created.

DLQ must be persistent (DEFPSIST(YES)) and put-enabled !

DLQ monitor : MS71 !

If a message arrives at a queue manager but there is no queue there to receive it, the message is put on the dead-letter queue as usual. If there is no dead-letter queue, the channel fails and retries, as described in the MQ Intercommunication book.

"Clustering", v 5.3, SC34-6061-02, page 8.

Again : For example, if an application tries to put a message on a queue on another queue manager, but gives the wrong queue name, the channel is stopped and the message remains on the transmission queue. Other applications cannot then use this channel for their messages.

System Administration Guide, v 5.3, SC34-6068-02, page 26.

Again : If you do not, and the MCA is unable to put a message, it is left on the transmission queue and the channel is stopped.

Intercommunication, v 5.3, SC34-6059-02, page 13.

Again : If all the retries are unsuccessful, the message is written to the dead-letter queue. If there is no dead-letter queue available, the channel stops.

MQ v6 Intercommunication, SC34-6587, page 429 [451/573].

Amunt! Top Amunt!
How to WRITE into DLQ

Method #1 :

Define a remote queue pointing to an existing queue manager, but refering to a non-existing remote queue.

Find the message in the remote queue manager's DLQ.

Similar but faster : wrong "target" qmgr name for "open()"


Method #2 :

put a message into a XMIT queue, and get RC = d'0271 = MQFB_XMIT_Q_MSG_ERROR
Feedback indicating that a message channel agent has found that a message on the transmission queue is not in the correct format. The message channel agent puts the message on the dead-letter queue using this feedback code.

Requires a Running channel !

Find the message in the local queue manager's DLQ.

Method #3 :

Define a cluster of 3 queue managers : TQM1, TQM2 and TQM3.
TQM1 and TQM2 share the queue WLMQ1 on the cluster. This is, TQM3 sees two "cluster" queues.
On TQM3, define an ALIAS for WLMQ1, named WLMAQ.
If an application writes - connecting to TQM3 - into WLMAQ, then the messages are split between WLMQ1 on both TQM1 and TQM2.

Now, define a queue manager external to the cluster, named TQM4.
Define a REMOTE QUEUE on it, called RMQ99, pointing to WLMAQ on TQM3. And a CHANNEL also ... and activate it !
If an application sends a message connecting to TQM4 and using this Remote Queue RMQ99, it is placed in the TQM3's Dead Letter Queue with Reason Code d'2082 = MQRC_UNKNOWN_ALIAS_BASE_Q - Read about Dead-Letter Header.

Method #4 :

Attempt to receive a persistent message on a temporary dynamic queue. The message will fail and be routed to the DLQ with reason code: wrong persistence attribute.

Method #5 :

Send a message to Command Server, but not a Request Type :
md.MsgType = MQMT_REQUEST ; \\MQ\Eines\PCF_Inquiry_qmgr_Queues\codi.c

Method #6 :

Write to a cluster queue. Messages are always accepted. If a queue gets filled up, messages go to DLQ, Reason d'2053, x'0805

Method #7 :

Compile AMQSECHA using GCC or CL (v12) compiler. Set it into a triggered process using APPLICID. As RUNMQTRM wont be able to start the EXE, then the trigger message shall go to DLQ, and DLQH indicates
How to READ from DLQ
DLQ definition
DEFINE QLOCAL ('QL.DLQ') + DESCR('Dead Letter Queue.') + PUT(ENABLED) + GET(ENABLED) + DEFPSIST(YES) + // message persistence to be used when applications specify the MQPER_PERSISTENCE_AS_Q_DEF option SCOPE(QMGR) + MAXDEPTH(50000) + // 999.999.999 MAXMSGL(104857600) + // 4194304 REPLACE alter qmgr DEADQ('QL.DLQ')
DLQ structure (from CMQC.H)
typedef struct tagMQDLH MQDLH ; typedef MQDLH MQPOINTER PMQDLH ; struct tagMQDLH { MQCHAR4 StrucId ; /* Structure identifier */ MQLONG Version ; /* Structure version number */ MQLONG Reason ; /* Reason message arrived on dead-letter (undelivered-message) queue */ MQCHAR48 DestQName ; /* Name of original destination queue */ MQCHAR48 DestQMgrName ; /* Name of original destination queue manager */ MQLONG Encoding ; /* Numeric encoding of data that follows MQDLH */ MQLONG CodedCharSetId ; /* Character set identifier of data that follows MQDLH */ MQCHAR8 Format ; /* Format name of data that follows MQDLH */ MQLONG PutApplType ; /* Type of application that put message on dead-letter (undelivered-message) queue */ MQCHAR28 PutApplName ; /* Name of application that put message on dead-letter (undelivered-message) queue */ MQCHAR8 PutDate ; /* Date when message was put on dead-letter (undelivered-message) queue */ MQCHAR8 PutTime ; /* Time when message was put on the dead-letter (undelivered-message) queue */ };

El camp Reason ens diu el motiu per el que s'ha posat el missatge a la DLQ. Ha de ser del tipus MQFB_* o bé MQRC_* : mirar cmqc.h

En podriem fer una llista MQRC de msg a DLQ ?

Que fem si el MB posa un msg a la DLQ amb Dead Letter Header i amb Reason = MQFB_APPL_FIRST ? Mirar Event Log per problemes de Broker !

DLQ reason field
# Explorer + browse + data : #define MQFB_QUIT 256 - // means "see MB log" ! #define MQFB_APPL_CANNOT_BE_STARTED 265 - #define MQRC_PUT_INHIBITED 2051 - #define MQRC_Q_FULL 2053 - #define MQRC_UNKNOWN_ALIAS_BASE_Q 2082 - #define MQRC_CLUSTER_RESOLUTION_ERROR 2189 -
DLQ handler

MQ v 6.0 System Admin Guide, chapter 12 : the MQ DLQ handler

Hubert : if you want to move all messages, specify a rule file (let's say rules.dlq) which contains the following lines

inputqm(' ') inputq(' ') wait (no) action(fwd) fwdq(Q1) header(no)

Then run the following command (Unix sample)

runmqdlq < rules.dlq

Using DLQ handler, developerWorks

Distribution Lists

Sending messages to a distribution list
In MQ on all platforms except z/OS, an application can send a message to several destinations with a single MQPUT call. This applies in both a distributed-queuing environment and a clustering environment. You have to define the destinations in a distribution list, as described in the MQ Application Programming Guide.

Headers Up


Is where JMS properties are held.

Message format MQRFH2 should be used to read and write JMS messages.

The MQRFH2 header is used to pass messages to and from a message broker belonging to WebSphere Message Broker. In a message, the MQRFH2 header follows the MQ message descriptor (MQMD) and precedes the message body, if present.

Publish/subscribe, page 66 [74/114]

The MQRFH2 header contains information about the structure of a message, and its intended consumers, to enable a message broker to process the message and deliver or publish the message to those consumers.

The value 'MQRFH2 ' should be put in the Format field of the preceding header (usually the MQMD).

Publish/subscribe, page 67 [75/114]

struct tagMQRFH2 { MQCHAR4 StrucId; /* Structure identifier */ MQLONG Version; /* Structure version number */ MQLONG StrucLength; /* Total length of MQRFH2 including all NameValueLength and NameValueData fields */ MQLONG Encoding; /* Numeric encoding of data that follows last NameValueData field */ MQLONG CodedCharSetId; /* Character set identifier of data that follows last NameValueData field */ MQCHAR8 Format; /* Format name of data that follows last NameValueData field */ MQLONG Flags; /* Flags */ MQLONG NameValueCCSID; /* Character set identifier of NameValueData */ };

The following two fields are optional, but if present they must occur as a pair. They can be repeated as a pair as many times as required.

NameValueLength This field specifies the length, in bytes, of the NameValueData field that follows this field. NameValueData This is a variable-length character string containing data that is encoded using an XML-like structure.

Sample :

00000 52 46 48 20 02 00 00 00--24 00 00 00 22 02 00 00 |RFH ....$..."...| 00010 B5 01 00 00 4D 51 53 54--52 20 20 20 00 00 00 00 |¹...MQSTR ....| 00020 B8 04 00 00 31 32 33 34-- |»...1234 | 00000 52 46 48 20 02 00 00 00--98 00 00 00 22 02 00 00 |RFH ........"...| 00010 B5 01 00 00 4D 51 53 54--52 20 20 20 00 00 00 00 |¹...MQSTR ....| 00020 B8 04 00 00 20 00 00 00--3C 6D 63 64 3E 3C 4D 73 |»... ...<mcd><Ms| 00030 64 3E 6A 6D 73 5F 74 65--78 74 3C 2F 4D 73 64 3E |d>jms_text</Msd>| 00040 3C 2F 6D 63 64 3E 20 20--2C 00 00 00 3C 6A 6D 73 |</mcd> ,...<jms| 00050 3E 3C 75 6E 6F 3E 76 75--6E 6F 3C 2F 75 6E 6F 3E |><uno>vuno</uno>| 00060 3C 64 6F 73 3E 76 64 6F--73 3C 2F 64 6F 73 3E 3C |<dos>vdos</dos><| 00070 2F 6A 6D 73 3E 20 20 20--1C 00 00 00 3C 75 73 72 |/jms> <...<usr| 00080 3E 3C 75 70 31 3E 75 70--31 76 61 6C 3C 2F 75 70 |><up1>up1val</up| 00090 31 3E 3C 2F 75 73 72 3E--62 6F 64 79 62 6F 64 79 |1></usr>bodybody|

0x01B5 = 437. 0x04B8 = 1208.

****Message descriptor**** StrucId : 'MD ' Version : 2 Report : 0 MsgType : 8 Expiry : -1 Feedback : 0 Encoding : 546 CodedCharSetId : 437 Format : 'MQHRF2 ' Priority : 0 Persistence : 0 MsgId : X'414D5120514D5820202020202020202049F830F420003B02' CorrelId : X'000000000000000000000000000000000000000000000000' BackoutCount : 0 ReplyToQ : ' ' ReplyToQMgr : 'QMX ' ** Identity Context UserIdentifier : 'mqm ' AccountingToken : X'16010515000000AA0C49B28692DB65B26D507AF401000000000000000000000B' ApplIdentityData : ' ' ** Origin Context PutApplType : '11' PutApplName : 'C:\sebas\Eines\rfhutilc.exe' PutDate : '20090504' PutTime : '11153824' ApplOriginData : ' ' GroupId : X'000000000000000000000000000000000000000000000000' MsgSeqNumber : '1' Offset : '0' MsgFlags : '0' OriginalLength : '-1' **** Message **** length - 78 bytes 00000000: 5246 4820 0200 0000 4400 0000 2202 0000 'RFH ....D..."...' 00000010: B501 0000 4D51 5246 4832 2020 0000 0000 'µ...MQRFH2 ....' 00000020: B804 0000 0C00 0000 3C6D 6364 3E3C 2F6D '¸.......<mcd></m' 00000030: 6364 3E20 0C00 0000 3C6A 6D73 3E3C 2F6A 'cd> ....<jms></j' 00000040: 6D73 3E20 3132 3334 3536 3738 3930 'ms> 1234567890 '

Message service folders

The following folder names are defined for use by WebSphere MQ products:

  • <mcd> Message content descriptor
  • <Msd> Message Domain
  • <usr> Application (user) defined properties
  • <psc> Publish/subscribe command
  • <pscr> Publish/subscribe command response

Each folder is contained in a separate NameValueData field, each of which is preceded by a NameValueLength field.

Publish/subscribe, page 70 [78/114]

How to write a msg with RFH2

  • jsmqput.c {\\CPP\MQI\IBM\JMS_Qput\ & \\MQ\Eines\RFH2\ & \\MQ\Codi\Samples IBM\}
  • \\CPP\MQI\Internet\CapitalWare\www.capitalware.biz\dl\code\c\rfh2put\ RFH2PUT.C (no acabat) - library
  • IA94: IBM Message Service Client for C/C++
  • MA0T : MsgTest is a command line based program that provides the ability to execute scripts that simulate the flow of messages between applications that use MQ.
    url, PDF, PDF
Message properties

There is a type of application that it needs to add information to a message, This information is used by some applications during the lifetime of the message but ignored by other applications. Examples might be routing information, accounting and billing information and a whole range of metadata not directly concerned with the message payload. Many vendor products might want to "enrich" messages in this way.

In V7 applications can add properties to messages using new MQI calls. A property is a named piece of data. It is not treated as part of the message payload. The properties are accessed by means of a message handle passed to MQPUTs and MQGETs in the MQPMO and MQGMO. Applications will only be aware of this information if they choose to access it.

In V6 MQRFH2 headers are used to store MQ JMS properties. Since v7, we dont use MQRFH2 but Message Properties.

The message properties are a set of name, value pairs. The name-space for the property names is made hierarchical by splitting the name into components separated by dots.

API summary
  • MQCRTMH creates a message handle
  • MQDLTMH destroys a message handle
  • MQINQMP inquires a property from a message handle - can iterate over properties
  • MQSETMP sets a property in a message handle - can set application or MQ defined properties
  • MQDLTMP deletes a message property from a handle


Header scanner tool

Let's build a program that

  1. dumps the whole message in Hex (and Ascii besides)
  2. scans the different headers the message has and dumps them

A MQ message consists of control information and application data.
The control information is defined in a message descriptor structure (MQMD) and contains such things as (*) the type of the message (*) an identifier for the message (*) the priority for delivery of the message
The structure and content of the application data is determined by the participating programs, not by MQ.

MQ v7 App Prog Guide, 34/615.

You can recognize the WebSphere MQ headers by looking at the successive Format names, starting with the MQMD and continuing through any headers present. The following Format names indicate these WebSphere MQ headers:

  • MQDLH - dead-letter header
  • MQXQH - transmission header
  • MQH*
  • MQRMH - refefrence message header
  • MQRFH2 -

The MQ message structure is :

PUT & destination Up

Putting from a queue manager outside a cluster

Let us consider how the queue manager QM3, that is outside the cluster, can put a message to the queue Q2 at QM2, which is inside the cluster, thru QM1 that is inside the cluster and acts as a Gateway.

The queue manager outside the cluster, QM3, must have a QREMOTE definition for each queue in the cluster that it wants to put messages to. For example:


Because QM3 is not part of a cluster, it must communicate using distributed queuing techniques. Therefore, it must also have a sender channel and a transmission queue to QM1.

When an application at QM3 issues an MQPUT call to put a message to Q2, the QREMOTE definition causes the message to be routed through the gateway queue manager QM1.

Putting from a queue manager outside the cluster - alternative

There is another way of putting from a queue manager outside a cluster. On the gateway queue manager define a queue-manager alias called, for example, ANY.CLUSTER:


This maps any response to the queue manager ANY.CLUSTER to null, which means the QREMOTE definition in the queue manager outside the cluster can use the queue manager name ANY.CLUSTER instead of having to use the exact queue manager name. Therefore, on the queue manager outside the cluster, the definition:


would cause messages to go to QM1 initially, and from there to be routed to any queue manager in the cluster that hosts the cluster queue Q2.

MQ v 5.3, Clustering, SC34-6061-02, page 42 [58/183]

Lets test it in a cluster environment

Conversion Up


El MQ_Get pot fer conversió de codis de caracters si

  • s'especifica "convert"
  • el format del missatge es MQ_String

Compte amb el entorn z/OS vs Unicode ...

Message consisting entirely of characters. The application message data can be either an SBCS string (single-byte character set), or a DBCS string (double-byte character set). Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call.

"Application Programming Reference", MQ v 6.0, SC34-6596-00, page 163 [187/665]

If you include the MQGMO_CONVERT option in the GetMsgOpts parameter, the application message data is converted to the representation requested by the receiving application, before the data is placed in the Buffer parameter:

The Format field in the control information in the message identifies the structure of the application data, and the CodedCharSetId and Encoding fields in the control information in the message specify its character-set identifier and encoding.

The application issuing the MQGET call specifies in the CodedCharSetId and Encoding fields in the MsgDesc parameter the character-set identifier and encoding to which to convert the application message data. When conversion of the message data is necessary, the conversion is performed either by the queue manager itself or by a user-written exit, depending on the value of the Format field in the control information in the message.

"Application Programming Reference", MQ v 6.0, SC34-6596-00, page 368 [392/665]


"System Admin Guide", MQ v 6.0, SC34-6584-01, page 79 [101/647]

852 1208 1236 1208 437 1208

Application data conversion
When necessary, MCAs convert the message descriptor and header data into the required character set and encoding. Either end of the link (that is, the local MCA or the remote MCA) can do the conversion.

When you move messages between systems, you sometimes need to convert the application data into the character set and encoding required by the receiving system. This can be done either from within application programs on the receiving system or by the MCAs on the sending system.

"Application Programming Guide", MQ v 6.0, page 140 [160/601]

However, if the final destination is a platform that does not support data conversion on the MQGET, you must specify CONVERT(YES) on the sender channel that sends the data to its final destination.

"Application Programming Guide", MQ v 6.0, page 149 [169/601]

MCA max speed = 35 M Bytes / sec = 280 M bits / sec ;

What if we have 1 GB LAN o 100 GB ?

  • Paralel (cluster) channels. Design the MQ applications to leverage multiple MQ Channels to move the data / messages.
  • Increase the TCP/IP Window size to 64KB
  • On Open System, increase the Queue Buffer size using the Tuning parameter overrides in the qm.ini

Dynamic length receive Up

If we want to know the received (still enqueued) message length (to allocate the exact amount of memory) before effectively receiving it ....

  1. set BufLen to zero
  4. use DataLength (output)
  5. this allows the application to determine the size of the buffer required to accommodate the message data, and then reissue the call with a buffer of the appropriate size.

"Application Programming Reference", MQ v 5.3, SC34-6062-02, page 377 [403/781]


Default Queue Manager Up

To know the name of the Default Queue Manager ...

  • guindows :

If I set queue manager name to "" or null when connecting, I get a connection to whatever is set as default manager. Once I connected: is there a way to find what manager I am connected to?

Use amqscnxc.c !

Start runmqsc - it is displayed on first line ! (only if it is in "Running" state ...)

Hint : it is required for remote admin

Command Server Up

Listening on SYSTEM.ADMIN.COMMAND.QUEUE for PCF messages, there's a Command Server.
Where does it send its answers ?
The command server servicing this queue sends the replies to the queue defined by the ReplyToQ and ReplyToQMgr fields in the message descriptor of the command message.

PCF and Admin Interface, SC34-6598-00, page 35/725.

Command Server. The MQ component that reads commands from the system-command input queue, verifies them, and passes valid commands to the command processor.

MQ 5.3 Bibliography and Glossary, SC34-6113-02, page 26

Commands to manage it are STRMQCSV / ENDMQCSV / DSPMQCSV. Under normal circumstances, the Display command shows :

MQ Comand Server Status ... : Running

The process doing so is AMQPCSEA.EXE

One per Node ?

Commands :

  • pPCFHeader->Command = MQCMD_INQUIRE_Q ; // SC34-6598-00, 526/725
Namelists Up

A namelist is a MQ object that contains a list of other MQ objects. Typically, namelists are used by applications such as trigger monitors, where they are used to identify a group of queues. The advantage of using a namelist is that it is maintained independently of applications; that is, it can be updated without stopping any of the applications that use it. Also, if one application fails, the namelist is not affected and other applications can continue using it.
Namelists are also used with queue manager clusters so that you can maintain a list of clusters referenced by more than one MQ object.

iSeries System Administration Guide WebSphere MQ for iSeries Version 6.0 SC34-6586-00

A namelist is a MQ object that contains a list of cluster names, queue names or AUTHINFO object names. In a cluster, it can be used to identify a list of clusters for which the queue manager holds the repositories. Programs can use the MQI to find out which queues are included in these namelists. The organization of the namelists is the responsibility of the application designer and system administrator.

"Application Programming Guide" WebSphere MQ 5.3 SC34-6064-02, page 44 [66/643]

Overlapping clusters :

"Queue Manager Clusters" WebSphere MQ 6.0, SC34-6598-00, page 105 [123/201]

A namelist is used to define a list of names that all apply to an object. For example, to specify that a qmgr belongs to more than one cluster add the cluster names to a namelist and put the namelist in the CLUSNL attribute of the qmgr.

The only thing you can do to a namelist is open it to do an MQINQ call to get a list of all the names on there.

Backout Up

BackOut count & Max - they go on a msg or on a queue ?
The limit seems to be on the queue and the actual count on the message ...

Can the backout queue be Remote ? Alias ? No : only local or model.

No : you can code it, but get an error on run time : can not move the message to the backout queue.

Como provocar un BackOut ? backout.c !

MD.BackoutCount (MQLONG)
Backout counter. This is a count of the number of times the message has been previously returned by the MQGET call as part of a unit of work, and subsequently backed out. It is provided as an aid to the application in detecting processing errors that are based on message content.

The excessive backout requeue name. This parameter is supported only on local and model queues. Apart from maintaining a value for this parameter, the queue manager takes no action based on its value.
BOTHRESH(integer) The backout threshold. This parameter is supported only on local and model queues. Apart from maintaining a value for this parameter, the queue manager takes no action based on its value.


  • System Administration Guide ... Chapter 11 (Transactional Support)
  • Application Programming Guide ... Chapter 13 (Committing and backing out units of work).

To help handle units of work, MQ provides the BackoutCount attribute. This is incremented each time a message, within a unit of work, is backed out. If the message repeatedly causes the unit of work to abend, the value of the BackoutCount finally exceeds that of the BackoutThreshold. This value is set when the queue is defined. In this situation, the application can choose to remove the message from the unit of work and put it onto another queue, as defined in BackoutRequeueQName.

MQ v 5.3, "Application Programming Guide" SC34-6064-02, page 176 [198/643].

The BOTHRESH and BOQNAME are used by your application so that it can move a message that has been backed out BOTHRESH times to another queue. Not having the BOQNAME shouldn't have any effect on this.

A well-behaved application will check the backout count on every message read, and if it is non-zero, compare it to the backout threshold defined on the queue. If the count is greater than the threshold, the message should be written to the queue specified in the BOQNAME parameter and committed. Often a Dead Letter Header (MQDLH) is attached to the message to indicate why the message was written to the backout queue.


  1. Use one backout queue per application, not per queue. One backout queue can be used for multiple request queues.
  2. Do not use the queue-manager-defined dead letter queue as the backout queue, because the contents of the backout queue are usually driven by the application. The dead letter queue should be the backout queue of last resort.
  3. Do not make the backout queue a shared queue, because backout queues are usually processed in a batch, and therefore any queue depth build-up on these queues may impact other applications using the same CF structure. Therefore, if you are defining a backout queue for a shared queue, you need an instance of the backout queue on every queue manager in the QSG that can host the server application.
  4. If a DLH is applied to backout messages, use one of the many dead letter queue handlers to determine if a message should be restored to the original queue. Many customers use the standard handler, or tailor it to meet the needs of the application.

From developerWorks

Amunt! Top Amunt!
Channel types

A channel is a communication link used by distributed queue managers. MCA max speed = 35 MB/sec.

Do not confuse message channels with MQI channels. There are two categories of channel in MQ:

MQ 6.0, "Application Programming Guide", SC34-6595-01, page 45 [65/601]

The definition of each end of a message channel can be one of the following types:

A message channel is defined using one of these types defined at one end, and a compatible type at the other end. Possible combinations are:

MQ v 6.0, "Intercommunication", SC34-6587, page 8 [30/573].

Server / Requester use

Supose we have this environment, where firewall prevents QM2 to start a normal Sender-Receiver channel from QM2.TO.QM1, but not TCP connections from QM1 to QM2.

.-----. .---. .-----. | | | | | | | QM1 | <===== | F | <======= | QM2 | | | | | | | .-----. .---. .-----.

We shall use a SERVER channel at QM2 and a REQUESTER channel at QM1. In this way, the data can flow from QM2 to QM1, and the channel is started from QM1.


A server connection channel object defines the name of a channel that a client can use to connect to a queue manager and the attributes of the MCA that hosts that connection.


This is different to all other channel types, because it is never used by the queue manager itself. Instead, an entry is added to a client channel definition table (CCDT) file, which can be distributed to other machines and used by client applications to configure their MCAs.

How to start

A channel can be caused to start transmitting messages in one of four ways. It can be:

In Windows systems, start a listener as a background process at the receiver end of each channel.

Then start the channels, again as background processes:

System Administration, page 63 [87 of 567]


If you want the first message put in the queue DESA4 to start the associated transmit channel DESA3.DESA4, then define the queue this way :

def ql(DESA4) usage(xmitq) maxmsgl(104857600) + trigger TRIGTYPE(EVERY) TRIGDPTH(1) + trigdata(DESA3.DESA4) + /* channel name */ initq(SYSTEM.CHANNEL.INITQ) replace /* mandatory */

The TrigData attribute must contain the name of the channel to be triggered.
The InitQ must be exactly SYSTEM.CHANNEL.INITQ

Application Programming, page 197 [219 of 643]

Transmission queue definition (for channel "QM2.QM1")


When the first message is put on this transmission queue, a trigger message is sent to the initiation queue, SYSTEM.CHANNEL.INITQ. The channel initiator gets the message from the initiation queue and starts the channel identified in the trigger data (QM2.TO.QM1). The channel initiator can only get trigger messages from SYSTEM.CHANNEL.INITQ so you should not use any other queue as the initiation queue.

Intercommunication, page 424 [448 of 815]

Message context

1 - Identity context
Identity context information identifies the user of the application that first put the message on a queue:
The queue manager fills the UserIdentifier field with a name that identifies the user. The way that the queue manager can do this depends on the environment in which the application is running.
The queue manager fills the AccountingToken field with a token or number that it determined from the application that put the message. Applications can use the ApplIdentityData field for any extra information that they want to include about the user (for example, an encrypted password).

2 - Origin context
Origin context information describes the application that put the message on the queue on which the message is currently stored. The message descriptor contains the following fields for origin context information:

  • PutApplType
    The type of application that put the message (for example, a CICS transaction).
  • PutApplName
    The name of the application that put the message (for example, the name of a job or transaction).
  • PutDate
    The date on which the message was put on the queue.
  • PutTime
    The time at which the message was put on the queue.
  • ApplOriginData
    Any extra information that an application may want to include about the origin of the message. For example, it could be set by suitably authorized applications to indicate whether the identity data is trusted.

Application Programming, page 32 [55 of 643]

How to send a 500MB file using MQ ?

Try using message segmentation. That will allow MQ to split the message up into segments (allowing a file bigger than the max message length to be successfully transmitted). Make sure that the program receiving the file either reads the segments (using MQGMO_LOGICAL_ORDER) and reassembles the file itself, or ask MQ to do it (using MQGMO_COMPLETE_MSG). Segmentation sample, both JMS and J2EE.

Increase max msg size at :


  • DCOMCNFG has to have the MUSR_MQADMIN user (and password).
    MyPC + DCOM config + MQSeries Services + Properties + Identity.
  • Windows Service has to be started using MUSR_MQADMIN, or Local Account.

WMI counters Up

MQ counters use Windows Management Instrumentation ...

... that are displayed thru ASP pages ...

... that require PWS = Personal Web Server (W98) / IIS (W2K & WXP)

See [\03x\{isb}\mqmon.asp] !

Com saber quants missatges han passat per un canal ? Per una cua ?

Event monitor

Time To Live Up

In MQ the parameter is "EXPIRY" and it is located in MQMD, the Message Descriptor used on every MQPUT().
It is measured in "tenths of a second", while TTL in TCP/IP I think is a number of "hops", isn't it ?

See page 148 of "SC34-6062-02", Application Programming Reference for MQ version 5.3

If a message does expire, does it go to DLQ or is it removed from MQ without a trace ? Detail

Expired messages - Messages that have expired are discarded by the next appropriate MQGET call. However, if no such call occurs, the expired messages are not discarded, and, for some queues, particularly those where message retrieval is done by MessageId, CorrelId, or GroupId and the queue is indexed for performance, a large number of expired messages can accumulate. The queue manager can periodically scan any queue for expired messages, which are then deleted.

MQ v 6.0 for z/OS, Concepts and Planning Guide, GC34-6582-00, page 45, 61/207

mq.net :
Expiry is documented in substantial detail in SC34-6596-00 MQ v 6.0 Application Programming Reference, Chapter 12, page 152. Included is behavior in both midrange and z/OS.

mq.net :
Expired messages are never available for GETting. In v6 on most platforms, they are removed by a background cleanup process. In v5.3, they are removed by a background cleanup process in some CSDs on most platforms, and in most or all CSDs on zOS.

CMD to create a complete Qmgr Up

CreateCompleteQmgr.bat By Emir - Simple (with LISTENER)

rem @echo off if .%1. == .. goto ajuda @echo Aturar el QManager (%1) amqmdain end %1 @echo Esborrar el QManager (%1) dltmqm %1 @echo Creacio QManager (LC = Log Circular, LF = Log File size * 4KB) crtmqm -lc -lf 2560 -u %1.dlq DEFPSIST(YES) %3 %4 %5 %1 @echo Creacio listener ; v 6.0 "Listener creation no longer supported" amqmdain crtlsr %1 -t tcp -p %2 @echo Engegar Manager i serveis associats amqmdain start %1 pause @echo Creacio listener v 6.0 @echo define listener(nom) trptype(TCP) port(%2) control(QMGR) replace | runmqsc %1 @echo Crear dead letter queue @echo def ql(%1.dlq) replace | runmqsc %1 @echo Crear Xmit queue @echo def ql(OFACQM) usage(XMITQ) replace | runmqsc %1 @echo Crear Rcv queue @echo def ql(PRIME_IN_QUEUE) replace | runmqsc %1 @echo Crear Remote queue @echo def qr(GLOBUS_IN_QUEUE) rname(GLOBUS_IN_QUEUE) rqmname(OFACQM) \ xmitq(OFACQM) replace | runmqsc %1 @echo Crear Sender channel @echo define channel(CH_NAME) chltype(SDR) trptype(TCP) \ XMITQ(XQN) conname('<ip>(<port>)') replace | runmqsc %1 @echo Crear Requester/Receiver channel @echo define channel(SUN_TO_NT) chltype(RQSTR) trptype(TCP) \ conname('') replace | runmqsc %1 goto final :ajuda echo Primer parametre = nom de QManager echo Segon parametre = numero de Port :final
Amunt! Top Amunt!
Script sample(s)

* Dead Letter Queue must always be present. DEFINE QLOCAL(QL.DLQ) + DEFPSIST(YES) + MAXDEPTH(5000) + MAXMSGL(104857600) + replace alter qmgr DEADQ('QL.DLQ') * Listener sample : starts and stops with queue manager. DEFINE LISTENER ('mq_listener') + TRPTYPE(TCP) + PORT(1415) + CONTROL(QMGR) + REPLACE START LISTENER ('mq_listener') * Define channel for Remote Admin. DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) DEFINE QMODEL ('SYSTEM.MQEXPLORER.REPLY.MODEL') * Alter System Objects for 100 MB messages. ALTER QLOCAL('SYSTEM.DEFAULT.LOCAL.QUEUE') MAXMSGL(104857600) ALTER CHANNEL ('SYSTEM.DEF.RECEIVER') CHLTYPE(RCVR) MAXMSGL(104857600) ALTER CHANNEL ('SYSTEM.DEF.SENDER') CHLTYPE(SDR) MAXMSGL(104857600) * Alter System Object for Client Access rights. ALTER CHANNEL ('SYSTEM.DEF.SVRCONN') + CHLTYPE(SVRCONN) + MCAUSER('mqm_cli_user') * Define a queue and a pointer to it, to be used by applications DEFINE QL('QL1') USAGE(NORMAL) REPLACE DEFINE QALIAS('QUSER.TT.IN') TARGQ('QL1') REPLACE

Amunt! Top Amunt!
Special commands
  • display who has "open'd" a queue
    dis qstatus(QUEUE.NAME) type(handle) all

  • display how many connections do we have right now (svrconn channel)
    echo "DISPLAY CHSTATUS(MY.SVRCONN)" | runmqsc MY_QM | grep -c "CHLTYPE(SVRCONN)"

System objects Up

SYSTEM.ADMIN.COMMAND.QUEUE (qu) Command Server queue
SYSTEM.ADMIN.SVRCONN (ch) Server-connection channel
SYSTEM.CHANNEL.INITQ (ch) Channel initiator

It is very useful to have this configuration :


Advantatges ?

Unless you set the AMQCHLTAB and AMQCHLLIB variables and export the channel table file to the client-based machine, CLNTCONN will not be used.

Processes Up
amqmtbn - alert monitor (taskbar) - net stop "IBM MQSeries" amqhasmn.exe - the logger amqmsrvn.exe - COM server amqmtbrn.exe - alert monitor (task bar icon) amqpcsea.exe - command server amqrmppa.exe - channel pooling process amqrrmfa.exe - repository process (for clusters) amqsvc.exe - . amqxssvn.exe - shared memory server(s) amqzdmaa.exe - deferred message processor amqzfuma.exe - OAM process - rc = 2035 amqzlaa0.exe - queue manager agents (LQM agents) amqzllp0.exe - checkpoint processor amqzxma0.exe - processing controller, execution controller {kill qmgr in fact} - process id "1" runmqchi.exe - channel initiator runmqlsr.exe - listener

Read An Introduction to WebSphere MQ queue manager processes (mq v6)

Description of MQ tasks :
When a queue manager is running, you see some or all of the following batch jobs running under the QMQM user profile in the MQ subsystem.

Job name Function AMQALMPX The checkpoint processor that periodically takes journal checkpoints. AMQCLMAA Non-threaded TCP/IP listener. {RUNMQLSR is non-threaded} AMQCRSTA TCP/IP-invoked channel responder. AMQCRS6B LU62 receiver channel and client connection (see note). AMQFCXBA Broker worker job. AMQPCSEA PCF command processor. Handles PCF and remote administration requests. AMQRMPPA Channel process pooling job. AMQRRMFA Repository manager for clusters. AMQZDMAA Deferred message handler. AMQZFUMA Object authority manager (OAM). AMQZLAA0 Queue manager agents that perform the bulk of the work for applications that connect to queue manager using MQCNO_STANDARD_BINDING. AMQZLAS0 Queue manager agent. AMQZXMA0 The execution controller is the first job started by the queue manager. Deals with MQCONN requests. Starts agent processes to process MQ API calls. AMQZMGR0 Process controller. Used to start up and manage listeners and services. AMQZMUC0 Utility manager. Do critical utilities, as the journal chain manager. Critical processes transaction logging. AMQZMUR0 Utility manager. Do critical utilities, as the journal chain manager. Restartable processes transaction logging. RUNMQBRK Broker control job. RUNMQCHI The channel initiator. RUNMQCHL Sender channel job that is started for each sender channel. RUNMQDLQ Dead letter queue handler. RUNMQLSR Threaded TCP/IP listener. {AMQCLMAA is non-threaded} RUNMQTRM Trigger monitor.

"Description of MQ tasks", iSeries : System Admin Guide, url

End the processes in the following order:

amqzmuc0 Critical process manager amqzxma0 execution controller amqzfuma OAM process amqzlaa0 LQM agents amqzlsa0 LQM agents amqzmur0 restartable process manager amqrmppa channel pooling process amqrrmfa repository process (for clusters) amqzdmaa deferred message processor amqpcsea command server

"Stopping queue managers", System Admin Guide, SC34-6068-01, appendix D page 485 [507/560]

would like to understand the function of the amqzlsa0 process

The amqzlsa0 process is the local queue manager (LQM) socket agent main program. It handles socket connections to the queue manager when the application to queue manager connection is set to isolated bindings.

If DefaultBindType is set to ISOLATED, then applications and the queue manager run in separate processes, and no resources are shared between them.

The amqzlsa0 process will not be running throughout the life of the queue manager. Once isolated bindings are enabled, then amqzlsa0 is called to initialize the resources that are necessary to support isolated bindings, and the WebSphere® MQ processes interacts as usual.

AS/400 - iSeries Up

wrkmqmchl (work with Channels, OS/400 Main Menu) 5 = Visualizar (Refresh) 14 = Iniciar (Start) 15 = Finalizar (Stop) wrkmqm - treballar amb un Queue Manager. 18 = trabajar con colas. 12 = trabajar con mensajes. 8 = visualizar datos. wrklnk - accés al sistema de fitxers. Ubicació de les trasses : (*** llegir amb EDTF ***) /Root/QIBM/UserData/mqm/errors o /Root/QIBM/UserData/mqm/qmgrs/QMANAGER.AS400/errors runmqsc - fer servir MQ Scripts Channel problems : Use the wrklnk command and then option 5 to display the error logs. Generally for any "channel" issues this (the error logs) is the best place to start.
Migrating to MQ v7 on i 6.1

Have to do "object conversion" using STROBJCVN LIB(QMQM). Thanks to J.A.Flores {01042011} !


MQ jExplorer - Java Explorer Up

[root@dmqb261]:/tmp/soft/mqjexplorer> cat mqj.sh export CLASSPATH=./export.jar export CLASSPATH=$CLASSPATH:./jhbasic.jar export CLASSPATH=$CLASSPATH:./com.ibm.mq.jar export CLASSPATH=$CLASSPATH:./jta.jar export CLASSPATH=$CLASSPATH:./com.ibm.mq.pcf.jar export CLASSPATH=$CLASSPATH:./xerces.jar export CLASSPATH=$CLASSPATH:./mqjhelp.jar export CLASSPATH=$CLASSPATH:./com.ibm.mqjms.jar export CLASSPATH=$CLASSPATH:./jms.jar export CLASSPATH=$CLASSPATH:./jndi.jar export CLASSPATH=$CLASSPATH:./ldap.jar export CLASSPATH=$CLASSPATH:./fscontext.jar export CLASSPATH=$CLASSPATH:./providerutil.jar: echo Ara mateix el CLASSPATH es ..... echo $CLASSPATH java -verbose:class com.kolban.mqjexplorer.MQJExplorer [root@dmqb261]:/tmp/soft/mqjexplorer>

14062006 :

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't find library mqjbnd02 (libmqjbnd02.a or .so) in sun.boot.library.path or java.library.path sun.boot.library.path=/usr/java14/jre/bin

Santi : llibreria JMS !

Amunt! Top Amunt!

Run Two Simultaneous MQ Queue Managers Up

You can run two MQ queue managers on the same machine by making sure they both use a unique port. Here are the definitions and how you can do this on a Windows system.

1. Create two queue managers and start them :

  crtmqm QMGR1
  crtmqm QMGR2
  strmqm QMGR1
  strmqm QMGR2

2. Use the RUNMQSC utility against QMGR1 (runmqsc QMGR1) :

def channel(QMGR1.TO.QMGR2) chltype(SDR) +
  trptype(tcp) conname('hostname(1415)') +
  xmitq(QMGR2) +
  descr('QMGR1 to QMGR2 sender') replace 
def channel(QMGR2.TO.QMGR1) chltype(rcvr) +
  trptype(tcp) replace
  share usage(xmitq) replace 
def qremote('TO.QMGR2') +
  rname('FROM.QMGR1') rqmname(QMGR2) replace 
def qlocal('FROM.QMGR2') replace

3. Use the RUNMQSC utility against QMGR2 (runmqsc QMGR2) :

def channel(QMGR2.TO.QMGR1) chltype(SDR) +
  trptype(tcp) conname(hostname) xmitq(QMGR1) +
  descr('QMGR2 to QMGR1 sender') replace 
def channel(QMGR1.TO.QMGR2) chltype(rcvr) +
  trptype(tcp) replace
  share usage(xmitq) replace 
def qremote('TO.QMGR1') +
  rname('FROM.QMGR2') rqmname(QMGR1) replace 
def qlocal('FROM.QMGR1') replace 

4. Start the channels and listeners for the two queue managers :

runmqlsr -t tcp -m QMGR1 -p 1414
runmqlsr -t tcp -m QMGR2 -p 1415

runmqchl -c QMGR1.TO.QMGR2
runmqchl -c QMGR2.TO.QMGR1

At this point, you can send messages from QMGR1 to QMGR2 using the MQ sample programs:

e:\mqm\tools\samples\c\bin\amqsput TO.QMGR2  QMGR1
  Message to QMGR2
*blank ends program.

*send a message to QMGR1 from QMGR2.

e:\mqm\tools\samples\c\bin\amqsput TO.QMGR1 QMGR2
  Message to QMGR1
*blank ends program.

*get the message on QMGR1 sent by QMGR2.

e:\mqm\tools\samples\c\bin\amqsget FROM.QMGR2 QMGR1
  Message to QMGR1
  no more messages
  program ends
*get the message on QMGR2 sent by QMGR1.

e:\mqm\tools\samples\c\bin\amqsget from.QMGR1 QMGR2
  Message to QMGR2
  no more messages
program ends

Queue Loop [Tania]

If we write into a Remote Queue RQ1, that points to RQ2, that is a Remote Queue again, that points to DQ2, Destination Queue. The environment needs TQ1 and TQ2 (transmission queues) and 2 channels. So, a message put into RQ1 comes auto-magically into DQ2.

QM1 QM2 RQ1 TQ1=QM2 ch.QM1.to.QM2 RQ2 DQ2 ch.QM2.to.QM1 TQ2=QM1

Well, if DQ2 is NOT a Local Queue, but an Alias queue, pointing to RQ1, we have a nice loop. With just one (two) message(s), we shall have all resources approaching max capacity, so we can measure how many messages can a queue manager, a queue or a channel be able to manage.

Request / Response loop (plus aditives)

If we write using AMQSREQ.exe into a Alias Queue QA1, that points to Remote Queue QR1, that will use Transmit Queue QX1, the message shall go thru channel ch.QM1.to.QM2 and finish at QL2. At QM2, the message will be answered by AMQSECHA.exe program, going to QL1.

QM1 (veci) | QM2 (hesp) | AMQSREQ.exe | | | QA1 -> QR1 -> QX1=QM2 -> ch.QM1.to.QM2 -> QL2 | | AMQSECHA.exe | | QL1 <- ch.QM2.to.QM1 <- QX2=QM1 <- QR2 <- QA2 |

What can we add ?

  • mirroq at QR1 or QA1 into QC1
  • mirroq at QL2 into QC2
  • mirroq at QX2 into QC2 also
  • mirroq at QL1 into QC1 also
  • channel trace at ch.QM1.to.QM2 / ch.QM2.to.QM1

If messages are timestamped and Reply has original Message_Id in the Correl_Id field, we can measure the go-and-back time, scanning QC1 or QC2 contents.

Exit's Up

A "channel" is the mechanism that one queue manager uses to pass messages to another queue manager.
Each channel consists of a message channel agent (MCA) program at the sending end which passes messages to an MCA program at the receiving end.
The MCA programs can have exit programs attached to them:

  • Security exits - one at each end. Used at channel-initiation time.
  • Message exits - one at each end - (GET) message exit at sending end; (PUT) message exit at receiving end. Invoked once per message.
  • Send exit - at the sending end. Invoked once per message segment.
  • Receive exit - at the receiving end. Invoked once per message segment.

Application considerations involved with MQ, GG24-4469, page 65 [87/250], "14.4 - MCA Exits".

Consideracions per llenguatges i per plataformes :

Using and writing API exits, chapter 15, MQ v 6.0 Application Programming Guide

From MQSC Command Reference :


Security exits normally work in pairs; one at each end of a channel. They are called immediately after the initial data negotiation has completed on channel startup, but before any messages start to flow. The primary purpose of the security exit is to enable the MCA at each end of a channel to authenticate its partner. However, there is nothing to prevent a security exit from performing other function, even function that has nothing to do with security.

Security exits can communicate with each other by sending security messages. The format of a security message is not defined and is determined by the user. One possible outcome of the exchange of security messages is that one of the security exits might decide not to proceed any further. In that case, the channel is closed and messages do not flow. If there is a security exit at only one end of a channel, the exit is still called and can elect whether to continue or to close the channel.

Security exits can be called on both message and MQI channels. The name of a security exit is specified as a parameter in the channel definition at each end of a channel.

(5.3) "Security.pdf" (pg 52)

User exits

User exits provide a mechanism for you to insert your own code into a queue manager function. The user exits supported include:

  • Channel exits
    These exits change the way that channels operate. Channel exits are described in MQ Intercommunication (csqzae05.pdf, SC34-6059-02, chapter 46).
  • Data conversion exits
    These exits create source code fragments that can be put into application programs to convert data from one format to another. Data conversion exits are described in the MQ Application Programming Guide (csqzal05.pdf).
  • The cluster workload exit
    The function performed by this exit is defined by the provider of the exit. Call definition information is given in MQ Queue Manager Clusters (csqzah03.pdf).

(5.3) "Extending Queue Manager facilities", System Administration Guide, SC34-6068-02, page 12 [36/567].

How to write an User-Exit

User exits and channel-exit programs are able to make use of all MQI calls, except as noted in the sections that follow. To get the connection handle, an MQCONN must be issued, even though a warning, MQRC_ALREADY_CONNECTED, is returned because the channel itself is connected to the queue manager.

You are recommended to avoid issuing the following MQI calls in channel-exit programs:


Channel-exit programs should not modify the Channel Data structure (MQCD).

Cluster workload exits must not use MQI calls.

All exits are called with a channel exit parameter structure (MQCXP), a channel definition structure (MQCD), a prepared data buffer, data length parameter, and buffer length parameter. The buffer length must not be exceeded.

(5.3) "Writing and compiling channel-exit programs", Intercommunication, SC34-6059-02, page 633 [657/815].

The exit is a DLL that must be written in C.

The exit name is the name of a dynamic-link library, suffixed with the name of a function residing in that library. The function name must be enclosed in parentheses. The library name can optionally be prefixed with a directory path and drive: [d:][path]library(function) The name is limited to a maximum of 128 characters.

"MQCD - Channel definition", (6.0) Intercommunication, SC34-6587, page 453 [475/573].

When writing channel exits for these products using Visual C++, you should do the following:

  • Add MQMVX.LIB to project as a source file.

  • Change the box labelled "Use Run-Time Library" from "Multithreaded" to "Multithreaded using DLL" in the project settings under C/C++ code generation.

  • write a nom.DEF file as :

Intercommunication, v 5.3, SC34-6059-02, page 641.

MQ Series Distributed Queuing Guide, SC33-1139-06, pg 274.

Message Exit params
void MQENTRY MQAExit ( PMQVOID mqcxpptr, /* Channel exit parameter block MQCXP in/out */ PMQVOID mqcdptr, /* Channel definition MQCD in/out */ PMQLONG inmsglngptr, /* Length of data in/out */ PMQLONG inbuflngptr, /* Length of agent buffer in */ PMQVOID inbufptr, /* Agent buffer MQXQH+data in/out */ PMQLONG outmsglngptr, /* Length of exit buffer in/out */ PMQPTR outbufptr ) /* Address of exit buffer in/out */ {

A amqsxrma.c la definició és :

void MQENTRY MsgExit ( PMQCXP pExitParms, PMQCD pChannelDef, PMQLONG pDataLength, PMQLONG pAgentBufferLength, PMQCHAR pAgentBuffer, PMQLONG pExitBufferLength, PMQCHAR * pExitBuffer ) ;
AgentBuffer (MQBYTE x AgentBufferLength) - input/output

The contents of this depend upon the exit type:

  • For a channel security exit, on invocation of the exit it contains a security message if ExitReason is MQXR_SEC_MSG. If the exit wishes to send a security message back, it can either use this buffer or its own buffer (ExitBufferAddr).

  • For a channel message exit, on invocation of the exit this contains:

    - The transmission queue header (MQXQH), which includes the message descriptor (which itself contains the context information for the message), immediately followed by
    - The message data

    If the message is to proceed, the exit can do one of the following:

    - Leave the contents of the buffer untouched
    - Modify the contents in place (returning the new length of the data in DataLength; this must not be greater then AgentBufferLength)
    - Copy the contents to the ExitBufferAddr, making any required changes

    Any changes that the exit makes to the transmission queue header are not checked; however, erroneous modifications may mean that the message cannot be put at the destination.

  • For a channel send or receive exit, on invocation of the exit this contains the transmission data. The exit can do one of the following:

    - Leave the contents of the buffer untouched
    - Modify the contents in place (returning the new length of the data in DataLength; this must not be greater then AgentBufferLength)
    - Copy the contents to the ExitBufferAddr, making any required changes

    Note that the first 8 bytes of the data must not be changed by the exit. Why ?

My 2 user exits
  • la compilació ha de ser amb els paràmetres /MD (multithread) i /LD (crear DLL)

  • la linkedició ha de ser amb els fitxers mqm.lib i mqmvx.lib

  • put the DLL files into c:\Program Files\IBM\Websphere MQ\exits

  • Noms :
    • \\MQ\Eines\Exit_Minima\exit_minima.c => \\MQ\Eines\Exit_Novato\TESTEXIT.dll [security]
    • \\MQ\Eines\Exit_Duplicadora
    • \\MQ\Eines\Exit_Traza => \\CPP\MQEXIT\Exit_Traza

  • Data Trace - traces all messages sent over a channel into a file

    File ubication is \\CPP\MQEXIT\Exit_Traza\EXES.DLL The header is void MQENTRY MQAExit ( So we have to code MSGEXIT('EXES(MQAExit)') + MSGDATA('c:\MVQTRXIT.TRC)') And we get a trace of all traffic in file c:\MVQTRXIT.TRC

    Probar de ficar una destinació estil "unix" ...

  • Duplication - creates a copy of all messages sent over a channel and enqueues them on a specified queue

    Original Destination Queue and Destination Queue Manager are lost

    File ubication is \\CPP\MQEXIT\Gas_Natural\GNX2.DLL The header is void MQENTRY gnxit ( So we have to code MSGEXIT('gnx2(gnxit)') + MSGDATA('Q2SAGCOPY RQM)') + And we get the messages in local queue Q2SAGCOPY And a trace in file c:\GNX2.TRC

    Aquest fitxer de sortida no ès vàlid per a "unix" ...

How to compile a user exit

Publib : URL : see Linux 32 vs 64-bit

Guindous :

CL /MD /GD /V"SAG v 1.3" /LD /I"C:\MQ\Tools\c\include" GNX2.C "c:\MQ\Tools\Lib\mqm.lib" "c:\MQ\Tools\Lib\mqmvx.lib" -DEFAULTLIB myexit.def

Unix :

mqm@lope:/home/mqm/eines/bin> cat comp.sh #!/usr/bin/ksh FNO=$1 NFC=$FNO".c" FNcli=$FNO"c" echo "Anem a compilar" $NFC echo "Sortida " $FNO cc -L/usr/mqm/lib -lmqm -o $FNO ../$NFC cc -L/usr/mqm/lib -lmqic -o $FNcli ../$NFC echo "Fi."

Solaris : (SPARC platform 32 bit applications)

gcc ? cc -xarch=v8plus -KPIC -mt -G -o /var/mqm/exits/amqsaxe \ amqsaxe0.c -I/opt/mqm/inc -L/opt/mqm/lib -R/opt/mqm/lib \ -R/usr/lib/32 -lmqm -lmqmcs -lmqmzse -lmqmzf -lsocket -lnsl -ldl

Page 205, Application Programing Guide, MQ v 6.0, SC34-6595-01.

Under W2K, the Message Exit DLL has to be placed in d:\IBM\WebSphere MQ\exits !

Message Exit Code

Declaración al MQ Explorer
Propiedades de "canal" + Rutinas de Salida : Nombre rutina salida mensaje := my_dll(My_Exit)
or (old way, RUNMQSC)

El canal Q1TOQ2 del QMgr Q1 té :

Security Exit Name := MSGMON(MsgExit) Security Exit Data := c:\temp\channel.ini Message Exit Name := MY_DLL(My_Exit)

El canal Q2TOQ1 del QMgr Q2 té :

Message Exit Name := MSGMON(MsgExit) Message Exit Data := c:\temp\channel.ini
My Exit's at AIX
Posar el font a /home/sebas/exits. Ha de tenir un parametre de entrada : ubicació del fitxer de sortida
Adaptar la compilació :
Moure la DLL ('EXES.O' o 'GNX2.O') a destinació : al Solaris, les Exits es posen a /var/mqm/exits/
Crear el fitxer de sortida (compte amb el propietari) : MVQTRXIT.TRC o GNX2.TRC
Incloure les sentencies de la Exit al canal
Re-iniciar el queue manager ( o n'hi ha prou amb el canal ? )
API Exit's

See the MQ Application Programming Guide.


Es molt interessant la MirrorQ exit - duplica missatges !

Sequència de instalació (win) :

  1. copiar la DLL a c:\MQ\exits\
  2. crear la Namelist fent servir MIRRORQ.MQSC
  3. configurar :
    • obrir MQ Explorer
    • seleccionar el gestor (QMB)
    • botó dret, escollir "Properties" i "Exits", escollir "Add"
    • Name := "MirrorQ" ;
    • Function := "EntryPoint" ;
    • Module := browse to DLL
    • check "Data" checkbox
    • write Data := "mirrorq", name of the NameList (see bellow).
  4. reiniciar el gestor & probar
* Create the Namelist to show the source and target queues. * This case sensitive name must match the name specified in the Data= field DEFINE NAMELIST('mirrorq') REPLACE + DESCR('Namelist to define source and target queues for MIRRORQ') + NAMES(TEST_IN1,TEST_IN1_COPY,'INDI',TEST_IN2,TEST_IN2_COPY,'INDI')

Que fa ? Tot missatge que es posa a la cua TEST_IN1 resulta duplicat a la cua TEST_IN1_COPY.

url & file

Unix : Configuring API exits on UNIX® systems.

ApiExitLocal: Name=mirrorq Sequence=3 Function=EntryPoint Module=/var/mqm/exits64/mirrorq Data=mirrorq

An invalid magic number for a module implies that there is a 32-bit to 64-bit missmatch.

cc -L/usr/mqm/lib64 -lmqm -o OBJECTFILE SOURCEFILE

Per generar el module (es la "dll" de AIX), es a dir, per compilar una Exit :

mqm@lope:/home/mqm/eines/api_exit > ./x2 echo "Compilar normal, 32 bits." xlc -q32 -e MQStart -bE:mirrorq.exp -bM:SRE -o mirrorq mirrorq.c \ -I/usr/mqm/inc -L/usr/mqm/lib -lmqm -lmqmzf echo "Compilar recursiu, 32 bits." xlc_r -q32 -e MQStart -bE:mirrorq.exp -bM:SRE -o mirrorq_r mirrorq.c \ -I/usr/mqm/inc -L/usr/mqm/lib -lmqm_r -lmqmzf_r echo "Copiar a destinacio :" cp mirrorq /var/mqm/exits cp mirrorq_r /var/mqm/exits echo "Compilar normal, 64 bits :" xlc -q64 -e MQStart -bE:mirrorq.exp -bM:SRE -o mirrorq mirrorq.c \ -I/usr/mqm/inc -L/usr/mqm/lib64 -lmqm -lmqmzf echo "Compilar recursiu, 64 bits :" xlc_r -q64 -e MQStart -bE:mirrorq.exp -bM:SRE -o mirrorq_r mirrorq.c \ -I/usr/mqm/inc -L/usr/mqm/lib64 -lmqm_r -lmqmzf_r echo "Copiar a destinacio :" cp mirrorq /var/mqm/exits64 cp mirrorq_r /var/mqm/exits64

Si us dona l'error "ld: 0711-317 ERROR: Undefined symbol: .MQXEP", es que no heu afegit "-lmqmzf" !

Compte que a la URL també hi ha un mirrorq.cpp que fa el mateix, però per Triggering !

  • runmqsc queuemangername < mirrorq.mqsc
  • start runmqtrm -m queuemanagername -q MIRRORQ.TRIGGER
  • amqsput MIRRORQ.STAGEQ queuemanagername
  • amqsbcg MIRRORQ.BUSINESSQ queuemanagername
  • amqsbcg MIRRORQ.MIRRORQ queuemanagername
* Bussiness consumer source queue DEFINE QLOCAL('MIRRORQ.BUSINESSQ') REPLACE + DESCR('Exit queue for MIRRORQ') * mirror queue DEFINE QLOCAL('MIRRORQ.MIRRORQ') REPLACE + DESCR('Mirror queue for MIRRORQ') * Bussiness producer destination queue DEFINE QLOCAL('MIRRORQ.STAGEQ') REPLACE + DESCR('Entry queue for MIRRORQ') + SHARE + TRIGGER + TRIGTYPE (EVERY) + INITQ('MIRRORQ.TRIGGER') + PROCESS('MIRRORQ.PROCESS') * Initiation Queue used by MIRRORQ DEFINE QLOCAL('MIRRORQ.TRIGGER') REPLACE + DESCR('Trigger queue') * Process definition to load mirrorq.exe DEFINE PROCESS('MIRRORQ.PROCESS') REPLACE + DESCR('Trigger process for MIRRORQ') + USERDATA('MIRRORQ.BUSINESSQ MIRRORQ.MIRRORQ') + APPLICID('mirrorq')

Compte que a vegades cal que es conservi el MsgId !

Linux Up

If you install MQ v5.3 undel SuSE or RedHat Linux, and get a "Segmentation Fault", fix it by

export LD_ASSUME_KERNEL=2.4.19

MQ HA 5.3 installation under Linux

Gracias, Pablo !

Borland compiler Up

If you use BCC32 instead of CL, then the MQM.LIB has not the proper format. To convert it to "Borland's" format, use COFF2OMF.exe, that can be found at "c:\Borland\BCC55\Bin" !

Error: 'C:\MQ\Tools\Lib\MQM.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
Dev-C++ :

Superseded by Orwell. Homepage. Docu. Em baixo

43.693.756 Dev-Cpp 5.5.3 TDM-GCC x64 4.7.1 Setup.exe

Despres de incloure "c:\mq\tools\c\include" en els directoris de les opcions del compilador, diu

3584 2 C:\MQ\tools\c\include\cmqc.h [Error] unknown type name '_int64'

Solució :

#ifndef _int64 #define _int64 long long #endif

Perfect compilation : (see more flags using "gcc --help")

c:\"Program Files (x86)"\Dev-Cpp\MinGW64\bin\gcc amqsecha.c -I"c:\mq\tools\c\include" -L"c:\mq\tools\Lib64" -o AMQSECHA.EXE -lmqm
Els programes de MQ no compilen be amb GCC - no abaca be el MQCONN() - see "\\MQ\Eines\AMQSPUT_modificat\tmp\" or "\\MQ\Eines\Samples\put\"

Building MQ C++ programs : supported compilers

Guindous : use the Microsoft Visual Studio C++ compiler. Visual Studio Express 2013 for Windows Desktop. VS2013_RTM_DskExp_ENU.iso -> wdexpress_full.exe -> C:\Program Files (x86)\Microsoft Visual Studio 12.0


  • *) install MQ software on each computer in the cluster.

    Queue managers themselves need to exist only on the computer on which you create them. In the event of failover, the MSCS initiates the queue managers on the other computer. The queue managers, however, must have their log and data files on a cluster shared disk, and not on a local drive.

  • *) set Queue Manager to have MANUAL startup.
  • *) set IBM MQ Service to have MANUAL startup.
  • *) create ONE queue manager ( with Persistent queues )
  • *) move the queue manager Data and Log files to shared disk :

    hamvmqm /m qmname /dd "f:\WebSphere MQ" /ld "f:\WebSphere MQ\log"

  • *) register MQ resource to MSCS

    haregtyp /r

  • *) create the MQ resource to Cluster Admin
  • *) verify it works : "bring online" + put/get messages
  • *) Failover ! Or "Move" the cluster resources to second PC.
  • *) see previous messages, and put more msg into a queue
  • *) failover (back)
  • *) see all messages ! (if "persistent")

System Admin Guide, SC34-6068-02, chapter 13 - Supporting MSCS

Linux HA Cluster

HA software : VCS

File "in use"

Si, al instalar un FP de MQ, ens diu AMQ4757 error, "MQ files in use", hem de fer :

Ensure that all queue managers, listeners, channels and MQ services are stopped. Use the Windows task manager to ensure that there are no processes running with an "amq", "runmq", or "strmq" prefix. Stop any tools used to monitor MQ and stop any Performance Monitor tasks. If the process locking MQ files cannot be identified, installation can usually procede following a reboot, with the MQ service disabled. Set "MQ Series" service to Manual and restart 2003 Server. Install Fix Pack again

Amunt! Top Amunt!
File descriptors

When running a multi-threaded process such as the agent process, you might reach the soft limit for file descriptors. This gives you the WebSphere MQ reason code MQRC_UNEXPECTED_ERROR (2195) and, if there are enough file descriptors, a MQ FFST file.
To avoid this problem, you can increase the process limit for the number of file descriptors. To do this, alter the nofiles attribute in /etc/security/limits to 10,000 for the mqm user id or in the default stanza.

MQ v 6.0 for AIX quick beginnings, page 5 [19/72], GC34-6478-01.

Amunt! Top Amunt!

When you put a message on a queue, you can select to receive:

If you want to receive a report message, specify the name of your reply-to queue in the ReplyToQ field; otherwise the MQPUT or MQPUT1 of your original message fails with MQRC_MISSING_REPLY_TO_Q.

Application Programming Guide, SC34-6595-01, page 22, [42/601]


PAN (Positive Action Notification) or a NAN (Negative Action Notification) event ... < Pending

Amunt! Top Amunt!
Message persistence

This indicates whether the message survives system failures and restarts of the queue manager.

Message persistence
Persistent messages are written to logs and queue data files. If a queue manager is restarted after a failure, it recovers these persistent messages as necessary from the logged data.

MQ 6.0 Programming Guide, pg 30 [50/601], SC34-6595-01

This means that the message survives system failures and restarts of the queue manager. Once the message has been put, and the putter's unit of work committed (if the message is put as part of a unit of work), the message is preserved on auxiliary storage. It remains there until the message is removed from the queue, and the getter's unit of work committed (if the message is retrieved as part of a unit of work).

MQ 5.3 Application Programming Guide, pg 171 [197/781], SC34-6062-02

Data for persistent messages is written to log buffers. These buffers are written to the log data sets when:

MQ z/OS Problem Determination Guide, GC34-6600-00

La persistencia de un missatge es determina :

When you create a message, if you initialize the message descriptor (MQMD) using the defaults, the persistence for the message is taken from the DefPersistence attribute of the queue specified in the MQOPEN command. Alternatively, you can set the persistence of the message using the Persistence field of the MQMD structure to define the message as persistent or nonpersistent.


Persistence is really a message attribute and not a queue attribute.

Taylor @ developerWorks

No such thing as a persistent queue! ... but ... "Except for temporary dynamic queues", he told me with a grin, "they’re pretty much ALL persistent. Once you define 'em, they never go away." T. Rob

The messages may have come through an alias or a QRemote where DEFPSIST(NO) was set.



Problema : si els missatges son no persistents, i el log creix 7 GB cada dia, com podem investigar el seu contingut ? Create a new qmgr, start it, create a queue, put a persistent message, end the qmgr, print the log.

Why an external DB is required ?

Message-on-the-flight recovery

Imagine this setting :

  1. we have a cluster queue - DEFBIND(NOTFIXED)
  2. we stop the 2 qmgr instances containing it
  3. we send 2000 messages to the queue
  4. 1998 messages stay in SYSTEM.CLUSTER.TRANSMIT.QUEUE
  5. those 2 remaining messages are not lost when qmgrs are started only if they are persistent

Amunt! Top Amunt!
DB2 / Oracle & XA

Per cada "Data Source"

/var/mqm/java/lib/jdbc/make oracle

Ben Ritchie at DeveloperWorks article

A guindous tenim:

Directory of c:\MQ\java\lib\jdbc 13/08/2009 01:00 24.448 jdbcdb2.dll 13/08/2009 01:00 24.448 jdbcora10.dll

Amunt! Top Amunt!
Global units of work

Are those in which other resources, such as tables in a relational database, are also updated. When more than one resource manager is involved, there is a need for transaction manager software that uses a two-phase commit process to coordinate the global unit of work. Use global units of work when you also need to include updates to relational database manager software, such as DB2, Oracle, and Sybase.
We define two scenarios for global units of work:

MQ 5.3 System Admin Guide - SC34-6068-02, chapter 11 : Transactional support.

Using CICS with WebSphere MQ & setting up the TXSeries interface to WebSphere MQ :

Logging : circular vs linear Up

Circular logging
Use circular logging if all you want is restart recovery, using the log to roll back transactions that were in progress when the system stopped.

Linear logging
Use linear logging if you want both restart recovery and media or forward recovery (recreating lost or damaged data by replaying the contents of the log).

De que no ens protegeix el Log circular ?

  • de que s'espatlli el disc on son les dades o el log
  • de que es corrompeixin les dades d'una cua
  • de que algu ens robi un missatge
Use CIRCULAR logging plus DATA and LOG (separate) disks in RAID (5 or 10)

Another EXCELENT T-Rob's article :

Circular logging enables the queue manager to reconcile the status of any outstanding transactions on restart. Linear logging enables recovery from this and more drastic outages such as loss of the queue file. If that was all there was to it, the obvious choice would always be to use linear logs.

Linear logging provides a superset of the functionality of circular logging. Queue manager restart operations using linear logs function the same as with circular logs: the log files are reconciled against the queue files to determine the disposition of transactional messages. In addition to the transactions under syncpoint, linear logs also contain a copy of all persistent messages. If one or more queue files are damaged, the queue can be recovered to the last known good state by replaying the linear logs. This is known as media recovery.

Risks of circular logging :

  • Human error
  • System error

Linear log maintenance : The basis of the system is SupportPac MS62, Linear Log Cleanup Utility, a Perl script that parses the error logs to identify the inactive extents and provides options to archive or delete them.

El SaveQmgr ens porta cap a un "arranque en frio" !

With circular logging, you only get stop/restart capability for a "healthy" queue manager. MQ objects are not written to circular logs. To restart a queue manager if objects have been damaged or lost, you also need media recovery. In order to perform media recovery, the queue manager must have written media images of MQ objects in the logs. MQSeries stores media images in logs only if you are using linear logging.

"Backup and Recovery" redbook, SG24-5222.pdf

Logged messages and other things logged are not removed from logs. Logs are history. Logs are required for queue manager restart to ensure consistency. Non-persistent messages are not logged. UofW information is logged.
There are four types of log record, described under the following headings:

  • "Unit-of-recovery log records"
  • "Checkpoint records"
  • "Page set control records" on page 34
  • "CF structure backup records" on page 34

GC34-6582-00, WebSphere MQ for z/OS Concepts and Planning Guide. Chapter 4, Logging.

------------------------------------------------------------------------------- 11/07/08 14:50:49 - Process(10510.1) User(QMQM) Jobname(182465/QMQM/AMQALMPX ) AMQ7460: Información de diario de inicio de WebSphere MQ. EXPLICACIÓN: Causa . . . . . : WebSphere MQ emite periódicamente este mensaje para ayudarle a identificar los receptores de diario que pueden eliminarse del sistema porque ya no se necesitan para operaciones de recuperación en el momento de iniciar. Recuperación . : Ninguna. Descripción técnica . . . . . . . . : La fecha de la entrada de diario más antigua necesaria para la recuperación en el momento de iniciar es 04/11/08 16:38:43. Esta entrada está dentro del receptor de diario AMQA000030. WebSphere MQ no precisa de los receptores de diario anteriores para la recuperación en el momento de iniciar. Si el nombre de el receptor de diario es **********, WebSphere MQ no pudo determinar el nombre del receptor. El formato de la serie de fecha es *DMY. ------------------------------------------------------------------------------- 11/07/08 14:50:49 - Process(10510.1) User(QMQM) Jobname(182465/QMQM/AMQALMPX ) AMQ7462: Información de diario de recuperación de soporte de almacenamiento WebSphere MQ. EXPLICACIÓN: Causa . . . . . : WebSphere MQ emite periódicamente este mensaje para ayudarle a identificar qué receptores de diario pueden eliminarse del sistema, puesto que ya no son necesarios para recuperar el soporte de almacenamiento. Recuperación . : Ninguna. Descripción técnica . . . . . . . . : La fecha más antigua de la entrada de diario necesaria para recuperar el soporte de almacenamiento es 07/11/08 14:50:49. Esta entrada está en el receptor de diario AMQA000031. WebSphere MQ no precisa de los receptores de diario anteriores para la recuperación desde el medio de almacenamiento. Si el nombre de el receptor de diario es **********, WebSphere MQ no pudo determinar el nombre del receptor. El formato de la serie de fecha es *DMY. -------------------------------------------------------------------------------
Log Size definition

LogFilePagesSize=number ("-lf=NN")

The log data is held in a series of files called log files. The log file size is specified in units of 4 KB pages.

In MQ for UNIX systems, the default number of log file pages is 1024, measured in units of 4 KB. giving a log file size of 4 MB. The minimum number of log file pages is 64 and the maximum is 65 535.

In MQ for Windows, the default number of log file pages is 256, measured in units of 4 KB. giving a log file size of 1 MB. The minimum number of log file pages is 32 (128 KB) and the maximum is 65 535 (262 MB).

Note: The size of the log files specified during queue manager creation cannot be changed for a queue manager.

MQ v 6.0 System Administration Guide, SC34-6584-01, page 118 [140/647]

Log size calculation
  • in : persistent message average size
  • in : number of persistent messages per day
  • in : number of days to be able to recover
  • out : log size

MQ v 6.0 System Administration Guide, SC34-6584-01, page 238 [260/647]

If a large (500 KB) BAR file has to be deployed, then the (Windows) default values are not enough.

Para tener un log circular de 1,28 GB codificaremos:

$ crtmqm –u QDLQ –lc –lf 16384 –lp 20 –ls 10 –g gsmfct -ld nnn –md nnn NOM # si usamos ficheros de 64 MB (16384 x 4 KB) ... # y tenemos 20 de estos ficheros (-lp) ... # ... entonces tendremos un log circular de 1280 MB (20 x 64 MB)
Message filtering


My rough guidelines -log calculation best practices
Have 5 primary and 5 secondary Definitely set LogFilePages (lf param) to 16384 (this is, 64 MB each file) Use circular logging (in most cases) Make sure the disk space will allow the use of the above log files Make sure the queue space has enough space for a weeks worth of messages at least Round up to nearest GB Make sure the Dead Letter Queue is defined, is PERSISTENT, and has a very large max depth (eg 500000) Make sure transmit queues have a large max depth (eg 50000)
LOG file(s) missing
C:\> strmqm TQM4 WebSphere MQ queue manager 'TQM4' starting. AMQ7017: Log not available. C:\>dltmqm TQM4 AMQ8101: WebSphere MQ error (893) has occurred. C:\>dltmqm TQM4 AMQ8118: WebSphere MQ queue manager does not exist.

Recovery and problem determination

In the case of a communications failure, messages remain on queues until they are removed by a receiving application. If the message is being transmitted, it remains on the transmission queue until it can be successfully transmitted. To recover from a communications failure, you can usually restart the channels using the link that failed.
If you lose power, when the queue manager is restarted MQ restores the queues to their committed state at the time of the failure. This ensures that no persistent messages are lost. Nonpersistent messages are discarded; they do not survive when MQ stops abruptly.

Media recovery
Media recovery re-creates objects from information recorded in a linear log. For example, if an object file is inadvertently deleted, or becomes unusable for some other reason, media recovery can re-create it. The information in the log required for media recovery of an object is called a media image. Media images can be recorded manually, using the rcdmqimg command, or automatically in some circumstances. A media image is a sequence of log records containing an image of an object from which the object itself can be re-created.

MQSeries Backup and Recovery, SG24-5222 : online, pdf.

Question : why do we get

\\t400\C:\> rcdmqimg -m MYQMGR -t all * AMQ7044: Recuperación de soporte magnético no permitida. AMQ7044 MEDIA RECOVERY NOT ALLOWED

Answer : the reason is that your queue manager uses circular logging instead of linear logging.

TroubleShooting Up
  • Log ubication

    • Intel :
      • c:\Program Files\IBM\WebSphere\Errors - unrelated to any queue manager
      • c:\Program Files\IBM\WebSphere\Qmgrs\<qmgr_name>\Errors - related to <qmgr_name>
    • Unix :
      • /var/mqm/errors - unrelated to any queue manager
      • /var/mqm/qmgrs/<qmgr_name>/errors - related to <qmgr_name>

  • Channel management
    1. stop both send and receive ends of the channel
    2. start the Receive end of the channel - the status stays "Inop"
    3. start the Send end of the channel - the status goes "Running"

  • Book : Clustering, SC34-6061-02, page 110/183

  • PPT : \\MQ\TroubleShooting\MQ_V6_Troubleshooting_v1.pps or url (internal)

  • Mind Client TroubleShooting

Amunt! Top Amunt!

Has a default capacity of 256 KB (2 MB after v7.1) Can be changed in the QMErrorLog stanza in the qm.ini file.
The log file sizes can be tuned using the MAXMQERRORLOGSIZE environment variable, the qm.ini file and/or the QMgr attributes in the WebSphere MQ Explorer Extended Attributes panel. url

Also can be acessed under Websphere MQ Explorer -> <qmgr_name> -> Properties -> Extended.

ErrorLogSize=maxsize ExcludeMessages=msgIds SuppressMessages=msgIds
Ignoring error codes under UNIX and Linux systems

On UNIX and Linux systems, if you do not want certain error messages to be written to a queue manager error log, you can specify the error codes that are to be ignored using the QMErrorLog stanza.

Read here how to do it on Win systems :

To exclude error codes MQ3045, AMQ6055, and AMQ8079 from the Windows Application Event Log, in HKLM\Software\IBM\WebSphere MQ\Installation\MQ_INSTALLATION_NAME\IgnoredErrorCodes set the value to AMQ3045\0AMQ6055\0AMQ8079\0\0
AMQERRnn.LOG language

Solution: use the environment variable MQS_FORCE_NTLANGID. Thanks, Jason ! MQS_FORCE_NTLANGID=3081 (0x0C09) - Spanish = 0x2C0A ;

To display actual values, do:

Amunt! Top Amunt!
HealthCheck list

Para que podamos decir que una instalación de MQ está plenamente funcional, debe cumplir con todos los requisitos siguientes.

Tambien podemos decir que son una serie de pasos a verificar cuando se encuentra algún problema con el MQ, es decir, un botiquin de primeros auxilios.

Verificació de correcte funcionament d'elements adicionals


dx0649 - mqbkdesa - /oracle/ora92> ps -ef | grep lsn ora9 381114 09:47:03 pts/0 0:00 /oracle/ora92/bin/tnslsnr LISTENER -inherit


dx0649 - mqbkdesa - /oracle/ora92> ps -ef | grep pmon ora9 372940 17:33:42 - 0:00 ora_pmon_mqbkdesa


dx0649 - mqbkdesa - /oracle/ora92> ps -ef | grep lsr mqm 295126 17:33:39 - 0:00 runmqlsr -t TCP -p 1419 -m QMDESA06

MQ Checklist Up
Info to get
Plataforma ........................ ... AIX / HPUX / Wintel Arquitectura ...................... ... 32 ó 64 bit, Wintel Sistema Operatiu .................. ... uname -a/unix ver/windows Tipus de producte ................. ... MQ Client / MQ Client con SSL / MQ (Server) Versió MQ + CSD aplicat ........... ... dspmqver Configuració ...................... ... standalone / cluster MQ / HACMP Nom Queue Manager ................. ... dspmq Adreça IP ......................... ... ping <ip> Port Listener ..................... ... netstat -an <port> Nom Dead Letter Queue ............. ... runmqsc + display qmgr all Fondaria Dead Letter Queue ........ ... llegir capçaleres Llegir LOGs general i especific ... ... AMQERR01.LOG Noms cues i canals ................ ... SAVEQMGR Exits configuration ............... ... qm.ini Exits code ........................ ... /var/mqm/exits(64)/

Get ALL the info manually :


Items to verify
  • filesystem has space for both logs and data
  • a Dead Letter Queue exists and is empty
  • the transmission queue of a channel has the exact name of the remote queue manager (Why ?)
  • install checklist - MQ & MB

Some Tuning here ...

Amunt! Top Amunt!
FDC files

Message size Up

On WebSphere MQ for AIX, WebSphere MQ for iSeries, WebSphere MQ for HP-UX, WebSphere MQ for Linux, WebSphere MQ for Solaris, and WebSphere MQ for Windows, the MaxMsgLength defaults to 100 MB (104 857 600 bytes).

In WebSphere MQ for z/OS, the MaxMsgLength attribute of the queue manager is fixed at 100 MB and the MaxMsgLength attribute of the queue defaults to 4 MB (4 194 304 bytes) which you can change up to a maximum of 100 MB if required. However, the limit is 63 KB when using shared queues accessed by queue managers in a queue-sharing group.

In MQSeries for AT&T GIS UNIX, MQSeries for Compaq OpenVMS Alpha, MQSeries for SINIX and DC/OSx, MQSeries for Compaq NonStop Kernel, and MQSeries for VSE/ESA the MaxMsgLength defaults to 4 MB.

MQ v 5.3 Application Programming Guide, SC34-6064-02, page 19 [41/643]. MQ v 6.0 Application Programming Guide, SC34-6595-01, page 19 [39/601].

Items involved

If you want to pass such a big file in one message you need to set the max msg size on

  • qmgr
  • DLQ
  • channel
  • xmitq
  • queue
  • log

Handling messages greater than 4 MB long

Messages can be too large for the application, queue, or queue manager. Depending on the environment, MQ provides a number of ways of dealing with messages that are longer than 4 MB. On all MQ V6 systems, you can increase the MaxMsgLength attribute, up to 100 MB. Set this value to reflect the size of the messages using the queue.
On WebSphere MQ V6 systems other than WebSphere MQ for z/OS, you can also:

  1. Use segmented messages. (Messages can be segmented by either the application or the queue manager.)
  2. Use reference messages.

MQ v 6.0 Application Programming Guide, SC34-6595-01, page 129 [149/601]

Segmentation of large messages

The maximum length of an individual message allowed in a MQ infrastructure is 100 MB. However, by default, queues do not accept messages larger than 4 MB.

Messages that are larger than 100 MB, or larger than 4 MB where a queue that a message passes through on route to its destination is not configured to accept messages of a larger size, can be broken into smaller segments.
Segmentation when sending messages and reassembly of the whole message when receiving messages can be performed manually by an application or automatically by a queue manager.

MQ v 6.0 Fundamentals, 4.6.7, page 71 [95/446]

Sender :

... message.messageFlags = MQC.MQMF_SEGMENTATION_ALLOWED ; // #define MQMF_SEGMENTATION_ALLOWED 0x00000001 queue.put ( message, pmo ) ; ... PMO.Options = (existing options) ; MQPUT MD.MsgFlags = MQMF_SEGMENTATION_ALLOWED ;

Receiver :

... MQGetMessageOptions gmo = new MQGetMessageOptions() ; gmo.options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_COMPLETE_MSG | MQGMO_ALL_SEGMENTS_AVAILABLE ; queueIN.get ( retrievemqmessage, gmo ) ; ... GMO.Options = MQGMO_COMPLETE_MSG | (existing options) MQGET

Ver "MQ v 5.1_Planning Guide_GC33-1349-08.pdf" y "MQ Application Programming Guide".

Try it !

Reference messages

This method allows a large object to be transferred from one node to another without storing the object on MQ queues at either the source or the destination nodes. This is of particular benefit when the data already exists in another form, for example, for mail applications.

To do this, you specify a message exit at both ends of a channel.

In the MQMD structure, set the Format field to MQFMT_REF_MSG_HEADER.

MQ v 6.0 Application Programming Guide, SC34-6595-01, page 133 [153/601]


The PM4Data product from CommerceQuest is well suited for transporting large files using a WebSphere MQ backbone as a base transport. These files can exceed the WebSphere MQ message size limit of 100 MB because the data is spread into packets transported using separate messages. Splitting the data into discrete buffers can be configured using the product's administrative interface. Unlike standard FTP, the WebSphere MQ channels used by PM4Data provide all the advantages of guaranteed, assured delivery. PM4Data also supplies a range of graphical tools and methods for tracking the file movement.


Version 6 news Up

  • Improved Usability
    • Simple File Transfer (Windows & Linux) - a simple application that works "out-of-the-box", command line and GUI. No need to write own test programs.
    • Quick Tour (Windows & Linux)
    • New cross-platform configuration tooling (Windows & Linux)
  • Improvements to manageability
    • Find out what the system is doing, and influence it
    • Easier problem determination and problem avoidance
  • Enhanced Availability
    • Exploiting z/OS services
  • Extended performance, capacity and scalability
    • Exploiting 64-bit address space
  • Eclipse configuration tool - can configure WMQ on all platforms
    (including WMQ V6 for z/OS - but not earlier versions on z/OS)
  • Trace Route
  • IPV6
  • zOS : messages (in Shared queues) larger than 63 KB are now supported (using DB2) - up to 100 MB.
  • AIX : 64-bit support

Platform coverage :

  • AIX 5 (64-bit systems only)
  • Solaris (64-bit Sparc systems only)
  • HP-UX 11i (64-bit PA-RISC only)
  • Linux/Intel (32-bit), Linux/pSeries (64-bit distros only), Linux/zSeries
  • z/OS 1.4
    DB2 v 7.1 with PQ71179, IMS v 7.1, Coupling Facility Level 9.
  • Windows 2000, XP, 2003
  • OS/400
  • Other platforms/environments (eg 64-bit) under consideration for a later GA2
DEFINE LISTENER ('QMS1LSR') + TRPTYPE(TCP) + IPADDR(' ') + PORT(1421) + DESCR('Listener TCP del QM.') + CONTROL(QMGR) + ; start/stop with qmgr. STARTONLY REPLACE

Sources :

  • see "WSMQv6 Technical Overview.ppt" [\\MQ\Presentacions]
  • MQ version 6 (internal) Search (for trigger)

Trick :

Otra cosa que hago con MQ es no usar las opciones de instalacion por defecto. Uso "Advanced" y selecciono todo (Server, Client, SDK, ... ). El Client, sobre todo, puede ser útil para mirar colas en servidores remotos.
V 6 books : [\\MQ\BOOKS\V6]
Title Order number WebSphere MQ Application Programming Guide SC34-6595-01 * OK * csqzal11.pdf WebSphere MQ Application Programming Reference SC34-6596-00 * OK * csqzak10.pdf WebSphere MQ Bibliography and Glossary SC34-6603-00 WebSphere MQ Clients GC34-6590-01 * OK * csqzf09.pdf WebSphere MQ Constants SC34-6607-00 * OK * WebSphere MQ Intercommunication SC34-6587-00 * OK * WebSphere MQ Messages GC34-6601-00 WebSphere MQ Migration Information SC34-6604-01 * OK * csqzao01.pdf Monitoring WebSphere MQ SC34-6593-00 * OK * CSQZAX05 WebSphere MQ PCF and Administration Interface SC34-6598-00 * OK * WebSphere MQ Publish/Subscribe User's Guide SC34-6606-00 * OK * amqnar10 WebSphere MQ Queue Managers Clusters SC34-6589-00 * OK * WebSphere MQ Script (MQSC) Command Reference SC34-6597-00 * OK * WebSphere MQ Security SC34-6588-01 * OK * WebSphere MQ System Administration Guide SC34-6584-01 * OK * WebSphere MQ Transport for SOAP SC34-6651-00 * OK * csqzau00 WebSphere MQ Using C++ SC34-6592-00 WebSphere MQ Using Java SC34-6591-01 * OK * WebSphere MQ Using .Net GC34-6605-01

2 items to remotely administer z/OS MQ :

  1. you need the client attach facility (CAF) installed on the z/OS
  2. you need to use at Windows a User and Password accepted by RACF, as the Windows logon is what is passed. It's all that is passed, unless you have a security exit. [jeff]
    Otherwise, you will see a RACF problem by looking into the log of the MSTR on z/OS. [butcher]

Canvi de versió / salvar dades

It would be advisable to compile and link your apps with the new libraries

  • Important MQ V6.0 upgrade information information [*****] - llista de technotes, publicacions, redbooks, etc.

  • Migration Information - Some issues affecting migration to MQ Version 6.0
    • 64-bit qmgrs
    • IP v6
    • SSL migration

  • use MS03 - SaveQmgr, replaced by dmpmqcfg

  • use amqoamd -s to save security information.

  • save
    • mqs.ini & all qm.ini files
    • /var/mqm/exits & /var/mqm/exits64
    • /var/mqm/qmgrs
    • /var/mqm/logs

  • Unix : you must uninstall MQ and any FixPacks

  • use
    • AIX - SMIT
    • Solaris - pkgadd

  • After you migrate a queue manager to MQ Version 6.0, you must start that queue manager to migrate your file system structure before you start any MQ listener associated with that queue manager. Otherwise, you will not be able to start the MQ listeners after migration.

  • If you cannot connect to a migrated queue manager and see an error like "SYSTEM.MQEXPLORER.REPLY.MODEL not defined", run strmqm -c command; it refreshes the default system objects, including creating the queue required by MQ Explorer, SYSTEM.MQEXPLORER.REPLY.MODEL

  • DeveloperWorks Migrating MQ queue manager clusters to MQ V6

Migration resources

WebSphere MQ Quick Beginnings Guides :

WebSphere MQ Migration Information Manual - url

Online Information Center for WebSphere MQ - v6, v7

SupportPac MS6A: WebSphere MQ V6.0 for UNIX Automatic Migration & Maintenance Installation - url

Announcement: End of support for WebSphere MQ 5.3 - url

End of Service dates for WebSphere MQ - url

WebSphere MQ Detailed System Requirements - url

WebSphere MQ Recommended Fixes - url

Technotes :

  • Important MQ V6.0 migration information - url
  • Migration to WebSphere MQ Version 6.0 - url
  • Exits are removed from MQ directory during V6 migration - url
  • WebSphere MQ V6: Rollback Procedure from WebSphere MQ V6 to V5.3 - url
  • Checklist : Unable to Create or Start Queue Manager (iSeries) - url
  • WebSphere MQ V6: Alternative method of migration from WMQ V5 to WMQ V6 (iSeries) - url
  • World executable files in WebSphere MQ v6.0 distribution - url
  • STRMQM fails with AMQ5522 and AMQ6109 - url
  • Are the HP-UX 2004 GOLDBASE and GOLDAPPS environments supported - url
  • WebSphere MQ installation hangs with no errors (Windows) - url
  • Installation fails when migrating from WebSphere MQ V5.3 - url

DeveloperWorks Article related to Migration : "Migrating WebSphere MQ queue manager clusters to WebSphere MQ V6" - url

Migration to MQ v6 on Distributed Platforms.pdf - url


2019, x'07E3 MQRC_HOBJ_ERROR - object handle is not valid.
2053, x'0805 MQRC_Q_FULL
2058, x'080A MQRC_Q_MGR_NAME_ERROR - QMgrName parameter is not valid or not known
2059, x'080B MQRC_Q_MGR_NOT_AVAILABLE - QMgrName is not available for connection, Bindings mode
2196, x'0894 MQRC_UNKNOWN_XMIT_Q
2538, x'09ES MQRC_HOST_NOT_AVAILABLE - client connection failed, no remote listener found
0265 MQFB_APPL_CANNOT_BE_STARTED - trigger problem - url
0271 MQFB_XMIT_Q_MSG_ERROR - you can't write to a Xmit Q.
65536, x'10000 MQFB_APPL_FIRST

MQ v 5.3, "Messages", chapter 8, 'API completion and reason codes', page 111 [120/223]

url; "Messages" On-Line

2058 - You Can't Spell The Queue Manager Name Right 2059 - You Can't Get To That Queue Manager From Here (using Bindings) 2085 - You Can't Spell The Queue Name Right 2035 - You Can't Do That (verbose) 2033 - This Queue Is Empty (Or Might As Well Be) 2538 - listener is not running on server (client connection attempted)

Client envir : 2009, 2018, 2019 2033, 2119, 2080, 2079, 2016, 2051, 2059, 2162

API CC's & RC's : on-line.

Amunt! Top Amunt!
MQ Best Practices

Best practices experts chat.

More best practices:

Few come from The top 15 WebSphere MQ best practices - gracias, Francisco !

More best practices : shared queues and application programs.

Mind there are MB Best Practices also, and MQ @ HACMP Best Practices too.

Amunt! Top Amunt!

Specifies whether the message-channel-agent program on an outbound MCA channel should run as a thread or a process. {Jeff improved}
PROCESS - The message channel agent runs as a separate process
THREAD - The message channel agent runs as a separate thread

In situations where a threaded listener is required to service a large number of incoming requests, resources can become strained. In this case, you should use multiple listener processes and target incoming requests at specific listeners though the port number specified on the listener.

MQSC Command Reference, SC34-6598-00, page 135 [155/501]

Channel type : Sender (SDR), Receiver (RCVR), Server (SVR), Requester (RQSTR), Cluster-Sender (CLUSSDR), Cluster-Receiver (CLUSRCVR).

Have to choose :

On the Sender channel MCA, define the MCATYPE as Thread, instead of Process, as performance is better.
Read "Running channels as processes or threads", page 168, (5.3) Intercommunication.

If all channels are run as threads under one MQ listener, a failure of the listener for any reason will cause all channel connections to be temporarily lost. This can be prevented by balancing the threaded channel connections across two or more listener processes, thus enabling other connections to keep running. If each sender channel is run as a separate process, the failure of the listener for that process will affect only that specific channel connection.

If you specify "process" on the channel definition, a RUNMQCHL process is started.
If you specify "thread", the MCA runs on a thread of the AMQRMPPA process, or of the RUNMQCHI process if MQNOREMPOOL is specified.
On the machine that receives the inbound allocates, the MCA runs as a thread or process depending on whether you use RUNMQLSR or inetd respectively.

Amunt! Top Amunt!
Listener bits

runmqlsr listens for new connections, then hands them off to amqrmppa. If you stop a listener, it has no impact on channels already running, but new incoming connections obviously will fail.

I prefer 'Admin' channels to have their own listener.

Multiple listeners

I have multiple Listeners on my Edge Queue Manager. Each incoming connection from another company has its own RCVR channel, and each company is told to use a specific port into my QM. Firewall rules prevent them from trying others.

Compte : "endmqlsr" ends all qmgr listeners - use GUI to stop a specific one

Backlog parameter

The backlog number would only apply for a MQ listener. After a listener program (like the MQ listener runmqlsr) has done a bind to a port like 1414, it will then call the listen() function to convert the socket into a passive or listening socket. One of the arguments that the program gives to the listen function is a backlog count. This number is used by the TCP implementation to create a unique backlog queue for this specific listening socket. So if you have 3 MQ listeners on say port 1414, 1415, 1416, each listener has its own backlog queue. This backlog queue is used to store partially established connections or established connections that have not been accepted by the MQ listener program. So this backlog count is just specific to an MQ listener and is used to adjust how many TCP connections that the listener has not accepted can queue up until they are discarded.

So you would probably want to consider adjusting the backlog number on a MQ listener if you feel that your listeners are getting overwhelmed with connection requests and you are finding evidence that some of these TCP connection requests to your listener are being dropped.

4 : DISPLAY LISTENER(*) all AMQ8630: Ver detalles de información del escucha. LISTENER(MB7QMGR) CONTROL(QMGR) TRPTYPE(TCP) PORT(2414) IPADDR( ) BACKLOG(0) DESCR( ) ALTDATE(2012-05-02) ALTTIME(15.34.07)
runmqlsr vs inetd

The runmqlsr has a much smaller overhead of connecting to and disconnecting from the queue manager because it only uses a single thread per connection rather than an entire process. A inetd listener has a significantly smaller capacity because of the need to create a new process for every client.
Channels can be started by using the INETD or the RUNMQLSR listener. INETD initiated channels use between 5 and 10 times more memory than RUNMQLSR channels.

MQ for AIX v6.0 - performance evaluations

Starting and stopping services and listeners

You can now start and stop listeners and services using the START and STOP MQSC commands. However, the old commands strmqcsv, endmqcsv, runmqchi, runmqlsr, endmqlsr, and runmqtrm are still supported.

MQ v6.0 - migration information

If you specify "process" on the channel definition, a RUNMQCHL process is started. If you specify "thread", the MCA runs on a thread of the AMQRMPPA process, or of the RUNMQCHI process if MQNOREMPOOL is specified. On the machine that receives the inbound allocates, the MCA runs as a thread or process depending on whether you use RUNMQLSR or inetd respectively.

MQ v6.0 - intercommunication

Scan for MQ listeners

Guess it has to be done using MQ_CONNX ! Structure has to be similar to Delphi multi-threading, ain't I right ? We can use WireShark to learn the details (and post them here) {Server2Server or Client2Server}

Codi "c" per MQ

 Save Queue Manager :

 Event Monitor :

 Work Load Generator : { can send a SWIFT message }

Message Inspector

Has to be capable of reading

(Delphi) Event Monitor

We start a Delphi graphical program. It starts a TCP server, listening on a given port. Also, on this PC we have a MQ shared cluster queue, with a name as EventAlarmQ.

On a remote q mgr, an event occurs, as when a queue depth is reached, and a "event" message is written into a local queue. As this queue is defined as "trigger", a local application is launched. This code sends a message to EventAlarmQ, with a Queue Manager parameter included (maybe also a queue index).

On the Monitor pc, the msg reception triggers our "client" code. It reads the message text, and sends it to the TCP (local) server.

The delphi code gets the (remote) queue identifier, and reads the event message. Finaly, this message gets displayed.

Amunt! Top Amunt!
Q replication : DB2 table replication


q replication simple schema

Amunt! Top Amunt!
FTP sobre MQ

Since MQ v 6.0, we have Client File transfer & Server File transfer, but only under windows and linux x86 platform servers

A \\mq\bin we have :

To see the complete syntax enter the command without any parameters

url, url, mqftsnd

c:\MQ\bin> mqftrcv AMQ7783: Queue name required. mqftrcv -q QueueName [-m QMgrName] [-a | -l | -i | -o | [[-g | -e] [-y]] | -d] [-v] [-u MsgId] [-c CorrelId] [-s Comments] [-r FileName] [-f FileName]

RCV params

c:\MQ\bin> mqftsnd AMQ7783: Queue name required. mqftsnd -q QueueName The local name of the destination queue [-m QMgrName] The name of the queue manager that has access to the file at it's origin [-t TargetQMgrName] The name of the queue manager that hosts the destination queue [-v] Return the CorrelId of the file [-l MsgLength] The maximum size of a segmented message in bytes [-p yes | no | queue] Message persistency [-s Comments] An character string that contains user information relevant to the file being sent -f FileName The name of the file to be transmitted

Uses "Format : MQHRF2 " and "<FILENAME>nom_fitxer.txt</FILENAME>"

Can be used within your own script/batch files to (1) send, (2) list or (3) receive files:

Managed FTP

Managed File Transfer is MQFTE !

FTP from MB

File Extender, para manejar archivos con Message Broker.

File processing options with MB File Extender

IBM WebSphere Message Broker File Extender is a set of plug-in nodes designed to handle files residing on the same file system as the Message Broker run time. WebSphere Message Broker File Extender extends the capabilities of WebSphere Business Integration Message Broker into the domain of files.

File Extender [jj]

FTP from PHP

PHP accesing FTP

Amunt! Top Amunt!
PHP reaches MQ

Think of PHP as "web version of Perl" ...

I know that it is easy to execute MQ command line calls from within PHP (or any other scripting language)

Linking WebSphere MQ to PHP : url - use our existing web service to take the requests from external vendors and push their XML data back into the queue inside our firewall - mqseries client library for PHP : url.

01 $mq_host_ip = ''; 02 $queue_name = 'HOST.REMOTE.Q'; 03 $mq_server = 'WBRK_QM_U49'; 04 $mqcno = array( 05 'Version' => MQSERIES_MQCNO_VERSION_2, 06 'Options' => MQSERIES_MQCNO_STANDARD_BINDING, 07 'MQCD' => array( 08 'ChannelName' => 'CLIENT.CHANNEL', 09 'ConnectionName' => $mq_host_ip, 10 'TransportType' => MQSERIES_MQXPT_TCP 11 ) 12 ); 13 14 // Connect to the MQ server 15 mqseries_connx( $mq_server, $mqcno, $conn, $comp_code, $reason ) ; 16 if ( $comp_code !== MQSERIES_MQCC_OK ) { 17 trigger_error( 'Cannot open connection to server: '.$mq_server, E_USER_ERROR ) ; 18 } else { 19 echo 'Connection good!' ; 20 }

CPAN MQ Engineering group.

Philippe Tjon-A-Hen (Joomla user) has a very good PHP page, with lots of good PHP samples

PHP install

On getting started he says: to compile the extension in your PHP, do as follows

See PHP install and PFP for MQ install.

PHP samples

Here are the samples (and API documentation):

To start with we define an array with connect options.

$mqcno = array ( 'StrucId' => MQSERIES_MQCNO_STRUC_ID, 'Version' => MQSERIES_MQCNO_VERSION_2, 'Options' => MQSERIES_MQCNO_STANDARD_BINDING, 'MQCD' => array( 'ChannelName' => 'D800MQ.CLIENT', 'ConnectionName' => 'localhost', 'TransportType' => MQSERIES_MQXPT_TCP ) ) ;

Once that is setup we can call the mqseries_connx method.

mqseries_connx( 'D800MQ', & $mqcno, & $conn, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s", $comp_code, $reason, mqseries_strerror( $reason ) ) ; }

Next two calls are to illustrate how different mqseries_open methods work. The first opens an object of type queue manager for inquiry. The returned $obj handle can then be use as an input parameter when calling the inq method.

$mqods = array( 'ObjectType' => MQSERIES_MQOT_Q_MGR ) ; mqseries_open( $conn, & $mqods, MQSERIES_MQOO_INQUIRE | MQSERIES_MQOO_FAIL_IF_QUIESCING, & $obj, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s", $comp_code, $reason, mqseries_strerror( $reason ) ) ; exit; }

The second open simply opens a queue residing on the connected queue manager. This can either be a local queue, remote queue or even a queue alias.

$mqods = array( 'ObjectName' => 'TESTQ', 'ObjectQMgrName' => 'D800MQ' ) ; mqseries_open( $conn, & $mqods, MQSERIES_MQOO_INQUIRE | MQSERIES_MQOO_INPUT_AS_Q_DEF | MQSERIES_MQOO_FAIL_IF_QUIESCING | MQSERIES_MQOO_OUTPUT, & $obj_snd, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s", $comp_code, $reason, mqseries_strerror( $reason ) ) ; exit; }

Important here is the $obj and $obj_snd parameters. These are "call by reference" passed to the open methods. Afther successful completion of the method these hold the MQSeries object handle, which should be used when calling methods that work on mqseries objects.

In the next part an inquiry is made on the Queue Manager object and on the Queue object.

$int_attr = array(); $char_attr = ""; mqseries_inq( $conn, $obj, 1, array( MQSERIES_MQCA_Q_MGR_NAME ), 0, & $int_attr, 48, & $char_attr, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf("CompCode:%d Reason:%d Text:%s", $comp_code, $reason, mqseries_strerror( $reason ) ) ; } else { echo "INQ QManager name result ".$char_attr.""; } mqseries_inq ( $conn, $obj_snd, 2, array( MQSERIES_MQCA_Q_NAME, MQSERIES_MQIA_MAX_Q_DEPTH ), 1, & $int_attr, 48, & $char_attr, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s", $comp_code, $reason, mqseries_strerror( $reason ) ) ; } else { echo "INQ TESTQ result qname=" .$char_attr ." max queue depth=" .$int_attr[0]." " ; }

Note the 48 as the size of the expected character attribute. This is not the size of the &char_attr itself as in PHP we cannot specify a buffer. The parameter is needed to allocate enough memory that the method can succeed.

Finally we close the opened objects. Garbage collection is also done by the extention not closing object or connection will be closed by the extention.

mqseries_close( $conn, $obj, MQSERIES_MQCO_NONE, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s\n", $comp_code, $reason, mqseries_strerror( $reason ) ) ; }

And finally we close the connection.

mqseries_disc( $conn, & $comp_code, & $reason ) ; if ( $comp_code !== MQSERIES_MQCC_OK ) { printf( "CompCode:%d Reason:%d Text:%s\n", $comp_code, $reason, mqseries_strerror( $reason ) ) ; }
PHP at MQ links

mqseries Functions

PHP at RH v6.1 and MQ des PHP at RH v6.1

Amunt! Top Amunt!
Access MQ using JavaScript / node.js

Investigar callback : MQCB() i MQCTL() - see sg24-7583, v7 enhancements

CICS samples, from CICS Integration with MQ

Sample \\mq\tools\c\samples\amqscbf0.c code ...

.Net, C# & MQ : amqmdnet

MQ Solutions in a Microsoft .NET Environment - 7012 redbook.

Code Project : client/server sample, synchronization,

.Net support pack : MA7P

Amunt! Top Amunt!
Tools / Eines
my tools
clients esgotadors



Results :

Millores al MQ - my MQ wish-list

Amunt! Top Amunt!

Llista de certificacions, per número.

Tinc :

url, url.

System Administrator - WebSphere MQ V5.3 - Test 294. withdrawn Dec 31, 2006 => 994. Solution Designer - WebSphere MQ V5.3 - Test 296. withdrawn Dec 31, 2006 No update. Solution Developer - WebSphere MQ V5.3 - Test 297. withdrawn Dec 31, 2006 tinc LAS 2006 => 996. Application Connectivity (MOM) Certified System Administrator WebSphere MQ V6.0 *** #994 tinc MAD 2007 Certified Solution Designer WebSphere MQ V6.0 *** #996 tinc BCN 2008 Certified System Administrator WebSphere Message Broker V6.0 *** #998 Certified Solution Developer WebSphere Message Broker V6.0 *** #997

2012 :

996 test - MQ v 6.0 Solution Design

996, objectives, DevWorks.

998 test - Certified System Administrator

998 objectives, assessment tests, training resources

Section 1 - Planning, Installation and Migration (18%) 1. Plan/design for topology 2. Define requirements for version control 3. Plan the environment and required hardware 4. Install and verify successful installation of WebSphere Message Broker V6.0 5. Migrate brokers, message flows and message sets from prior versions of the product to WebSphere Message Broker V6.0 Section 2 - Configuration (27%) 1. Implement supported transport protocols (e.g., MQ, JMS, HTTP, HTTPS, multicast) 2. Define and implement requirements for broker and application databases 3. Create, delete, modify, start and stop configuration managers, brokers and user name servers 4. Establish Configuration Manager domains 5. Create, delete and modify execution groups 6. Implement Publish/Subscribe tasks such as topics, Access Control Lists (ACLs) and managing subscriptions 7. Create and modify a broker topology (containing collectives, cloned brokers and broker connections) 8. Create, delete, modify and list Configuration Manager Access Control Lists (ACLs) Section 3 - Deployment, Administration and Operations (37%) 1. Understand the capabilities of Configuration Manager Proxy (CMP) 2. Define and write scripts 3. Monitor and query the status of various components 4. Setup Broker to produce statistical and accounting data 5. Modify the configurable properties of broker archive files 6. Deploy broker archive files to execution groups 7. Deploy broker configuration and the topology 8. Remove deployed children from a broker or an execution group 9. List deployed resources on brokers 10. Stop or start execution groups or message flows 11. Use IBM processes to apply new versions, fixpacks, fixes, support pacs to enhance products 12. Back-up the relevant information so that a working Message Broker environment can be restored in the event of a disaster Section 4 - Problem Determination (18%) 1. Implement appropriate problem determination aids 2. Determine message flow behavior with respect to error handling 3. Generate and interpret user trace on message flows 4. Cancel all outstanding deploys 5. Resolve broker topology issues such as a UUID mismatch 6. Generate IBM service trace for the broker, Configuration Manager, the User Name Server and Message Brokers Toolkit components 7. Analyze WebSphere Message Broker entries in the system log

Amunt! Top Amunt!
AMS = Advanced Message Security

MQ Advanced Message Security v 7.0.1 documentation

Amunt! Top Amunt!
Auditoria MQ (assessment = avaluació, valoració) or HealthCheck
Analisi situació actual


Dubtes Amunt! Top Amunt!

Com saber si passen missatges (de dades) per un canal (de cluster) ?

Com saber si s'estan escrivint/treient missatges en una cua ?

No funciona MO71 amb MQ v 7.5 ?
Com visualitzar si un QMGR te SingleWrite o TripoleWrite (runtime) ?
Com era la comanda per re-construir els objectes de sistema del gestor ?

Resposta : strmqm -c qmgr-name

Que es HiperVisor per RH ?
per a que serveix el CSSID del gestor ?
com visualitzar el Local MQM SID actual ?
A vegades trobo un FDC amb:
Active LockFile MQM SID 0012F6D0 532D312D 352D3231 2D323833 S-1-5-21-283 0012F6E0 37363437 3032372D 32333535 36313134 7647027-23556114 0012F6F0 39322D32 35313032 34313739 342D3130 92-2510241794-10 0012F700 30363030 36000000 00000000 867815FB 06006.......†x.û 0012F710 9D88CD01 867815FB 9D88CD01 51756575 ˆ..†x.ûˆ..Queu 0012F720 654D616E 61676572 53746174 75730000 eManagerStatus.. 0012F730 00000000 00000000 ........ Local MQM SID 0012F330 532D312D 352D3231 S-1-5-21 0012F340 2D323833 37363437 3032372D 32333535 -2837647027-2355 0012F350 36313134 39322D32 35313032 34313739 611492-251024179 0012F360 342D3130 3036004E 10020000 01000000 4-1006.N........ 0012F370 C4F41200 A4F31200 04010000 A0F31200 .ô..¤ó...... ó.. 0012F380 C8F51200 509FB500 EE79834E 09000000 .õ..PŸµ.îyƒN ... 0012F390 00000000 00000000 1013B600 ..........¶.
Velocitat màxima d'un canal (amb Gigabit ethernet a sota) ?

35 MB/sec !

rao MQ incorpora pub/sub - JMS & Sun ?
Diferencia entre MAXINST i MAXINSTC ? [MQRC=2537]
Què és DQM ?
Què és "Cuenta conexión" (QuickView) ?
Com saber si un gestor de cues és de 32 o de 64 bits ?
Com solucionar tcp/ip rc's 10054 (peer reset) + 10038 (no socket) en la máquina local ? {eci ago'09, lpm sep'09}

Solution: Add System Environment variable & reboot:

Set sender channel MCA type to Process/Thread

Can you, on your server, get process explorer (www.sysinternals.com), run it, select the listener (runmqlsr) in it, change lower pane view to DLLS, and View->Select Columns->Dll tick the box 'Path'.


Change Listener control : [ CONTROL( QMGR | MANUAL | STARTONLY ) ]

PMR 39250,756,000
MQ uses Channel Pooling mechanism (AMQRMPPA) to service incoming connection requests. Channel pooling enables the Queue Manager to distribute the MQ responder threads among multiple AMQRMPPA processes and evenly handle the volume of the inbound connections. When channel pooling is disabled, all the responder threads are spawned in a single MQ listener process, as opposed to distributing the load among multiple AMQRMPPA processes when channel pooling is enabled. This is a known problem with winsock libraries being corrupted by outside products in MQ, like Symantec Personal Firewall, VPN software, SINE, etc. Apparently these applications over-write something in the WinSock libraries which cause MQ channels to break the connection.
Setting this variable will force all new listener threads to be handled directly by the runmqlsr process rather than spawning off new threads in the pooling process amqrmppa. Also if you specify "thread", the MCA runs on a thread of the RUNMQCHI process if MQNOREMPOOL is specified (otherwise MCA runs on a thread of the AMQRMPPA process).
Per a que és la cua SYSTEM.QSG.TRANSMIT.QUEUE ?
Que és exactament un "qmgr cold startup" ?

Quina cua fa servir el MQexplorer ?


Quina cua es fa servir per crear remotament una cua ?


Perd missatges el MQ ?
Al QM1, crear QA1, cua alias on posa missatges el client. Al QM2, crear QL2, destinació dels missatges.

  • omplir QL2 - que fa QM2 ?
  • esborrar QL2 - que fa QM2 ?
  • omplir DLQ at QM2 - que fa QM2 ?

En un cas "normal", podem dir que hem construit un sistema que purga els missatges.
In this scenario, you have directed the remote queue manager discard the messages.

Resposta : no si el missatge es persistent. S'atura el canal !

Per a que serveix el ResolvedQName del PMO/GMO/OD ?
Com comprovar el mecanisme de BackOut ?

Resposta : s'implementa a ma, com a backout.c

Client connection attempts (authority) problems => turn on authority events.


Que passa si es omple la DLQ ?

Resposta : si el missatge es persistent, s'atura el canal.

Com controlar els objectes als que pot accedir un usuari que entra via un SVRCONN ?

Resposta : setmqaut

Extended Transactional Client (XA) url
Que fa el AMQCRSTA al Solaris, en el lloc del Listener ?
En crear un gestor, tenim un parametre que és
-ls LogSecondaryFiles The log files allocated when the primary files are exhausted.

Per a que serveix ?

Com fer que els paquets no es desordenin ?

Resposta : message groups

Quin tamany té un paquet de COA i/o COD ?

Resposta : 0 bytes, només capçalera !

Com és que una cua de transmissió es posa GET(DISABLED) ?

Resposta : el altre cantó és al z/OS

Solució : parar el canal en el cantó recepció, posant-lo no INACTIVE sino STOPPED. I re-engegar-lo.

Cuando creamos un gestor de colas mediante Scripts, tiene arranque manual - como hacerlo automático ?

Resposta :
\\HKLM\Software\IBM\MQSeries\CurrentVersion\Configuration\QueueManager\<nom>\InstanceData /v Startup /r REG_SZ /d 1
amqmdain auto <qmgrname>

amqmdain is the only supported way to update the registry on Windows

Que fer quan trobem al log un MQFB_APPL_FIRST ?

Resposta : mirar el log d'errors de MB

Una cua dinamica pot contenir un missatge persistent ?

Resposta : Nop !

Be aware however that a dynamic replyto queue will not accept persistent messages ...
Qué nassos és "AMQZFUMA = Object authority manager (OAM)"
Resposta : sends rc = 2035 ! Read here
Es pot compartir en cluster una cua Remota ?

Resposta : of course !

Pot un MQ_Client escriure en una cua amb definició múltiple dins un cluster ?

Resposta : of course.

FASTPATH - que és ?
Que vol dir "AMQ7017: Log not available." ?
Un MQ Client - on escriu els seus problemes, tipus AMQERR01.LOG ?

Resposta : <mq install directory>\Errors

És millor tenir un cua amb 3.000 missatges o 3.000 cues amb un missatge ?

Resposta : millor 3.000 cues, però l'aplicació consumidora ha de saber on és el seu missatge ...

Si una aplicació determina que els seus missatges han de anar per ordre, es a dir que tenen "affinities" entre ells, com ha de obrir una cua de cluster per a que tots els missatges segueixin el primer ?

Resposta : specify MQOO_BIND_ON_OPEN.

MQ v6 QM Clusters, SC34-6589-01, page 60 [78/201]

On es troben dins el MQ les MQ JMS libraries ?
Si una cua Alias es NO Persistent, però apunta a una cua Local que SI es Persistent, es salvarà el missatge d'una caiguda del sistema ? I si és a l'inrevés ?

Resposta : es fan servir les caracteristiques de la cua on es fa el MQ_Open() !

Un canal ha de tenir el mateix nom als dos cantons de la definició ? Si es comprova ... qui ho comprova ? ... qué més es comprova ?
Hay 35.000 mensajes en una cola. Necesito reiniciar la máquina. Se perderán los mensajes ? (cómo saber si son persistentes)
Can we create a dynamic Remote queue ?
Com accedir a MQ v 6.0 des Rexx ? [\\Rexx\MQI\SEBAS.CMD]
OS/2 had MA31; w/NT had MA77. Sample code.
If a Sender channel has a Host Name (not an IP + port) specified in the CONNAME field, how many times will the DNS be used ?

Resposta : everytime the channel is started and it opens the TCP socket

AMQ9002 (channel started) followed by immediate AMQ9001 (channel stopped) ... SSL ? How to Trace ?
Channel has SSLCAUTH(REQUIRED) !? QMGR has SSLKEYR path specified, but does not exist on disk ...

Sender side of the channel had LOGs filled with "RESOLVE" problems.

Com faig per instalar només MQExplorer ? Suposo que cal instalar també el Client ...
No - en v6 el Explorer va amb Eclipse. Però ens cal el MQ Server per Windows !
Com es fa servir RCRMQOBJ ? Amb Log lineal funciona sempre. Amb circular, si no s'han trepitjat els logs.
Com es fa per fer un MULTI-HOP ? Page 14, Intercommunication v 6.0
SiBus == Java-only MQ. Qui ho va imposar ?

NameLists ? ("Acc")

Un Client MQ versió 5.3 pot anar contra un MQ Server versió 6.0 ?

I un Client versió 6 contra un Server versió 5.3 ?

Explicació detallada del Requester Channel. Can be started from the transmiter end ? Quan es fa servir ?
Display MQ counter using WMI ! Code here
Alert / event monitor - get code from "Event Monitorig" book.
HeartBeat and KeepAlive
Pot un MQ (AIX al BS) conectarse a 2 màquines W2K que estiguin en un Cluster de 2 QMgrs's, en el lloc que abans hi havia una sola màquina, sense fer cap canvi ?
Que es posa en el camp "Destination Queue Manager" quan s'escriu en una cua amb definicions múltiples en un cluster ? En Angel diu que el Qmgr local ...
El camp de destinació no s'escriu mai : s'agafa de la cua remota on es posa el missatge. Quan es treballa en un cluster, no hi es.
Com s'esborra "completament" (o "correctament") un Cluster (de MQ Explorer) ?
Vaig esborrar els 2 QMGRs, però el Cluster no es deivaxa ...

Hide, then try to Un-Hide : it's gone !

T30 em dona - TCP/IP return code (ioctlsocket) has been 10038 (X'2736')
MS knowledge base article Q319952
Search IBM ! (24 results)
Nice description

Apparently the problem is related to the unability of Windows to pass an open socket between processes in some circumstances. Setting MQNOREMPOOL keeps the socket in the listener process, the handler for the socket is a thread. In my particular case I suspect the presence of the Aventail transparent socksifier software (within IBM aka IBM SINE client). This software is known to break sockets based programs in several ways (e.g. cygwin's sshd) even if it is not active.
The 10038 return code indicates that the MQ listener pool has had trouble passing the initial socket from the listener to the pool. This is rather common in environments that have a firewall. This can be worked around by disabling the pool with an environment variable: set MQNOREMPOOL=1 : System Properties + Advanced + System Variables. 14/10/2005 Also, Aventail removed. OK ! (also X-Server runs again)


Es pot calcular el throughput d'una cua ? I d'un canal ?

Que tal 35 MB/sec ? Poc en un entorn "gigabit" ...

Pot una aplicació client conectarse simultaneament a diversos queue managers ?

Resposta : of course ! "clients_esgotadors"

Es millor tenir 1.000 threads en Wait() de MQGET() o fer un Trigger de un Process a l'arribada de cada missatge ? I si parlem de 200 missatges per segon ?
Detalls del 2-way commit
XA (distributed) transactions

From here :
A technique for ensuring that a transaction successfully updates all appropriate files in a distributed database environment. All DBMSs involved in the transaction first confirm that the transaction has been received and is recoverable (stored on disk). Then each DBMS is told to commit the transaction (do the actual updating).
Traditionally, two-phase-commit meant updating databases in two or more servers, but the term is also applied to updating two or more different databases within the same server.

A couple of notes on 2-phase commit; it is used

  • with queue manager as coordinator, when the MQBEGIN API call is used to begin a unit of work. In this case the program must be local (ie. a server-bound app).
  • with an external transaction coordinator software product. In this case the program can run local or remote (ie. server-bound or client-bound app). Let's call these 2 subcases. In the remote subcase only, the Extended Transactional Client (ETC) is required to enable external 2-phase commit processing. The ETC is a separate installable item.
Configuring an extended transactional client - ETC link [publib, csq08cfg]

What is the difference between client mode and binding mode in MQ ?

In client mode you use a channel connection via network (may be on the local machine), to connect to a QMgr.
In bindings mode you use a API connection (via shared memory) to a local QMgr.

The bindings method is faster, more secure, uses two-phase-commit and works without active listener.
The client mode is able to connect to QMgrs which are not local to the application.

Dubtes BdE :

Nociones de programación JMS
Ejemplo de creación de un MDB
Configuración en WAS del Message Listener Service. Detalle de los parámetros de los listener ports y los pools de los threads de los MDBs.
Conexiones de MQ cliente en WAS
Revisión de las definiciones hechas en MQ JMS provider: definiciones a nivel de server, celda.
En caso de tener clusters, cómo se recuperan los mensajes si se cae uno de los clones.
Suplantación de usuario desde WAS: JMS o APIs de MQ.
Clusters de MQ. Clusters de AIX. Clusters de WIN.
Colas compartidas.
Automatización de Retrys de canales
RRS o no para commit en DB2 y MQ
MQCOMMIT cada "n" PUTS (1380?). Implicaciones en el tráfico de ficheros.
Qué hacer si se llena una cola de aplicación.
Qué hacer si algo va mal con ficheros del sistema (bootstrap, pageset, .)
¿Se puede crear una cola dinámica remota a otro QMGR?
¿Al crear una cola dinámica se puede modificar algún parámetro de la definición del modelo ?
Mensajes en la dead-letter-queue sin razón aparente.
Error en triggering.
Consideraciones en el paso de WAS de internet a red interna con MQ.
Consideraciones al conectar MQ de HOST con una entidad externa con LU.6.2.
Políticas de BACKUP y ARCHIVE LOG.
Si se instala en cluster activo pasivo de MQ en AIX sin ipcs, hay problemas. Se instala el sofware en los nodos locales y en grupo de volumenes var/mqm.
¿Como se aplican parches en HACMP ? Migrar MQ de v 5.3 a v 6 ?
Si se ejecuta /opt/mqm/bin/amqiclen -v -c -m qmgr_name < /var/mqm/mqs.ini sin necesidad, pasa algo?.
Al parar MQ con kill -9, ¿ es necesario parar el controlador de proceso amqzxma0, el último?.

Dubtes Acc

a. Colas persistentes/no persistentes.
b. Control de backout. MQ/DB2/CICS commitment.
c. Utilidad de los Namelists.
d. Colas de iniciación en host/NT.
e. CKTI - Monitorización.
f. CICS Bridge/CICS adapter.
g. Como gestionar la longitud de los mensajes sin desperdiciar memoria en COBOL-CICS. Punteros / campos de longitud variable.
h. Seguridad en MQ. Comunicación TCP-IP/mainframe. RACF que nos proporciona, es necesario implementar seguridad en la aplicación.
i. Pruebas de carga.

Problema Acc

1) accedim a Host OK des Java
2) desconectem el cable - the MQGET() produces a RC = 2009, MQRC_CONNECTION_BROKEN.
3) el programa fa un DISC() i després un CONN()
4) al Host s'observen 2 canals

Solució : Have a look at the adoptmca attributes of the qmgr here: url

Dubtes T-sys

Antes :

Aplicacio <--> AIX + CICS Transaction Gateway <--> z/OS + CICS

Despues :

Aplicacio <---> AIX + WAS + MQ Client <---> AIX + MQ Server <---> z/OS + MQ Bridge + MQ Server + CICS
  • accés a CICS des MQ => MQ Bridge ?
  • MQ Bridge => MQ Server at z/OS ?
  • credencials a cada msg => LTPA token ? RACF ??
    Security, SC34-6588.
  • Synch Beans => simulació d'entorn síncrone sobre MQ ?

    El RACF se puede ver como un servicio LDAP !

CBE [thomas]

How to connect to a Server-Channel without MQ-server ?

MQIPT, MSMQ, JMS bridge, Active MQ, ...

Amunt! Top Amunt!
Assumptes pendents
No sé fer (encara) o punts a millorar

Amunt! Top Amunt!
Books On-Line

V 6.0 Information Center

Amunt! Top Amunt!
Sonic MQ

Sonic MQ [\\MQ\Competencia\Sonic MQ]

mqjeff : JMS used with a SonicMQ JMSProvider would feed the JMSInput node. At that point, there would be no more Sonic code at all. Everything is now Broker. This also requires no user code of any kind that knows anything about SonicMQ.
Broker can easily, using a JMS->MQ Transformation node, convert the JMS headers into a set of MQ headers, which could then be output using an MQOutput node.
Three Broker nodes, all fully supported, no custom user code at all....


uSoft - MSMQ Amunt! Top Amunt!

Microsoft Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues. MSMQ provides more reliable message delivery, efficient routing, security, and priority-based messaging. It can be used to implement solutions for both asynchronous and synchronous messaging scenarios.

To install MSMQ :
Go to Control Panel, then Add/Remove Programs. Select Windows Components, and then Message Queuing Services (W2K) or Message Queuing (WXP).

To verify MSMQ is installed :
Right click on My PC, select Manage. Expand Services and Message Queuing shall be visible, with Outgoing Queues, Private Queues, System Queues and Message Queuing Triggers under it.

Problems :
  • If Unable to start MSMQ Service, error code 0x42C comes, open Event Viewer : MS DTC did not start (Distributed Transaction Coordinator).
    Run msdtc -resetlog to fix it, and Mesage Queuing Service shall start.
  • MSMQ HTTP Support requires IIS
  • ZA : MS DTC is trying to act as a Server
MSMQ code samples
  • see SDK [ @ P4 & T42 - c:\Microsoft Platform SDK\samples\NerDS\MessageQueuing ]
  • MSMQApiTest.dsp [ P4:\msmq\api_test ], MSMQApiTest.cpp

    API test

Descripció - [***]

Interacting with Message Queues - dibuixos, conceptes, etc [***]

Download Center

Totes les crides, parametres, DLL's, etc

SAS integration calls and code samples.



uSoft doc


MQ/IBM vs MQ/Microsoft (MSMQ).

Diferencies. Plataformes que accepten cadascún.



Amazon Machine Images (AMIs) are available for the following IBM products: url - MQ no hi es (Abril 2010).

Amunt! Top Amunt!
BizTalk adapter


Amunt! Top Amunt!
Other middleware

See also amqp products

Apache ActiveMQ is an open source (Apache 2.0 licensed) message broker which fully implements the Java Message Service 1.1 (JMS). wiki. Mine.

MOM : RabbitMQ (implementa AMQP), StormMQ, 0MQ ...

Tuxedo (Transactions for Unix, Extended for Distributed Operations) is a middleware platform used to manage distributed transaction processing in distributed computing environments. Tuxedo is a transaction processing system or transaction oriented middleware, or enterprise application server


Habari client libraries ... provide access to standards-based, enterprise quality solutions for distributed messaging.

Amunt! Top Amunt!
MQ light

mq-light @ developer.ibm.com

You can start working with the MQ Light Node.js API by installing it to your working directory using

npm install mqlight@1.0

MQ web

MQ web homepage

Make it possible to administrate your Websphere MQ environment with your favorite browser or programming language

mq web app is the official web application for MQWeb.

Amunt! Top Amunt!
MQ Appliance
IBM MQ Appliance

Amunt! Top Amunt!
Active / pending items I have now
using PCF : get queue depth + set put(disabled) or lower(CLWLPRTY)

Links, urls :

{Peter & Saper & Luisa} Cluster Queue Monitoring sample program (AMQSCLM) : 7.1 7.5
The cluster queue monitoring sample program uses the IPPROCS (open for input process count) value of a queue to determine whether that queue has any consumers. A value greater than 0 indicates that the queue has at least one consuming application attached. Such queues are active. A value of 0 indicates that the queue has no attached consuming programs. Such queues are inactive. The cluster queue monitoring sample program activates a cluster queue by setting the local CLWLPRTY value to 1. The program deactivates a cluster queue by setting its CLWLPRTY value to 0

Specifies the priority of the queue for the purposes of cluster workload distribution. This parameter is valid only for local, remote, and alias queues. The value must be in the range zero through 9 where zero is the lowest priority and 9 is the highest.

queue depth threshold generated alarm

See mq_admin

Amunt! Top Amunt!

Mira que m'envia en Albert :

Number of daily rates quoted 73 151 64 Average daily rate £450 £550 £525 90% of contracts offered a daily rate of more than £303 £350 £425 10% of contracts offered a daily rate of more than £600 £650 £593 UK excluding London average daily rate £400 £400 £450 Number of hourly rates quoted 4 1 9 Average hourly rate £44 £35 £35 90% of contracts offered a hourly rate of more than £36 £35 £21 10% of contracts offered a hourly rate of more than £52 £35 £55 UK excluding London average hourly rate £44 £35 £23

MQ $ in UK : contracts, jobs.

Amunt! Top Amunt!

URLs Amunt! Top Amunt!


Valid HTML 4.01!   Valid CSS! Site under construction. Escriu-me !
Updated 20190531 (a)  
Uf !