Followers

Tuesday, June 6, 2017

How to Work with MQ and Explanation of MQ Objects

How to Work with MQ and Explanation of MQ Objects

 work with MQ in two ways:

1 command prompt
2 GUI (MQ EXPLORER)
Command prompt: For command prompt  goto run and type cmd

open command prompt in  'Run as Administrator' mode.


2.To open MQ Explorer go to command prompt. and enter the command for opening MQ explorer. enter STRMQCFG
Run and open the IBM MQ Explorer.


MQ OBJECTS: There are five types of MQ objects , Those are

                         QUEUE MANAGER
                     QUEUES
                     CHANNELS
                     LISTENERS
                     PROCESS

QUEUE MANAGER: Queue manager is a major object in MQ .QM is a system container it holds all other MQ objects.
max characters for creating  queue manager is 48
Queue manager name is a case sensitive that takes only capital format, make sure to create the queue manager always in capital letters.
Queue manager name should be unique in network to which it is connected.
Queue manager provides MQI interface to application to work with MQ.

SYNTAX:
  • Create the Queue manager:   CRTMQM QUEUE MANAGER NAME
  • Start the Queue manager:      STRMQM QUEUE MANAGER NAME
  • Stop the Queue manager:      ENDMQM QUEUEMANGER NAME
TO START THE MQSC COMMANDS :
  • Enter into the Queue manager: RUNMQSC QUEUEMANAGER NAME
  • Exit from  the Queue manager: END
  • Delete queue manager            : DLTMQM QUEUEMANAGER NAME

QUEUES: Queue is a container which stores the messages.
queues are used to either store the messages coming from other queue manager or send the messages to other queue managers.
Types of queues:
            A)LOCAL QUEUE
                B)ALIAS QUEUE
                C)REMOTE QUEUE
                D)MODEL QUEUE
                E)DYNAMIC QUEUE
                F)TRANSMISSION QUEUE
                G)INITIATION QUEUE
                H)DEADLATTER QUEUE
                I)EVENT QUEUE               
                J)CLUSTER QUEUE
A)   LOCAL QUEUE: A local queue is the only place where messages are physically stored.
an application can put and get the messages from the local queue.

SYNATAX:
 DEFINE QLOCAL(local queue name)

 B)  ALIAS QUEUE: An alias queue is a duplicate queue which points to original queues.

SYANTAX:

DEFINE QALIAS(aliasqueue name) TARGETQUEUE(targetlocalqueue name)

C) REMOTE QUEUE:  Remote queue is a queue that contains the address details of the destination queue manager and destination local queue.

Syntax:

DEFINE QREMOTE(remote queue name)  RNAME(remotelocalqueue name)  RQMNAME(remote queueumanager name)  XMITQ(xmitqname)

D)MODEL QUEUE: a model queue is a template that can be used by an application to dynamically create a real queue .these templates are often used to create a unique queue for reply messages and then the queue is automatically deleted when the applications ends.

SYSNTAX:

DEFINE QMODEL(MODEL QNAME) DEFNTYPE(PERMDYN)

E) DYNAMIC QUEUE: These queues are created by the process of opening a model queue by using the mqi call mq open. and automatically deleted when the application ends.

There are two types of dynamic Queues.

1) Temporary dynamic queue : The Queue which deleted automatically when application ends.

2)Permanent dynamic Queue: The permanent dynamic queue which can be used by another application also.

F)TRANSMITION QUEUE:  Transmition queue is a type of local queue that transmit the messages to the destination queue. usage attribute as 'xmitq'.

SYNTAX:

DEFINE QLOCAL(xmitqname) USAGE(xmitq)

G)INITIATION QUEUE: it is local queue to which a queue manager writes a trigger message when certain conditions are met on another local queue.

SYNTAX:

DEFINE QLOCAL(intiation qname) USAGE initq

CHANNEL INITIATOR PROCESS: channel initiator monitor the initiation queue. it will start the channel automatically when trigger condition met on inition queue.

H)DEADLATTERQUEUE: Dead latter queue is a local queue, it is used for handling the messages that are undelivered for every Q manager it is recommended to keep one dead latter queue.
dead later handler process we are using here.

SYNTAX:

DEFINE QLOCAL(deadlater qname) ALTER QMGR DEADQ(dlqname)

Scenarios:

If the destination queue is full.(2053)

Destination queue does not exist.

Put option have been inhibited on the destination queue.(2051)

The sender message channel  is not authorized to use destination queue.(2035)

Message is too large.(2030)

I)EVENT QUEUE:  The queue manger generates event messages when certain thing happen
for example event can occur when a queue is nearly full or when an application is not authorized to open a queue. these event messages are written to one of the pre defined event queues and can then be process by management tools.

SYSTEM.ADMIN.QMGR.EVENT

SYSTEM.ADMIN.CHANNEL.EVENT

J)CLUSTERQUEUE: It is a local queue, we just add the local queue in cluster.

CHANNELS:
Channel is a logical communication link in MQ. we have 2 types of channels,
A)  Message channel
B  MQI channels

CHANNEL STATUS:
  • ·         RUNNING STATUS
  • ·         RETRAINING STATUS
  • ·         STOPPED STATUS
  • ·         INBOUND STATUS.


 A) Message channel: A message channel connects two Queue managers via message channel agents(MCA).
Message channel agent: An mca is a program that transfers messages from a transmition queue to a communication link(channel) and from a communication link to the target queue.
message channels are uni directional.
different types of message channels

1)  sender channel(sdr): A channel that can be created on sender side or sender queue manager to send a message to the destination queue manager.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(SDR) CONNAME('HOST(PORTNUMBER)')XMITQ(XMITQNAME)

2 )Receiver channel(rcvr): a channel that can be created on sender side to receive messages from destination queue manager.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(RCVR)

3 )Server channel(svr): server channel is like sender channel. it can be started by remote user or receiver end.

Syntax:
DEFINE  CHANNEL( chlname) CHLTYPE (svr) CONNAME('host(portnumber)'xmitq(xmitqname)

4) Requested channel(rqstr): Destination queue manager can request a response message from source queue manager by using requester channel.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(RQSTR) CONNAME('HOST(PORTNUMBER)')

combination : Message channel combination
·         sender-receiver.
·         sender-requester
·         server-requester.
·         cluster sender-cluster receiver

5) Cluster sender channel(CLUSSDR):it is nothing but sender receiver channels, but here we give connection name. we define in cluster.

SYSNTAX:
DEFINE CHANNEL(CHLNAME) CHLTYPE(CLUSSDR) CONNAME(DESHOSTNAME (PORTNUM)) CLUSTER(CLUSNAME)

6) cluster receiver channel(CLUSRCVR) It is nothing but sender receiver channels, but here we give connection name. we define in cluster.

SYNTAX:
DEFINE CHANNEL(CHLNAME) CHLTYPE(CLUSRCVR) CONNAME(LOCALHOST(PORTNUMBER)) CLUSTER(CLUSNAME)

B) MQ I CHANNELS(Message queue interface):
MQI channels communicate client and queue manager.
A message queue interface channel connect websphere mq client to a queue manager across the network.
These  channel s are bidirectional , in that one channel can be used for a client to both send and receive messages. there are two types of MQI channels.

1) server con channel: It is a queue manager defined MQI channel which is secured by ssl.
 Install mq client in application side first,

SYNTAX:
DEFINE CHANNEL(CHLNAME) CHALTYPE(SVRCONN) TRPTYP(TCP)
TRP:TRANSPORT PROTOCAL:WE ARE USING I NETWORKING LEVEL,

2 )client con channel: Client connection chal is nothing but server con chl only difference  is channel type. and we must give connection name in client con channel definition.
We also use client channel tables to connect multiple queue managers at a time.

Syntax:
 DEFINE CHANNEL(CHLNAME) CHLTYPE(CLIENTCONN) CONNAME(LOCAL HOSTNEM(PORT NUMBER))TRPTYPE(TCP).

LISTENER:  LISTENER  IS a program, that accepts the connection request and then start the channel to handle the communication between two Queue managers.

Syntax:
 DEFINE LISTENER (listenername) TRPTYPE(tcp) PORT (PORTNUMBER).

PROCESS: Process is an object that defines applications to start automatically in response to a trigger message.

SYNATAX:

DEFINE PROCESS (process name) APPLICID(name) APPLICTYPE(type of application).

No comments:

Post a Comment