Академический Документы
Профессиональный Документы
Культура Документы
Programs communicate by sending data in messages rather than calling each other directly Provides functionality to create, send, receive and read messages in a distributed system
page 2
What is a message?
page 3
Middleware - an intermediate software component that bridges dissimilar computing environments. Unix, MVS, OS/400 Tandem, VMS, NT, etc. SNA, NetBios, TCP/IP Cobol, C, JAVA
MQ programs use a consistent application program interface (API) across all platforms The programs can be written in various programming languages, including Java. The same queuing mechanism is valid for all platforms, and so are the currently 13 APIs.
page 4
Queuing means that the messages are placed on queues in storage, so that programs can run independently of each other, at different speeds and times, in different locations, and without having a logical connection between them.
page 5
Message Types
Datagram: A message containing information for which no response is expected. Request: A message for which a reply is requested. Reply: A reply to a request message. Report: A message that describes an event such as the occurrence of an error or a confirmation on arrival or delivery. A report message is used when something unexpected occurs, or to give extra information like: message delivered to target queue message taken by application message not deliverable message exceeded time-to-live Request/Reply An application places a message on a queue and expects a reply in return Publish & Subscribe messages are broadcast to interested participating applications in the MQ network
page 6
page 7
page 8
page 9
page 10
page 11
page 12
No constraints on application structure Supports different including complex and simple message-flow patterns
One to Many Many to One A combination of the above
page 13
page 14
page 15
page 16
page 17
Programs are insulated from network complexities Programs do not talk directly to other programs
Activity associated with maintaining message queues, relationships between programs and queues, handling network restarts and moving messages around the network is taken care by MQSeries
page 18
Programmers can concentrate on business programming MQI is easy to use Programs scheduling for best use of resources Fewer network sessions are needed Less vulnerable to network failures Better use of network resources Code is easier to move or reuse Business change is readily accommodated Message delivery is assured
page 19
Insurance business
page 20
Manufacturing Industry
page 21
Retail Industry
page 22
Travel Industry
page 23
Banking Industry
page 24
page 25
page 26
How MQ Works
Queue Manager (MQM) Listener Trigger Monitor Channel Initiator Message Channel Agent (MCA) or mover
A remote queue is assoicated with a transmission (xmit) queue, which is local queue There is one queue for each remote queue manager Transmission queue is assoicated with a message channel
page 28
page 29
MQSeries Components - QM
Controls access to queues: administration (create, delete, etc) usage (Put, Get) serves as transaction (syncpoint) coordinator for all queue operations. Accessed through the Message Queue Interface (MQI)
Queue Managers have names (identities) that are UNIQUE in a network (like host names).
It uses existing networking facilities to transfer messages to other queue managers when necessary. It segments messages (if necessary) and assembles them. It also can group messages and send them as one physical message to their destination where they are automatically disassembled.
page 30
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). Transmission queue (xmitq) - This transmission queue has the same name as the destination queue manager .Every remote queue is attached with Transmission queue Initiation queue Dynamic queue Dead-letter queue Reply-to-queue Repository queue MQSeries Queues: Some Properties Maximum Message Size, Maximum Queue Depth, High/Low Factors, Enable/Disable Put or Get, Persistent/Not Persistent
page 31
Local Queue
Remote Queue
Local
Manager
Remote
Manager
page 33
Transmission Queue
Local queue used by channels for sending messages between queue managers
Initiation Queue Local queue used to indicate a trigger event has occurred for another message queue
page 34
Event Queue
Local queue used to hold event messages
Command Queue
Local queue used to pass administration commands to queue manager for processing
Dead-Letter Queue Local queue used to hold messages that could not be delivered Queue header is added to message with information for non-delivery like no local queue or queue is full
page 35
Process defines an application to an websphere MQ 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.
page 36
Channels
A channel is a logical communication link Provide a communication path between two queue managers on the same, or different, platforms. Two different kinds of channels: Message channels 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. Message Channels are implemented by programs called Message Channel Agents (MCA) also referred as movers MQI channels A Message Queue Interface (MQI) channel connects an MQSeries client to a queue manager in its server machine. Clients dont have a queue manager of their own. An MQI channel is bidirectional. Types of message channels: Sender - initiates connection to Receiver Server - Accepts request to start from requester, then becomes Sender Receiver - Passive; waits for initiation sequence form Sender Requester - Active at start, then becomes Receiver Cluster-sender (used amongst Cluster Queue Managers) Cluster-receiver (ditto)
page 37
page 38
Queue Operations
Define/Modify Queue DEFINE QLOCAL('queue1') DESCR(Test Queue) Creates a local queue named queue1 DEFINE QLOCAL('queue1') REPLACE DESCR(Modifieddescription) Modifies the queue1 description Displaying Queues DISPLAY QLOCAL(*) DISPLAY QLOCAL('queue1') DISPLAY QLOCAL('queue1') ALL DISPLAY QLOCAL('queue1') DEFPSIST DESCR CURDEPTH Altering Queue Definition ALTER QLOCAL('queue1') property DISPLAY QLOCAL('queue1')
page 39
Queue Operations
Put messages onto queue
amqsput queue1 Sample AMQSPUT0 start target queue is queue1
page 40
Alias queue
Creating alias Queue runmqsc DEFINE QALIAS('queue1. alias') TARGQ('queue1') DEFPSIST(YES) + DESCR(alias to queue1: For persistent messages) AMQ8006: WebSphere MQ queue created. end 2 : end One MQSC command read. No commands have a syntax error. All valid MQSC commands were processed. Displaying Alias queue runmqsc DISPLAY QALIAS('queue1.persistent') TARGQ DEFPSIST DESCR AMQ8409: Display Queue details. QUEUE(queue1.persistent) TYPE(QALIAS) TARGQ(queue1) DEFPSIST(YES) DESCR(alias to queue1: For persistent messages)
page 41
Remote queue
DEFINE QREMOTE('host1/qm1.alias') RNAME('') RQMNAME('host1/qm1') +DESCR(queue manager alias to host1/qm1') AMQ8006: WebSphere MQ queue created.
DISPLAY QREMOTE('host1/qm1.alias') RNAME RQMNAME DESCR AMQ8409: Display Queue details. QUEUE(host1/qm1.alias) TYPE(QREMOTE) DESCR(queue manager alias to host1/qm1) RQMNAME(host1/qm1) RNAME( ) end
page 42
Creating receiver channel (on TGT_MQ) DEFINE CHL ('TGT_QM.TO.SRC_QM') CHLTYPE(RCVR) TRPTYPE(TCP)
page 43
define qr(E3CITPS.IBUSIIF.R701777) rname(E3CITPS.IBUSIIF.R701777) rqmname(QM.R701777) xmitq(QM.R701777) descr('Remote Q for sending messages from E3ASIA to IDMS-777-QD BRANCH') define ql(QM.R701777) usage(xmitq) trigger descr('Xmit Q for outgoing messages from E3ASIA to IDMS-777-QD BRANCH') TRIGDATA(E3CITPS.R701777) define chl(E3CITPS.R701777) chltype(sdr) conname('sincbidmuv1.sg.db.com(41291)') xmitq(QM.R701777) descr('SDR Chl from from E3ASIA to IDMS-777-QD BRANCH') define chl(R701777.E3CITPS) chltype(rcvr) descr('Channel for receiving messages from IDMS-777-QD BRANCH to E3ASIA') DEFINE QLOCAL('R701777.IBUSOIF.E3CITPS') DESCR('Queue for receiving messages from IDMS-777-QD BRANCH to E3ASIA)
page 44
page 45
page 46
page 47
MQ CONTROL COMMANDS
Dspmqver :- to display MQ series version Dspmq :- to view all queue managers of MQ series. Crtmqm :- to create a queue manager Strmqm :- to start queue manager Runmqsc :- to enter in to particular queue manager Endmqm :- to end a queue manager Dltmqm :- to delete a queue manager Dspmqcsv :- to display command server Endmqcsv :- to end command server Strmqcsv :- to start command server Runmqlsr :- to run listener service Endmqlsr :- to end listener service Runmqchi :- to run a channel initiator for particular queue manager Runmqtrm :- to run trigger monitor on initiation queue for particular queue manager ALTER :- to update or modify the existing objects DELETE :-to delete created objects CLEAR :- to clear the message from the queue END :- to come out of the queue manager PING :- 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
page 49
Thank You
page 50