MQ Notes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

IBM MQ

Used for middleware for data exchange


Asynchronous, Queuing messaging
o Advantage: No blocking, Independent of any services (running or not)
o Dis advantage: Unpredictable response time
Applications Shielded from Environmental Differences (like OS, protocol, Language)

MQ Message Structure:



Destination Queue
Reply Queue name
Time to live (expiry)
Format
Correlation ID : Select which message to get from queue
Persistent or Non-Persistent
o Persistent : Use for business critical data for insure delivery (network failures, delivery
failures, or planned restarts), WebSphere MQ assures exactly one delivery of persistent
messages
o Non-Persistent: Used for less critical data, better performance,
Report options
Segmented Messages - allows ending of VERY LARGE messages (>100 MB)




QUEUE MANAGER:

Controls access to queues:
o administration (create, delete, etc)
o usage (Put, Get)
Serves as transaction (syncpoint) coordinator for all queue operations.
Provides standard APIs (MQI) for applications to put/get messages to/from queues
Queue Managers have names (identities) that are UNIQUE in a network (like host names)
Segments/Groups messages
Can send one message to more than one destination with one
API call by using the dynamic distribution list and hence reduces network traffic

QUEUES:

Queues store the messages sent by program
WebSphere MQ defines four types of queues. A queue instance is fully qualified by its
queue manager and queue name.
1. Local Queue - an actual queue for which storage is allocated
2. Remote Queue - a definition of a queue on a different queue manager (acts somewhat
like a pointer)
3. Alias Queue - another name for a local or remote queue. Typically used to switch queue
destinations without modifying program code
4. Model Queue - a template whose properties are copied when creating a new dynamic
local queue ( create queue xxx like queue yyy)
Properties - Maximum Message Size, Maximum Queue Depth, High/Low Factors,
Enable/Disable Put or Get, Persistent/Not Persistent

SPECIAL QUEUES:
Transmission queue
o Type of local queue used as an intermediate step when sending messages to queues
that are owned by a different queue manager
o There is only one transmission queue for each remote queue manager
Reply-to-queue
o This could be a local or a remote queue.
o This is the queue in which the responding program puts the reply message
Dead-letter-queue
o It is a local queue used as a repository for all the un-delivered messages
o Message is written in this queue if : Destination queue is full or does not exist, put
operation is inhibited, Message is too large, duplicate message sequence number
Repository queue
o It is a local queue used in message queue manager clusters to hold either a full or partial
repository of queue


CHANNELS:
There are 2 types of channel:
1. Message Channel : A channel between two queue managers over which messages can
flow
2. MQI Channel: A channel between a client application and a queue manager over which MQI
calls are issued


Message Channel:

It transmit only in one direction i.e. two message channels are required for 2 way
communication
Comprises two channel agents, sender, receiver and a communication protocol
Types of message channels:
o Sender - initiates connection to Receiver
o Server - Accepts request to start from requester, then becomes Sender
o Receiver - Passive; waits for initiation sequence form Sender
o Requester - Active at start, then becomes Receiver
o Cluster-sender (used amongst Cluster Queue Managers)
o Cluster-receiver










Message queue interface (MQI) :

Channel types are:

1. Server connection (SVRCONN): Defines how a client application can connect to a queue
manager.
2. Client connection (CLNTCONN): 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.


COMBINATION OF CHANNELS:

Sender and Receiver
Server and Requester
Cluster sender and Cluster Receiver
Server Receiver
Sender Requester

LISTENER:

It is a mediator between external application or queue managers connecting to the
queue manager. To contact the queue manager we should approach through Listener
It is a service of MQ with default port 1414.


GENERAL ERRORS OCCURING IN REALTIME SCENARIO:
1. Mqrc 2059 :- Qmanager not available
2. mqrc 2058 :- Qmanager name error
3. mqrc 2085 :-unknown object name
4. mqrc 2035 :- Not authorized
5. mqrc 2033 :-No message available


MQ Logs:

MQ has two types of logs
1. Transmission Logs
2. Error Logs


TRANSMISSION LOGS:

It contain transactions like inbound messages, outbound messages, objects creation,
permissions ,logs for every queue manager etc.
Log location:
/var/mqm/logs/Queue_Manager in unix
C:/program files/IBM/log/Queue_Manager in windows

Transmission logs are of two types:

1. Circular Logs:
The queue manager manages the size of the log automatically, without any
administration being required.
Media recovery is not available, because the logs do not contain enough information
about each object in the queue manager.
Good performance & Easy administration

2. Linear Logs:
The queue manager maintains a continuous log from the point of creation of the queue manager
Administration is required to archive or delete logs that are no longer required
Media Recovery is available

ERROR LOGS:

The operations running on MQ will be written to error logs
We have two types of error logs,
1. MQ level: the operations or errors which are occurring on MQ
Log location:
C:\program files\IBM\Websphere mq\errors\log files
/var/mqm/errors/logfiles

2. Queue manager level errors: the operations and errors are written
Log Location:
C:\program files\IBM\websphere MQ\Qmgrs(QM1)\errors\logfiles
/var/mqm/qmgrs/Qm1/errors/logfiles

Message contains date/pid/user/program/exception message/suggested action/source
file which generated it

Tracing:

Tracing records the sequence of events in a program
MQ supports tracing on all queue managers and clients
Trace are binary files which require formatting
MQ ships programs for starting/stoping/formatting trace
o Strmqtrc
o Endmqtrc
o dspmqtrc
Start trace:
o For all WebSphere MQ process: strmqtrc e
o only for one queue manager: strmqtrc m QMGR_NAME
End tracing: endmqtrc -a
Format the trace files on UNIX: dspmqtrc *.TRC
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

You might also like