Beruflich Dokumente
Kultur Dokumente
Queues
MQSeries defines four types of queues. A queue instance is fully qualified by its
queue manager and queue name.
Local Queue – an actual queue for which storage is allocated.
Remote Queue – a definition of a queue on a different queue manager (acts
somewhat like a pointer)
Alias Queue – another name for a local or remote queue. Typically used to switch
queue destinations without modifying program code
Model Queue – a template whose properties are copied when creating a new
dynamic local queue (“ create queue xxx “like” queue yyy).
Process
· Process defines an application to an MQSeries queue manager. A process definition object
is used for defining applications to be started by a trigger monitor.
· A trigger monitor is a program that listens on an initiation queue and executes commands
named in Process definitions.
Triggers and Process definitions are useful when you don’t want to deploy long-running
programs. Suppose the message rate is very low (several minutes between requests).
Perhaps it is better to instantiate the program for each message, and then let it exit.
Channels
A channel provides a communication path between Queue Managers. There are two types
of channels – Message Channels and MQI channels (also called Client channels).
Message channels – provide a communication path between two queue managers on the
same, or different, platforms.
A message channel can transmit messages in one direction only. If two-way
communication is required between two queue managers, two message channels are
required.
There are six types of message channels:
1. Sender – initiates connection to Receiver
2. Server – Accepts request to start from requester, then becomes Sender
3. Receiver – Passive; waits for initiation sequence form Sender
4. Requester – Active at start, then becomes Receiver
5. Cluster-sender (used amongst Cluster Queue Managers)
6. Cluster-receiver (ditto)
The Sender side of the session is the “transaction coordinator”.
Message channels implement a protocol that includes a commitment protocol.
Channels recover from failure by agreement: they must agree on the last committed unit
of work [would this be harder if channels were bi-directional??]
97
Benefits of Websphere MQ
Interoperabilty
Websphere MQ FFST
What is FFST?
FFST stands for First Failure Support Technology, and is technology within
WebSphere MQ designed to create detailed reports for IBM Service with information
about the current state of a part of a queue manager together with historical data.
What are they for?
They are used to report unexpected events or states encountered by WebSphere
MQ. (Alternatively, they can be generated upon request).
Note that return codes are used for application programmers to inform them of
expected states or errors in a WebSphere MQ application. There are exceptions to
this rule, but as a rule of thumb, FFSTs are used to report something that will need
to be actioned by:
• system administrators – such as where FFSTs report resource issues such as
running low on disk space
• IBM – where FFSTs report a potential code error in WebSphere MQ that (unless
already identified and corrected in existing maintenance) may need correcting
Where are they?
On UNIX systems, they are written to /var/mqm/errors
They are contained in files with the extension .FDC
The file name will begin with AMQ followed by the process id for the process which
reported the error. e.g /var/mqm/errors/AMQ12345.0.FDC – is the first FFST file
produced by a process with ID 12345
What do they contain?
FFST files are text files containing error reports for a single process.
If a single process produces more than one error report, these are all included
within the same FFST file for that process, in the order in which they were
generated.
How should I look at these files?
FFST files are just text files, so your favorite text editor is normally the best place
to start.
97
The tool ffstsummary is also useful – it produces a summary of FFST reports in the
current directory, sorted into time order. This can be a good place to start to see
the errors reported in your errors directory.
For example:
[mqm@test~]$ cd /var/mqm/errors
[mqm@test errors]$ ffstsummary
AMQ21433.0.FDC 2007/04/10 10:05:45 amqzdmaa 21433 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21429.0.FDC 2007/04/10 10:05:45 amqzmur0 21429 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21469.0.FDC 2007/04/10 10:05:45 runmqlsr 21469 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21422.0.FDC 2007/04/10 10:05:45 amqzfuma 21422 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21424.0.FDC 2007/04/10 10:05:45 amqzmuc0 21424 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21431.0.FDC 2007/04/10 10:05:45 amqrrmfa 21431 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21449.0.FDC 2007/04/10 10:05:45 amqzlaa0 21449 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21434.0.FDC 2007/04/10 10:05:45 amqzmgr0 21434 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21452.0.FDC 2007/04/10 10:05:45 runmqchi 21452 2 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21417.0.FDC 2007/04/10 10:05:45 amqzxma0 21417 4 XC338001
xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
[mqm@testerrors]$
The columns in the output above show:
• filename – which FDC file contains the FFST report
• time and date of the report
• process name – name of the process which produced the report
• process and thread ids – for the process which produced the report
• probe id
97
LOGNAME=root
SSH_CONNECTION=::ffff:9.20.94.90 2625 ::ffff:9.20.63.20 22
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/usr/bin/runmqlsr
1. Date and time that this report was produced
For many problems, this is the most useful piece of information – allowing an error
report to be correlated with other known events.
2. hostname for the machine where this report was produced
3. Version and maintenance level for WebSphere MQ
This is useful when comparing an error report against a documented known
problem.
4. Probe ID
This is an internal method of identifying the error report. It identifies a single point
in the WebSphere MQ source code where the report was produced (consisting of
two letters giving a component code, a three digit function code, and a three digit
probe identifier).
This often makes it the best way to uniquely identify the error that the report is
describing. More on this a bit later…
5. Component
this is the bit of WebSphere MQ which produced the report. As with the source
information below, it is generally more useful to us than it is to users, although the
name can sometimes give a useful hint as to the nature of the error report. For
example, in this case where the report is the result of my using Control-C to
generate an interrupt signal, you can see that the component which produced the
report was a signal handler.
6. source information
Although this isn’t information isn’t useful to users, I thought it might be
interesting to highlight that an FFST will identify exactly where it was produced,
down to the source code file, line number and version
7. User id that was running the process which produced the report This is useful
to confirm whether a problem was the result of insufficient user privileges.
8. process name of process which produced the report
97
• Does the time and date of the FFST correspond with any other known events or
occurrences at the same time which may explain the error?
If the FFST identifies a resource issue, such as low disk space, then this will
normally give enough information for a system administrator to identify and correct
the source of the problem.
If you are unable to determine an explanation for the FFST, then a useful next step
is to look to see if others have seen this FFST before, and if so what they found it
to mean and needed to do.
This is where the probe id from the FFST is very useful. In the majority of cases
(for one notable exception, see my discussion on signals below), this will be a
unique eye-catcher for the issue being reported. This means that you can search
for this short string on the WebSphere MQ support site on ibm.com or in the IBM
Support Assistant. Often, this will reveal cases where someone has encountered
this FFST before and the fix that resulted.
Beyond this point, you will most likely need to raise a PMR with IBM Service. It is
useful to send all FFSTs from your system (rather than just the one that you
believe to be of interest), as following the history can be key to resolving an issue.
It is also useful to send the WebSphere MQ system (/var/mqm/errors/AMQ*.LOG)
and queue manager (/var/mqm/qmgrs/errors/AMQ*.LOG) error logs, together with
a clear description of what you are seeing and the impact on the system and your
business.
Signal handling
Generally find the probe id to be a unique identifier for a specific problem. While
this is usually true, one notable exception is FFSTs produced by the signal and
exception handlers.
The signal handler component produces FFSTs to report signals sent to WebSphere
MQ processes. This means that the information in the FFST (such as the probe id
and source code file, line number, etc.) is about the signal handler which caught
the signal, not whatever it was that caused or created the signal.
This is less of a problem if the signal was generated externally to WebSphere MQ,
such as the SIGINT that I generated with Ctrl-C in the example above. The FFST
contains information about the process which was sent the signal and the time and
date of the signal.
97
Websphere MQ XA Configuration
Websphere MQ XA Configuration
Configuring and using XA transactions with WebSphere MQ V6 Classes for Java
Steps Involved:
a. prepare the XA switch files
b. Configure queue manager to load switch files
c. configure the database
Name
A unique string that identifies the resource manager. It may be up to 31 characters
in length. This field must be provided.
Switch File
Name of switch library to use (for example, jdbcdb2.dll). Do not use the full path.
XAOpenString
A String containing data to be passed into the database’s xa_open function. This
parameter is product-specific, and generally contains authentication and
configuration information.
XACloseString
A String containing data to be passed into the database’s xa_close function. This
parameter is also product-specific, and is usually empty.
Thread of Control
Set to PROCESS (the default), or to THREAD. The default PROCESS option forces
the queue manager to serialize XA function calls so that only one call per process is
made at any time. The THREAD option offers improved performance if the database
can manage concurrent calls. This setting must match any thread settings in the
XAOpenString
When using Oracle, the XAOpenString is a plus-separated String of the form:
Oracle_XA + required fields + optional fields
Where required fields are Acc=P/user/password (or =P// if a username and
password are not supplied), and SesTm=timeout, which defines the session
timeout after which the transaction is rolled back. Important optional parameters
include a database name, DB=database name, and the thread of control
parameter, threads={true,false}, which specifies if an application is multi-
threaded.
Example:
Oracle_XA+Acc=P/testuser/secret+SesTm=35+DB=TestDB+threads=true
On UNIX platforms, you must manually edit the qm.ini file, which is in
/var/mqm/qmgrs/qmname/, where qmname is the name of the queue manager
being accessed. Add the following stanza to the file:
XAResourceManager:
97
Name=ExampleDB
SwitchFile= < jdbcdb2 or jdbcora >
XAOpenString= < xa open string >
ThreadOfControl= < THREAD | PROCESS >
where the SwitchFile, XAOpenString, and ThreadOfControl parameters have
suitable values for the database being used. No XACloseString is required, and it
does not need to be added to the stanza. Restart the queue manager so this
change will take effect.
You can use multiple stanzas to register multiple datasources.
Example:
XAResourceManager:
Name=OracleDB1
SwitchFile=jdbcora
XAOpenString=+Acc=P/testuser/secret+SesTm=35+DB=testdb+threads=true
ThreadOfControl=THREAD
XAResourceManager:
Name=OracleDB2
SwitchFile=jdbcora
XAOpenString=+Acc=P/testuser/secret+SesTm=35+DB=testdb+threads=true
ThreadOfControl=THREAD
c) Configure the database
Finally, you may need to configure the database.
When using Oracle 9i, you may need to run two scripts, initxa.sql and initjvm.sql,
to configure the database to participate in XA transactions.
In addition, the Oracle user name specified in the XA open String must have
permission to access the DBA_PENDING_TRANSACTIONS table used internally by
the Oracle database to manage transaction recovery. To allow this, as SYSOPER or
SYSDBA, run the command:
GRANT SELECT ON DBA_PENDING_TRANSACTIONS TO USERNAME
Where USERNAME is the user named in the XA open String. Specifying the
username as PUBLIC grants access to all users.
97
Websphere MQ – Queue
Manager Operations
03 Mar
Rate This
Websphere MQ – Local
Queue Operations
Websphere MQ – Transmit
Queue Operations
Websphere MQ – Remote
Queue Operations
Websphere MQ – Sender
Channel Operations
Starting Channel
================
start channel (CHANNEL_NAME)
Stopping Channek
================
stop channel (CHANNEL_NAME)
Status of channel
=================
display chs (CHANNEL_NAME)
Display channel properties
==========================
display channel (CHANNEL_NAME)
Channel in Retrying state
=========================
Stop channel
Reset/resolve channel
Start the channel
Starting newly created channel
==============================
1. ping the remote machine (icmp)
97
New Listner
===========
def listener(LISTENER_NAME) trptype(tcp) port(PORT_NUMBER)
Start listener
===============
start listener (LISTENER_NAME)
Stop Listener
==============
stop listener (LISTENER_NAME)
Listener Status
===============
display lsstatus (LISTENER_NAME)
Websphere MQ – Receiver
Channel Operations
Stopping Channek
================
stop channel (CHANNEL_NAME)
Status of channel
=================
display chs (CHANNEL_NAME)
Display channel properties
==========================
display channel (CHANNEL_NAME)
97
There are two basic types of Point-to-Point Messaging systems. The first one
involves a client that directly sends a message to another client. The second and
more common implementation is based on the concept of a Message Queue. Such
a system is shown in Figure 2.
The point to note in Point-to-Point messaging is that, even though there may be
multiple Senders of messages, there is only a single Receiver for the messages.
Request-Reply Messaging
When an application sends a message and expects to receive a message in return,
Request-Reply Messaging can be used. This is the standard synchronous object-
messaging format. This messaging model is often defined as a subset of one of the
other two models. JMS does not explicitly support Request-Reply Messaging,
though it allows it in the context of the other methods.
The Java Message Service (JMS) Architecture
Figure 3 shows the JMS Architecture. As shown in Figure 3, JMS Service Providers
implement the JMS interface on top of their messaging services. JMS defines
Queues and Topics, but it does not require the provider to implement both. JMS
thus tries to maximize portability of the solution with as many features as possible.
Websphere MQ v6 Tutorial
97
Note: Both programs do not have to run in the same workstation. Client
workstations usually use a queue manager in a server machine.
Remote Queue:-
The queue which holds the address of the remote queue manager where the
message has to be sent or delivered.
It is a logical queue where we cannot store the messages and get the messages.
Note: To send the messages we use only Remote Queue, none other than this
Message Flow from remote Queue
“Remote queue-> Transmission queue-> Channel->Network receiver channel->
Local queue (finally the message will reach here) “
CHANNEL Channel (123.456)channel name.
CHLTYPE (SDR) sender channel
TRPTYPE (TCP) Transport type using TCP protocol
CONNAME (127.0.0.1)(1414)?the channel will connect to the IP address specified in
the conn name and looks for the queue manager which is having listener, port
number(1414) and connects to the queue manager.
XMITQ (TQ)?the channel will receive the messages from transmission queue
manager.
ALIAS QUEUE:-
Alias queues are not real queues but they are definitions. They are used to assign
different names to the same physical queue.
Advantages of alias queue allow multiple programs to work with the same queue
but with different attributes or properties.
Example:
Alias for LQ with different parameters
DEFINE QALIAS (PQ) TARGQ (LQ) GET (DISABLED) PUT (ENABLED)
DEFINE QALIAS (PQ) TARGQ (LQ) PUT (ENABLED) GET (DISABLED)
DEFINE QLOCAL (LQ)
MODEL QUEUE:-
A model queue is not a real queue. It is a collection of attributes that are used
when a dynamic queue is created.
Repository Queue:-
Repository queues have existed since Version 5.1 and Version 2.1 for OS/390. They
97
are used in conjunction with clustering and hold either a full or a partial repository
of queue managers and queue manager objects in a cluster (or group) of queue
managers.
TYPES OF LOCAL QUEUE:-
• Dead letter Queue
• Transmission Queue
• Initiation Queue
• Local Queue.
DEAD-LETTER QUEUE: – the enrooted (or) undelivered messages will be landed in
to the dead letter queue.
We have one control command called runmqdlq.It is a control command which is
used to route the messages through .rul table.
This is called dead letter handler. It is important that we need a dead letter queue
defined for every queue manager.
Note:- For one Queue manager we can’t have two dead letter queues.
We have system defined objects called SYSTEM.DEAD.LETTER.QUEUE. Or we can
use our own dead letter queue. The messages those are landed in the dead letter
header (DLH). By seeing the dead letter header, we can find the reason and the
destination.
RULE TABLE:-
Syntax:- DESTQ(DLQ) DESTQM(222) REASON(*) WAIT(NO) FWDQ(LQ)
FWDQM(222) HEADER(NO)
Runmqdlq:-rule table path
TRANSMISION QUEUE:-TQ will receive messages from Remote queue and hits or
sends the messages to the channel.
CHANNELS:-
It is a Networked program to transmit or pas the messages over the network.
Channel will receive the messages from XMITQ which is defined in the definition of
the channel. Transmission queue is also a local queue.
TYPES OF CHANNELS:-
• Message channels.
• MQI Channels.
97
MESSAGE CHANNELS:-Message channels are one way piping channels. They are
used for sending or receiving the messages. Message channels are unidirectional.
TYPES OF MESSAGE CHANNELS:-
• Sender Channel(SDR)
• Receiver Channel(RCVR)
• Server Channel(SVR)
• Requester Channel(RQSTR)
• Cluster Sender Channel(CLUSSDR)
• Cluster Receiver Channel(CLUSRCVR)
MQI CHANNELS:-These channels are two way piping channels which can send and
receive the messages in both ways.
TYPES:-
• Server Connection Channel (SVRCONN)
• Client Connection Channel (CLNTCONN)
COMBINATION OF CHANNELS:-
• Sender and Receiver
• Server and Requester
• Cluster sender and Cluster Receiver
• Server Receiver
• Sender Requester
LISTENER:-
• It is a service of MQ series
• Every Queue Manager will have a listener defined with a unique port number.
• (Default port number is:-1414)
• Listener acts as a mediator between external application or queue managers
connecting to the queue manager.
• To contact the queue manager we should approach through Listener.
MQI COMMANDS:-
MQI Commands are of three types.
• CONTROL COMMANDS
• SCRIPT COMMANDS
• PCF (programmable command format) COMMANDS.
97
• DISPLAY :-to view all the properties of a particular object or to Display all objects
• DELETE :-to delete created objects
• CLEAR :-to clear the message from the queue
• END :-to come out of the queue manager
• PING :-to check whether other side channel / queue manager is ready to accept
our request.
• START :- to start the particular channel or listener
• STOP :-to stop particular channel or listener
• REFRESH :-used to refresh the security every time after giving or executing, set
mgr or command for queue manager or object
• RESET :-used to reset channel,cluster,queue manager
• RESOLVE :-to resolve the channel which is in indoubt state
• SUSPEND :-to suspend a queue manager from a cluster environment
• RESUME :-to remove a queue manager from a cluster environment
CHANNEL STATES: – Channel states are of 5 types
• Running
• Inactive
• Retrying
• Stopped
• Paused(receiver channel)
1. RUNNING: – before going to Running state the status will be initialization and
binding Initialization:-channel will initiate the listener Binding:-sender channel
binds with receiver, after that it Goes to running state
2. INACTIVE:-we have one attribute called disconnect interval (DISCINT) with 6000
milli seconds (default) and it can be changed as of our convenience. If the channel
is idle for a particular period defined in disconnect interval, the channel will go to
inactive state.
3. RETRYING:-the channel goes to retrying state if the other side queue manager
will not be available, network issue, may be listener not running, may be receiver
channel is in pause state, and may be the receiver channel transportation type is
different…. Etc.
4. PAUSED STATE:- this state is applicable for receiver (RCVR) channel. Paused
state occurs when the receiving queue is full.
97
Note:-
1. If we do any changes to the channels, listeners, queue manager, to effect the
changes we need to stop and then start them.
2. Before starting a channel listener should be in active / running, we can check by
pinging the channel.
3. Ping is used to check whether the receiver is in active state or not.
Syntax: – PING CHANNEL (CHANNEL NAME)
MULTI-HOPPING : ( gate way)
Passing the messages between more than one intermediate queue managers is
called Multi-Hopping.
Note:-
For every queue, except remote queue we have two properties.
1. open input count ( Iproess )
2. open output count ( Oprocss )
3. the application which is connected and putting the messages is called “ O
process “
4. The application which is processing(getting) the messages is calles “ I procss “
PROCEDURE TO CREATE MULTI-HOPPING:-
1. Create a queue manager QM1, QM2, QM3.
2. Start the queue managers QM1, Create a remote queue with attributes local
queue name (Remote Queue Manager) i.e Rname QM3 in RQMname and the
transmission queue called XMITQ (TQ).
3. Create a transmission queue called (TQ)
4. Create a sender channel from (QM1.QM2)
5. In Qm2 create, Create a receiver channel (QM1.QM2)
6. Create a transmission queue with name target queue manager name called
QM3.
7. Create a sender channel from (QM2.QM3) with transmission queue called XMITQ
(QM3)
8. In QM3 create a local queue called (LQ) which is defined in remote queue of QM1
Rqueue(QM1)
9. Create a receiver channel (QM2.QM3)
We should have two listeners in QM2 and QM3.
97
comes to the transmission queue, the queue manager will look at the queue, if it is
triggered the queue manager will fire a trigger message in to initiation
queue(SYSTEM.CHANNEL.INITQ) with the information called trigger type, trigger
data, the channel which is to be fired.
At the initiation queue (SYSTEM.CHANNEL.INITQ) channel initiator will be watching
(monitoring) the initiation queue.
When ever the trigger message comes to initiation queue, the channel initiator will
read the information and initiates the sender MCA (message channel agent).the
sender message channel agent will start the channel (which is mentioned in the
trigger data).
Note:-MCA (message channel agent) is a program which is defined automatically
whenever a queue manager is created.
We have two types of MCA
• SENDER MCA(SDRMCA)
• RECEIVER MCA(RCVRMCA)
CHANNEL INITIATOR:-
It is a process running on a queue manager when queue manager is in running
state. For every queue manager there will only one channel initiator
Note:- 1.In MQseries 5.3 we have to run this channel initiator as a separate
process for every queue manager.
2.If we use “&” any process will run at background. this applicable for all.
Syntax:- runmqchi –m Qmanagername –q initq.
Example :- runmqchi –m QM1 –q SYSTEM.CHANNEL.INITQ
To run channel initiator for queue manager QM1.
In solaris / unix /linux /AIX we run the channel initiator as follows.
Runmqchi –m QM1 –q SYSTEM.CHANNEL.INITQ &
APPLICATION TRIGGERING:-when ever specific conditions met on a local queue
application triggering works.
TRIGGER CONDITION:-
• Trigger ON
• Trigger type(first, every(t.type),depth)
• Initiation queue(our own defined local queue)
• Process
97
• Crt
• Dlt
• Chg
• Dsp
• Setid
• Setall
Object level :-
Syntax:-
Setmqaut –m QM1 –n LQ –t queue –pXX +put
Dspmqaut –m QM1 –n LQ –t queue –p XX
The setmqaut command completed successfully
Semqaut –m QM1 –n(20.30) –t channel –pXX +allmqi
Runmqsc QM1
Starting MQSC for queue manager 1
• REFRESH CLUSTER
• REFRESH SECURITY(generally we refresh security)
Result: web sphere security cache refreshed
TROUBLE SHOOTING METHODS:
LOGS:- MQseries have two types of logs
1. TRANSMISSION LOGS
2. ERROR LOGS
TRANSMISSION LOGS:-the transactions like messages inbound(incoming) and
outbound(outgoing) objects creation, permissions etc. are going to be written to
the transaction logs for every queue manager
Default path for log files in Windows:-
[ c:\programfiles\IBM\websphere MQ\log\QMGR(QM1)\active directory\log files ]
Default path for log files in LINUX, UNIX, SOLARIS, AIX (other than windows):-
[ $/var/MQM/log/Qm1/active/logfiles ]
Transmission logs are of two types:-
1. CIRCULAR LOGS
2. LINEAR LOGS
LINEAR LOGS: – In linear logs we can recover objects which are damaged and we
can take backup and clear the transactions.
97
By using linear logs we can restart, recover and Image backup. In this we need
some administrative tasks to monitor the logs and to clear the logs.
CHECKPOINT:-It is nothing but creation of objects, which are stored as a
transaction and are stored at Checkpoint (objects are LQ, TQ, and Channel…etc)
Creation of queue manager in linear logging:-
Syntax:-
Crtmqm –LL –Lf 2048 –Lp 10 –LS 1 QM2
• Lq to create a queue manager in linear logging
• Lf to specify the log file size
• Lp to specify the number of log primaries
• Ls to specify the number of secondary logs
Note:-1. In transaction logs we have log primary and log secondary.
2. We can view log primary files but we cannot view log secondary Files.
3. By default queue manager will take –Lp as 3 and –Ls as 2.
4. We can define log primary files maximum up to 250 files and log Secondary files
maximum up to 254 files.
Log primary files maximum—250
Log secondary files maximum—254
Creation of image backup by using linear logs:
Syntax:- rcdmqimg
Rcdmqimg[-z] [-L] [-m Qmgrname ] –t objtype[generic object name]
Rcdmqimg –m Qm1 –t queue LQ
To recover or recreate:-
Rcrmqobj? this command is used to recover the objects.
Syntax:-rcrmqobj[-z] [-m Qmgrname] –t objtype[generic objname]
Eg:- rcrmqobj –m Qm1 –t q LQ
ERROR LOGS:-
The operations going on(running) on MQ series will be written to errorlogs.
We have two types of error logs,
1.MQseries level
2.Queue manager level errors
Queue manager level errors:-the operations and errors are written to the queue
manager error folder.
97
Websphere MQ Clusters
97
Qns:What is Cluster?
Ans: A cluster is a group of queue managers set up in such a way that the queue
managers can communicate directly with one another over a single network,
without the need for transmission queue, channel, and remote queue definitions.
Qns:What are the Advantages of clustering?
Reduced system administration
Increased high availability
Improved resource utilization
Workload sharing
Qns:What is the algorithm that is followed by MQ in clustering?
Ans: WebSphere MQ uses a workload management algorithm that uses a round-
robin routine to select an available queue manager to route a message to.
Qns:What is Cluster queue manager?
Ans:A cluster Queue manager is a queue manager that is a member of a cluster. A
queue manager can be a member of more than one cluster What happens when we
give a Refresh Cluster mqsc command ?
This command issued on a queue manager, the queue manager discard all locally
held information about a cluster except the FULL repository information. This
enables you to perform a “cold-start” on the cluster.
Ans: In each cluster you must select at least one, preferably two, or possibly more
of the queue managers to hold full repositories. A cluster can work quite
adequately with only one full repository but using two improves availability. Every
cluster has at least one (preferably two) queue managers holding full repositories
of information about the queue managers, queues, and channels in a cluster. These
repositories also contain requests from the other queue managers in the cluster for
updates to the information. The other queue managers each hold a partial
repository, containing information about the subset of queues and queue managers
with which they need to communicate.
Qns:Where does the information about the messages of a QueueManager are
stored when they are in cluster?
Ans: Each queue manager stores its repository information in messages on a queue
called SYSTEM.CLUSTER.REPOSITORY.QUEUE.
The queue managers exchange repository information in messages on a queue
called SYSTEM.CLUSTER.COMMAND.QUEUE.
Qns:What happens when full cluster repository Qmgr goes down?
If your queue manager is a full repository queue manager, alter the queue
manager definition to set the REPOS and REPOSNL attributes to blank. This sends a
notification to other queue managers advising them that they must stop sending
cluster information to this queue manager.
Qns:When will we use RESET CLUSTER command?
To forcibly remove a queue manager from the cluster and resets the cluster
Qns:How does a partial repository QM share information with other clusters when
the full repos QM is down?
The cluster continues to work with information from the other full repository. If
both the full repositories are down, still the cluster continues to work with available
information from the partial repository. A repository handles the request whenever
possible but if the chosen repository is not available another repos used. When the
first repository becomes available again, it collects the latest new and changed
information from the others so that the queue managers are kept in synch. The
repository queue manager send messages to each other to be sure that they are
both kept up to date with new information about the cluster
97
to one of the full repository queue managers. The full repository queue manager
updates the information in its full repository accordingly. Then it automatically
creates a cluster-sender channel back to the queue manager, and sends the queue
manager information about the cluster. Thus a queue manager learns about a
cluster and a cluster learns about a queue manager.
Qns:Types of aliases and remote-queue definitions with clusters?
Queue-manager aliases, reply-to queue aliases, and queue aliases
Qns:What is a gateway queue manager and advantages of using in a cluster?
This enables workload balancing for messages coming from outside the cluster.
Qns:How will you keep a cluster secure?
Stopping the unauthorized Queue manager sending message to your Queue
manager
Stopping unauthorized Queue manager putting messages on your Queues
Stopping Your Queue manager putting messages to remote Queues
Preventing Queue manager from joining a cluster: Define a channel security exit
program
Forcing unwanted queue manager to leave a cluster
Qns:What is Repository queue manager? What are Full and partial repository?
A repository queue manager is a cluster queue manager that holds a full repository
A queue manager that hosts a complete set of information about every queue
manager in the cluster is referred to as having a full repository for the cluster. The
other queue managers in the cluster inquire about the information in the full
repositories and build up their own subsets of this information in partial
repositories. A partial repository contains information about only those queue
managers with which the queue manager needs to exchange messages. The queue
managers request updates to the information they need, so that if it changes, the
full repository queue manager will send them the new information
Qns:Where does each queue manager store its repository information?
SYSTEM.CLUSTER.REPOSITORY.QUEUE
Qns:Where do the queue managers exchange repository information?
SYSTEM.CLUSTER.COMMAND.QUEUE
Qns:What happens when a queue manager fails? What happens if I put-disable a
cluster queue? How long do the queue manager repositories retain information?
97
It must be 90 days but the Qm sends information to all the QM’s in the cluster to
update its information around 30 days
Qns:Adding a new Queue manager to a cluster?
Determine the Full repository to which the QM should refer
Define the CLUSRCVR channel
Define the CLUSSDR channel on the QM
Review the application for message affinities
Qns:Removing a cluster queue from a Queue manager?
Indicate the Queue is no longer available – remove the CLUSTER name from the
local queue definition (ALTER QLOCAL(localqueue) CLUSTER(‘’))
Disable the Queue – ALTER QLOCAL(localqueue) PUT(DISABLE)
Monitor the Queue until it is EMPTY
Monitor the channel to ensure that there is no in-doubt messages
Delete the Queue
Qns:Removing a Queue Manager form a Cluster?
Suspend the QM (SUSPEND QMGR CLUSTER(clusname))
Remove the CLUSRCVR channel definition
Stop the CLUSRCVR channel
Delete the CLUSSDR channel definition
Qns:Converting an existing network to cluster?
Alter two QM to make it a FULL repository MQ
Define CLUSRCVR channel on each Queue manager
Define CLUSSDR channel on each Queue Manager
Delete all remote Queue definitions for the existing network
Qns:What is Workload balancing?
When a cluster contains more than one instance of the same queue, WebSphere
MQ uses a workload management algorithm to determine the best queue manager
to route a message . The algorithm uses a round-robin approach to finalize its
choice between the suitable queue managers.
Qns:Removing a Cluster network?
Remove the cluster queues from the cluster
Stop all applications that have access to cluster Queue
Remove the repository attribute from the full repository Queue manager
97
=> CLUSTERING
===========
Clustering is a way to logically group WebSphere MQ queue managers
- reduced system administration due to fewer channel, remote queue, and
transmission queue definitions
- increased availability and workload balancing.
=> Basic Cluster setup
===============
> Step-1
Determine which queue manager should hold full repositories
A full repository contains a complete set of information about every queue manager
and object in the cluster
You will need at least one, preferably two
> Step-2
Alter the queue manager definitions to add repository definitions
ALTER QMGR REPOS(cluster_name)
> Step-3
Define the CLUSRCVR channels
Every queue manager in the cluster needs a CLUSRCVR with a conname pointing to
itself.
DEFINE CHANNEL(channel_name) CHLTYPE(CLUSRCVR) TRTYPE(TCP)
CONNAME(‘my_ip_name_or_address(port)’) CLUSTER(cluster_name)
> Step-4
Define the CLUSSDR channels
Define one CLUSSDR to a full repository queue manager. The channel name must
match that of the CLUSRCVR on the full repository
DO NOT define a CLUSSDR to point to a partial repository.
DEFINE CHANNEL(channel_name) CHLTYPE(CLUSSDR) TRPTYP(TCP)
CONNAME(‘remote_ip_name_or_address(port)’) CLUSTER(cluster_name)
> Step-5
Define a cluster queue
DEFINE QLOCAL(qname) CLUSTER(cluster_name)
97
Other queue managers in the cluster can send message to it without making
remote-queue definitions for it.
Only the local queue manager can read messages from an instance of the cluster
queue
You can use a sample program to test putting messages to clustered queues
=> Cluster Commands
===============
DISPLAY QMGR REPOS REPOSNL QMID
AMQ8408: Display Queue Manager details.
QMNAME(QM1) QMID(QM1_2005-07-12_17.14.38) REPOS(QMCLUS)REPOSNL( )
QMID is an internally generated unique name that consists of the queue manager
name plus the time the queue manager was created
DISPLAY CLUSQMGR(*) ALL
Display cluster Queue managera details
dis chstatus(*) all
Display channel status details
DISPLAY QCLUSTER(*) ALL
It displays information about clustered queues only.
A cluster queue will not be displayed on a partial repository until an application has
opened it.
DISPLAY QUEUE(*) CLUSINFO
This command displays information about queues with TYPE(QCLUSTER)
=> Work load balancing
================
When a cluster contains more than one instance of the same queue, workload
balancing determines the best queue manager to route a message to
- At its simplest, workload management results in a round-robin effect
MQ V6 has additional parameters that can be used to influence the results of the
algorithm.
- Queues: CLWLPRTY, CLWLRANK, CLWLUSEQ
- Queue Managers: CLWLUSEQ, CLWLMRUC
- Channels: CLWLPRTY, CLWLRANK, CLWLWGHT, NETPRTY
For workload balancing to occur:
97
Logging in MQ
Websphere MQ Triggering
MQ Trigering
97
=========
=> What is Triggering?
WebSphere MQ provides a feature that enables an application or channel to be
started automatically when there are messages available to retrieve from a queue.
=> How it works?
- A message is put to a queue defined as triggered.
- If a series of conditions are met, the queue manager sends a trigger message to
an initiation queue. This is called a trigger event.
- A trigger monitor reads the trigger message and takes the appropriate action
based on the contents of the message, which is typically to start a program to
process the triggered queue.
- Trigger monitors may be built-in, supplied by a SupportPac, or user written.
- The application can receive a parm list with an MQTMC2 containing USRDATA and
ENVRDATA.
=> Application Trigger Example1
- DEFINE QLOCAL (‘IQ’) REPLACE
- DEFINE PROCESS (PROC) REPLACE APPLTYPE (‘CICS’) APPLICID (‘PAYR’)
USERDATA (‘Payroll data’)
- DEFINE QLOCAL (Q1) REPLACE INITQ (‘IQ’) PROCESS (‘PROC’) TRIGGER
TRIGTYPE (FIRST)
- Note: If using TRIGTYPE(DEPTH) then TRIGDEPTH must also be specified.
=> Application Trigger Example2
- CRTMQMQ QNAME(initq_name)
- CRTMQMPRC PRCNAME(proc_name) APPID(lib/pgm) ENVDATA
(‘JOBNAME(trigapl) JOBD(lib/jobd)’)
- CRTMQMQ QNAME(lclq_name) PRCNAME (proc_name) TRGENBL(*YES)
TRGTYPE(*FIRST) INITQNAME(initq_name)
- Note: If using TRGTYPE(*DEPTH) then TRGDEPTH must also be specified.
=> Trigger Conditions
- A trigger message is sent to the initiation queue when all of the following
conditions are satisfied:
1. A message is put on a transmission or local queue.
2. The message’s priority is greater than or equal to the TriggerMsgPriority of the
queue.
3. The number of messages on queue was previously
- Zero for trigger type FIRST
- Any number for trigger type EVERY or *ALL
- TriggerDepth minus 1 for trigger type DEPTH
4. For trigger type FIRST or DEPTH, no program has the trigger queue open for
GETs (Open input count=0).
5. The Get enabled attribute is set to YES on the triggered queue.
6. A Process name is specified and exists, or for transmission queues, TriggerData
contains the name of a channel.
7. An Initiation queue is specified and exists and GETs and PUTs are enabled for
the initiation queue.
97
8. The trigger monitor has been started and has the initiation queue open for GETs
9. The TriggerControl attribute is set to YES on the triggered queue.
10. The TriggerType attribute is not set to NONE.
11. For Trigger Type FIRST, the queue was not previously empty, but the
TriggerInterval set for the QMGR has elapsed.
12. The only application serving the queue issues MQCLOSE and there are still
messages on the queue that satisfy Conditions 2 and 6-10.
13. Certain trigger attributes of the triggered queue are changed, such as
- NOTRIGGER to TRIGGER
- PUT or GET DISABLED to ENABLED
- or a trigger monitor opens the Initiation queue.
14. MSGDLVSQ is set correctly relative to the priority of the messages and the
TriggerMsgPriority setting.
=> Triggering Problem determination
- If the setup is brand new or any configuration changes have been made, verify all
the definitions are complete and correct.
- If the setup is brand new or has worked before, verify all the conditions for a
trigger event are satisfied.
- If channel triggering, verify the correct channel name is specified and the channel
is not in a STOPPED state.
- If application triggering
- verify the application name is correct and exists
- verify the application is coded correctly
- verify the correct authorizations are in place.
- Verify a trigger message can be delivered.
- Verify a trigger monitor is active.
- Verify trigger type and application design match.
- Try manually starting the triggered application to see if it is able to run.
- Stranded messages may occur when the triggered application fails to remove one
or more messages
- for TriggerType FIRST, use TriggerInteval as a “safety net”, because a trigger
event only occurs when depth goes from 0 to 1.
- for TriggerType EVERY, if the triggered application only does one MQGET, manual
97
enabled by backing out a unit of work. If a program backs out a unit of work or
abends, triggering for DEPTH must be reenabled by MQSET, ALTER or CHGMQMQ.
97
MQ Problem determination –
Queue Manager Diagnostics
- look for related messages before and after the time of the error
- try to correlate error log message with other diagnostics
=> FFST
- FFST is first failure support technology
- FFST are files written to /var/mqm/errors
- FFST file names format is AMQ[PID].x.FDC
- all threads in a process will append their FFSTs to the same file
=> FFST layout
-The header
this includes
date/time/hostname/pids/probeID/builddate/user/program/process/thread/QM/pro
betype/monitcode etc…
-The Function stack
every thread executing MQ code has a thread control block which contains stack for
MQ functions. this stack shows context in which error occured
-The Trace history
the trace shows sequence of events leading up to a failure
-The component dumps
shows the commom services control blocks
-Environment
includes all user settings at time of error
=> Base MQ tracing
- Tracing records the sequence of events in a program
- MQ supports tracing on all queue managers and clients
- Trace are binary files which requir formatting
- MQ shipps programs for starting/stopiing/formatting traces
-strmqtrc
-endmqtrc
-dspmqtrc
- traces are written to /var/mqm/trace
- trace contains a header with extended process information, then each line of
trace contains pid/tid/trace data
97
Migrating WebSphere MQ
queue manager clusters
MQ Migration
========
Migrating queue managers is generally a simple process, because WebSphere MQ is
designed to automatically migrate objects and messages, and support mixed
version clusters. However, when planning the migration of a cluster, you need to
consider a number of issues, which are described below.
Forward migration involves upgrading an existing queue manager to a later version
and is supported on all platforms. You may wish to forward migrate in order to take
advantage of new features or because the old version is nearing its end-of-service
date.
Testing
———-
It is important when making any system changes to test the changes in a test or
QA environment before rolling out the changes in production, especially when
migrating software from one version to another. Ideally, an identical migration plan
would be executed in both test and production to maximise the chance of finding
potential problems in test rather than production. In practice, test and production
environments are unlikely to be architected or configured identically or to have the
same workloads, so it is unlikely that the migration steps carried out in test will
exactly match those carried out in production. Whether the plans and environments
for test and production differ or not, it is always possible to find problems when
migrating the production cluster queue managers
Plan
—–
When creating the migration plan, you need to consider general queue manager
migration issues, clustering specifics, wider system architecture, and change
control policies. Document and test the plan before migrating production queue
97
Websphere MQ interview
Questions – part1
Will non-persistant messages survive a queue manager restart, if they are part of a
unit of work?
Ans: No
Which of the following is a queue manager event?
Ans: Remote event.
Every message on a queue is prefaced by
Ans: Message descriptor
Can media image be taken for all the logging types?
Ans: No
Which of the following are valid channel types (message channel agents), that can
send data held in a tranmission queue ? (Two options from the list are correct.)
Ans: SENDER, SERVER
In MQSeries triggering, which program/service starts the triggered program:?
Ans: Trigger monitor
If a trigger event causes triggering to be turned off, which of the following was
specified in the application queue definition?
Ans: TRIGTYPE(DEPTH)
Alias queues can point to
Ans: Local queues, Remote queues
Does AS400 supports MQ client ?
Ans: No
When setting up triggering on a channel, if a process definition is used, what field
is used to name the channel to be started?
Ans: USERDATA
If an application attempts to put a ‘REQUEST-type’ message on a queue, what field
in the MQMD does the queue manager check to be sure it has a value?
Ans: ReplyToQ
97
Websphere MQ interview
questions – part2
Answers will not be provided for the question……as the question are to help you
preparing for the interviews. Read and findout the answers.
1.If the client application is running on on machine and moved to another then
what is the attribute need to set.
2.Qmgr Q1 in london and Qmr2 in paris forms a cluster. for adding Qmgr3 in
washington into the cluster how many more channels need to be created in
Qmgr1 and Qmgr2?
3. When the 2 repositories go down what happens to other queue managers in the
cluster.
4. two channel are defined with same xmitq, when one channel is started what
happens when you try to start the other.
5. To find out the status of a remote queue manager what command is used?
6. Which exit is used to check if the user is trusted party?
7. Two applications running on a Queumanagers are connected to 2 remote Queue
managers via two Xmit Queueus. Channels are running at ful capacity. How can we
increase the perfomance?
8. An event message is generated in Qmgr1 and even messages are monitored by
Qmgr2. Expiration time of even message is 1 min. the link frm qmgr1 and qmgr2 is
down. What happens to the message?
9. MQGET fails and the message is still in the Queue. What command is used to
find the error caused?
10. Three Qmgrs Q1 Q2 Q3. There is no connection between Q1 and Q2. A
message is put into Q1 and it has to reach Q3 via Q3.(Multi Hopping) Now the lnk
between Q2 and Q3 is down. What happens to the message.
11. Command USed to find the message length?
12. which installable service component can be used for security?
13. channels defined btwn qm1 and qm2 are qm1.t.qm2 & qm2.t.qm1. how to
know the link status
14. how to define for port xxxx, in channel definition
97
1) There are two queue manager connected. For using SSL on channel, what all the
required parameters to be defined.
2) On unix where are the ssl certificates stored
3) the queuemanger wants to authinicate the client , which option should be used
to set.
4) On window which command will display the queuemanger status
5) from windows to unix client connection is setup. which protocol to use
97
6) for moving all unprocessed messages should be moved to another queue which
option should be set on queue definition
7) the queue is damaged which is the option to recreate the queue.
only one message requires to be encrypted which exit best option for
9) Which attribue of the DEFINE PROCESS command have the name of the
application executable file, specified as a fully qualified file name
10) there are two queuemangaers QM1 & QM2 . QM1 is having sender channer.
The channel in QM2 needs to be stared to start the channel in QM1. which type of
channel is QM2.
11) Which exit is used to perform compression during transmission
12) What happens when a message cannot be delivered in the distribution list.
13) when the cluster is crashed the queumanger will go down? or is uses its partial
repositories
14) What is the parameter used to spceify the deadletter queue during crtmqm.
15) What does SHORTRTY in the channel definition specify?
Websphere MQ interview
Questions – Part5
*) what happens if you don’t specify queue manager name in runmqsc command?
*) can you run control commands from runmqsc?
*) Using runmqsc, which attribute of the queue manager will list the version of the
MQSeries currently being used?
*) When you use the LIKE attribute on a DEFINE command, you are copying the
queue attributes What about messages on that queue?
*) If you decrease the maximum message length on an existing queue, existing
messages are affected ?
*) If an application has the queue open, can the queue be cleared ?
*) MQSeries provides a sample queue browser that you can use to look at the
contents of the messages on a queue. what two input parameters are required to
use it?
*) An alias queue provides a way of referring indirectly to another queue. What
type of queue can be referred?
*) Can An alias queue can be deleted, if an application currently has the referred
queue open?
*) What is the convenient method for applications to create queues as they are
required ?
*) Triggering requires a number of queue attributes to be defined on the
application queue. How do you enable triggering itself?
*) When a trigger event occurs, the queue manager puts a trigger message on the
initiation queue specified in the application queue definition. Do Initiation queues
need special settings ?
*) Which attribue of the DEFINE PROCESS command have the name of the
application executable file, specified as a fully qualified file name ?
97
Websphere MQ interview
Questions – part6
*) Will PCF commands cover the same range of functions provided by the MQSC
facility?
*) What is the character limit on properties of PCF commands?.
*) What data type is used by MQAI to performs administration tasks on a queue
manager
*) What is the only common property for both sender-receiver channel pair?
*) Which agent in MQ will take care of taking messages from the transmission
queue and put them on the communication link between the queue managers
Queue Manager Aliases enable you to refer to queue managers by more than one
name.
Queue manager alias definitions apply when an application that opens a queue to
put a message, specifies the queue name and the queue manager name.
Queue manager alias definitions have three uses:
* When sending messages, remapping the queue manager name
* When sending messages, altering or specifying the transmission queue
* When receiving messages, determining whether the local queue manager is the
intended destination for those messages.
Queue-manager aliases, which are created using a remote-queue definition with a
blank RNAME, have four uses:
Remapping the queue-manager name when sending messages
A queue-manager alias can be used to remap the queue-manager name
specified in an MQOPEN call to another queue-manager. This can be a cluster
queue manager. For example, a queue manager might have the queue-
manager alias definition:
DEFINE QREMOTE(YORK) RNAME(' ') RQMNAME(CLUSQM)
This defines YORK as a queue-manager name that can be used as an alias for
the queue manager called CLUSQM. When an application on the queue
manager that made this definition puts a message to queue manager YORK,
the local queue manager resolves the name to CLUSQM. If the local queue
manager is not called CLUSQM, it puts the message on the cluster
transmission queue to be moved to CLUSQM, and changes the transmission
header to say CLUSQM instead of YORK.
Note:
This does not mean that all queue managers in the cluster resolve the name
YORK to CLUSQM. The definition applies only on the queue manager that
makes it. To advertise the alias to the whole cluster, you need to add the
97
queue manager in the cluster, and you want the clustering mechanism to
balance the workload for messages coming to that queue from outside the
cluster.A queue manager from outside the cluster needs a transmit queue
and sender channel to one queue manager in the cluster, which is called a
gateway queue manager. To take advantage of the default workload
balancing mechanism, the gateway queue manager must not contain an
instance of the EDINBURGH queue.
Actual IBM
documentation : http://publib.boulder.ibm.com/infocenter/wmqv6/v6r
0/index.jsp?topic=/com.ibm.mq.csqzah.doc/qc10790_.htm
97
Websphere MQ Dead
Letter Queue (DLQ)
97
PutApplType : '11'
PutApplName : ‘WebSphere MQ\bin\amqsputc.exe'
PutDate : '20091018'
PutTime : '12044424'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 194 bytes
00000000: 444C 4820 0000 0001 0000 0805 5445 5354 'DLH ........TEST‘
00000010: 2020 2020 2020 2020 2020 2020 2020 2020 ' ‘
00000020: 2020 2020 2020 2020 2020 2020 2020 2020 ' ‘
00000030: 2020 2020 2020 2020 2020 2020 4741 4220 ' GAB ‘
00000040: 2020 2020 2020 2020 2020 2020 2020 2020 ' ‘
00000050: 2020 2020 2020 2020 2020 2020 2020 2020 ' ‘
00000060: 2020 2020 2020 2020 2020 2020 0000 0222 ' ..."‘
00000070: 0000 01B5 4D51 5354 5220 2020 0000 0006 '...µMQSTR ....‘
00000080: 616D 7172 6D70 7061 2020 2020 2020 2020 'amqrmppa ‘
00000090: 2020 2020 2020 2020 2020 2020 3230 3035 ' 2009‘
000000A0: 3033 3031 3132 3439 3531 3735 7465 7374 '030112495175test‘
000000B0: 206F 6620 4D65 7373 6167 6520 746F 2044 ' of Message to D‘
000000C0: 4C51 'LQ
DLQ Handler
Once a message arrives on the DLQ you can automate the handling of that
message using the DLQ handler program. You can have the handler running
and waiting for messages to arrive on the DLQ or you can set up the DLQ to
trigger the start of the handler program
Starting the DLQ Handler
You can start the DLQ handler using the runmqdlq command.
Example: runmqdlq DLQ QMGR < rules.tb
where DLQ = name of your dead letter q
QMGR = queue manager name and
rules.tb is a file with your rules table
Rules Table
It Defines how the DLQ handler will process the messages on the DLQ
97
REASON(MQRC_Q_FULL) ACTION(RETRY) +
RETRY(5)
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
REASON(*) ACTION(FWD) FWDQ('DEADQ')
^Z
^Z
2005-04-08 02.20.09 AMQ8708: Dead-letter queue handler started to process
INPUTQ(SYSTEM.DEAD.LETTER.QUEUE)
MQ Display commands
97
MQ start-Stop commands
MQ status verification commands
Websphere MQ v7
97
1. You already have a Queue Manager cluster (named JOSEPH) setup with 2 Queue Managers with
names QM1 and QM2 and all the requires channels are setup for communication between QM1 and QM2
In this tutorial, let us send message from QM3’s Q3 to QM2’s Q2 and in the reverse path.
In this case one of your Queue Managers should act as a gateway. Say for example, lets make QM1 as the
gateway for cluster and QM3 is outside cluster.
Steps:
1. The queue manager outside the cluster must have a QREMOTE definition for each queue in the cluster
that it wants to put messages to.
Now, you need to define the following, for communicating from QM3 to Cluster and Cluster to QM3.
on QM1:
DEFINE QL(TQ3) USAGE(XMITQ)
DEFINE LISTENER(QM1_LIST) TRPTYPE(TCP) PORT(1111)
DEFINE CHANNEL(TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME(‘localhost(3333)’)
XMITQ(TQ3)
DEFINE CHANNEL(TO.QM1) CHLTYPE(RCVR) TRPTYPE(TCP)CONNAME(‘localhost(1111)’)
DEFINE QREMOTE(QM3) RNAME(‘ ‘) RQMNAME(QM3) XMITQ(TQ3) CLUSTER(JOSEPH)
on QM2:
DEFINE QL(Q2) CLUSTER(JOSEPH)
DEFINE LISTENER(QM2_LIST) TRPTYPE(TCP) PORT(2222)
on QM3:
DEFINE QL(Q3)
DEFINE QL(TQ1) USAGE(XMITQ)
DEFINE LISTENER(QM3_LIST) TRPTYPE(TCP) PORT(3333)
DEFINE CHANNEL(TO.QM1) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME(‘localhost(1111)’)
XMITQ(TQ1)
DEFINE CHANNEL(TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)CONNAME(‘localhost(3333)’)
DEFINE QREMOTE(Q2) RNAME(Q2) RQMNAME(QM2) XMITQ(TQ1)
Start all the listeners on QM1/2/3 and Ensure all channels are running. First test that you are able to
communicate between QM1 and QM2.
97
The concept of these multi-instance queue managers is to share the queue manager data in a high
available storage place (line SAN), which should be accessible by more than 1 queue manager. For
example, we have QM1 and QM2 on different machine. For both these queue managers we keep the logs
and QM data in a shared location /shared/QMdata. Now if you start the QM1 first, then QM2 becomes
passive. When QM1 is not operational or crashed then QM2 will take over the proceedings.
When you intend to use a queue manager as a multi-instance queue manager, create a single queue
manager on one of the servers using the crtmqm command, placing its queue manager data and logs in
shared network storage. On the other server, rather than create the queue manager again, use the
addmqinf command to create a reference to the queue manager data and logs on the network storage.
# Client and channel reconnection to transfer WebSphere MQ connections to the computer that takes over
running the active queue manager instance.
# A high performance shared network file system that manages locks correctly and provides protection
against media and file server failure.
# Resilient networks and power supplies to eliminate single points of failure in the basic infrastructure.
# Applications that tolerate failover. In particular you need to pay close attention to the behavior of
transactional applications, and to applications that browse WebSphere MQ queues.
# Monitoring and management of the active and standby instances to ensure that they are running, and to
restart active instances that have failed.
Note: mqm user and mqm group should have required access permissions to the shared data file system.
the mqm user and group should be available across all the machines which has the QMs and they
UID/GID should be same in Linux.
Steps:
I’m assuming that you already have MQ installed on server1 and server2.
Aslo assuming that, you have a NFS/SAN share with name /MQHA with full access to mqm user on both
machines. [otherwise, contact your Linux admin to set this]
# Run amqmfsck, without any options, on each system to check basic locking
# Run amqmfsck on both WebSphere MQ systems simultaneously, using the -c option, to test
writing to the directory concurrently.
# Run amqmfsck on both WebSphere MQ systems at the same time, using the -w option, to test
waiting for and releasing a lock on the directory concurrently.
3. check the UID/GID of mqm user
4. Create the logs and data directories in the shared file system
1. mkdir /MQHA
2. mkdir /MQHA/logs
3. mkdir /MQHA/qmgrs
5. Create the queue manager
crtmqm -ld /MQHA/logs -md /MQHA/qmgrs -q QM1
6. Copy the queue manager configuration details from Server 1
dspmqinf -o command QM1
and copy the result to the clip board,
addmqinf -s QueueManager
-v Name=QM1
-v Directory=QM1
-v Prefix=/var/mqm
-v DataPath=/MQHA/qmgrs/QM1
Testing
Stop the active Queue Manager using, endmqm command with -s option. The client programs reconnect
to the new queue manager instance and continue to work with the new instance after a slight delay.