Вы находитесь на странице: 1из 50

MQSeries

- Infrastructure Team Websphere MQ overview

Message Oriented Middleware

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?

A piece of information : Maybe a request, a response, a report or an announcement


Message Header Application Data

page 3

What is Websphere MQ?


IBM WebSphere MQ is a family of network communication software products launched by IBM. It allows independent and potentially non-concurrent applications on a distributed systems to communicate with each other. A middleware product that implements a messaging and queuing framework.

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

What is Messaging and Queueing


Message queuing is a method of program-to-program communication. Programs within an application communicate by writing and retrieving application-specific data (messages) to/from queues, without having a private, dedicated, logical connection to link them Messaging - programs communicate by sending data in messages rather than by calling each other directly. Queuing - messages are put on queues in storage, eliminating the need for programs to be logically connected. Messaging means that programs communicate by sending each other messages (data), rather than by calling each other directly.

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

How messaging and queuing works

page 7

How messaging and queuing works

Communication can be one-way or two-way


Message can be one-way (previous example) or they can be reciprocated. If no response is required, none is sent.

page 8

How messaging and queuing works

page 9

Features of messaging and queuing


Key facts about Messaging and Queuing differentiate it from other communication styles: 1) Communicating programs can run at different times. 2) There are no constraints on application structure. 3) Programs are insulated from environmental differences. 4) If the target program is not available, the messages stay in a queue and get processed later 5) Applications can be running all day long or they can be triggered, that is, automatically started when a message arrives or after a specified number of messages have arrived.

page 10

Features of messaging and queuing

Communicating programs can be run at different times


Programs talk indirectly by putting messages on message queues Program can be busy or unavailable

page 11

Features of messaging and queuing

page 12

Features of messaging and queuing

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

Features of messaging and queuing

One to Many relationship

page 14

Features of messaging and queuing

Many to one relationship

page 15

Features of messaging and queuing

The one-to-one, one-to many and many-to-one relationship

page 16

Features of messaging and queuing

Any relationship is possible

page 17

Features of messaging and queuing

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

Benefits of messaging and queuing

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

Examples of messaging & queuing

Insurance business

page 20

Examples of messaging & queuing

Manufacturing Industry

page 21

Examples of messaging & queuing

Retail Industry

page 22

Examples of messaging & queuing

Travel Industry

page 23

Examples of messaging & queuing

Banking Industry

page 24

The MQSeries Architecture

page 25

The MQSeries Architecture

Messaging Architecture Logical view of MQSeries MQ Components

page 26

How MQ Works

Queue Manager (MQM) Listener Trigger Monitor Channel Initiator Message Channel Agent (MCA) or mover

The MQSeries Architecture

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

The MQSeries (Objects):

MQSeries components Queues Manager Queue Channels Listeners

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

MQ Series Components - 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). 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

MQSeries Components - Queues

Local Queue

A queue that exists on the local queue manager.


page 32

MQSeries Components - Queues

Remote Queue
Local

Manager

Remote

Manager

page 33

A queue that exists on a different queue manager.

MQSeries Components - Queues

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

MQSeries Components - Queues

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

Events, Triggers, Process


Local queues can generate events (messages) under certain conditions (like queue full).
These event messages can be used to trigger the execution of a program. These events are called trigger messages. The queue on which they are put is called an Initiation Queue.

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.

Triggering is useful when you dont want to deploy long-running programs.

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

Queue Manager Operations

crtmqm -q host1/qm1 creates a queue manager name qm1 on host1


Strmqm Starts queue manager Dspmq Lists all the queue managers runmqsc Starts queue manager scripting interface

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

Read message from Queue


amqsbcg queue1 > queue1.txt Reads messages from queue and messages will not be removed from queue

Gets messages from queue and messages will be removed


amqsget 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

Channel and Listener


Creating sender channel (from SRC_QM to TGT_QM) DEFINE CHL ('SRC_QM.TO.TGT_QM') CHLTYPE(SDR) TRPTYPE(TCP) + CONNAME ('IP_address(port)') XMITQ('TGT_QM') DISCINT(0)

Creating receiver channel (on TGT_MQ) DEFINE CHL ('TGT_QM.TO.SRC_QM') CHLTYPE(RCVR) TRPTYPE(TCP)

Creating listener on SRC_QM DEFINE LISTENER(SRC_QM.listener) TRPTYPE (TCP) PORT(1414)

page 43

MQ Connectivity Establish and Testing

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

MQ Connectivity Establish and Testing

page 45

MQ Connectivity Establish and Testing

page 46

MQ SSL certificate configuration to QManager


Step1: Download root_ca10.cer and server_ca10.cer for the server(MQ Qmgr) from PKI

Step2: Generate the certificate for the MQ Qmgr.


gsk7cmd -keydb -create -db qmgr.kdb -pw XXXX -type cms stash gsk7cmd -cert -add -file root_ca10.cer -db qmgr.kdb -pw XXXX -label 'Deutsche Bank Group Root TEST CA 10' -format ascii -trust enable gsk7cmd -cert -add -file server_ca10.cer -db qmgr.kdb pw XXX -label 'Deutsche Bank Group Server TEST CA 10' -format ascii -trust enable gsk7cmd -certreq -create -file qmgr.req -pw XXXX -db qmgr.kdb -dn 'CN=sinpbebdgu2z1.sg.db.com:QM.AMBUATPS,O=Deutsche Bank AG,C=DE' -size 1024 label ibmwebspheremqqm.qmgrname gsk7cmd -cert -list db qmgr.kdb -pw xxxxx

page 47

MQ SSL certificate activation to QManager


Step3: upload the .csr for the Qmgr in PKI website Step4: Download the certificate once the pki team has been approved the certificate. Step5: import the certificate in the .kbd gsk7cmd -cert -receive -file hostname_QMGR.der -db qmgrS.kdb -pw XXXX' -default_cert yes -format binary Step6: to verify the detail of the certificate gsk7cmd -cert -details -db qmgrS.kdb -pw XXXX -label ibmwebspheremqqm.qmgr Step7: Configure the Channel attributes changes: runmqsc QM.MU00243 alter channel(MU00243.ME32) CHLTYPE(SDR) SSLCIPH(TRIPLE_DES_SHA_US) alter channel(MU00243.ME32) CHLTYPE(SDR) SSLPEER('CN=*:QM.ME32,O=Deutsche Bank AG) runmqsc QM.MU00243 alter channel(ME32.MU00243) CHLTYPE(RCVR) SSLCAUTH(REQUIRED) alter channel(ME32.MU00243) CHLTYPE(RCVR) SSLCIPH(TRIPLE_DES_SHA_US) alter channel(ME32.MU00243) CHLTYPE(RCVR) SSLPEER('CN=*:QM.ME32,O=Deutsche Bank AG') REFRESH SECURITY TYPE(ssl)
page 48

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

Вам также может понравиться