mq training do

50
MQSeries - Infrastructure Team – Websphere MQ overview

Upload: nandoooo86

Post on 21-May-2017

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: MQ Training DO

MQSeries

- Infrastructure Team – Websphere MQ overview

Page 2: MQ Training DO

· page 2

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 3: MQ Training DO

· page 3

What is a message?

A piece of information :

Maybe a request, a response, a report or an announcement

Message Header Application Data

Page 4: MQ Training DO

· page 4

•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.

What is Websphere MQ?

Page 5: MQ Training DO

· page 5

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 6: MQ Training DO

Message Types

· page 6

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 7: MQ Training DO

· page 7

How messaging and queuing works

Page 8: MQ Training DO

· page 8

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 9: MQ Training DO

· page 9

How messaging and queuing works

Page 10: MQ Training DO

· page 10

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 11: MQ Training DO

· page 11

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 12: MQ Training DO

· page 12

Features of messaging and queuing

Page 13: MQ Training DO

· page 13

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 14: MQ Training DO

· page 14

Features of messaging and queuing

One to Many relationship

Page 15: MQ Training DO

· page 15

Features of messaging and queuing

Many to one relationship

Page 16: MQ Training DO

· page 16

Features of messaging and queuing

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

Page 17: MQ Training DO

· page 17

Features of messaging and queuing

Any relationship is possible

Page 18: MQ Training DO

· page 18

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 19: MQ Training DO

· page 19

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 20: MQ Training DO

· page 20

Examples of messaging & queuing

Insurance business

Page 21: MQ Training DO

· page 21

Examples of messaging & queuing

Manufacturing Industry

Page 22: MQ Training DO

· page 22

Examples of messaging & queuing

Retail Industry

Page 23: MQ Training DO

· page 23

Examples of messaging & queuing

Travel Industry

Page 24: MQ Training DO

· page 24

Examples of messaging & queuing

Banking Industry

Page 25: MQ Training DO

· page 25

The MQSeries Architecture

Page 26: MQ Training DO

· page 26

The MQSeries Architecture

Messaging Architecture

Logical view of MQSeries

MQ Components

Page 27: MQ Training DO

How MQ Works

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

Page 28: MQ Training DO

· page 28

The MQSeries Architecture

A remote queue is assoicated with a transmission (xmit) queue, which is local queueThere is one queue for each remote queue managerTransmission queue is assoicated with a message channel

Page 29: MQ Training DO

· page 29

The MQSeries (Objects):

MQSeries components

Queues Manager Queue Channels Listeners

Page 30: MQ Training DO

· page 30

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 31: MQ Training DO

· page 31

MQ Series Components - QueuesMQSeries 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 queueMQSeries Queues: Some Properties Maximum Message Size, Maximum Queue Depth, High/Low Factors, Enable/Disable Put or Get, Persistent/Not Persistent

Page 32: MQ Training DO

· page 32

MQSeries Components - Queues

Local Queue

A queue that exists on the local queue manager.

Page 33: MQ Training DO

· page 33

MQSeries Components - Queues

Remote Queue

A queue that exists on a different queue manager.

Manager

Manager

RemoteLocal

Page 34: MQ Training DO

· page 34

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

Event Queue Local queue used to hold event messages

Page 35: MQ Training DO

· page 35

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 36: MQ Training DO

· page 36

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 don’t want to deploy long-running programs.

Page 37: MQ Training DO

· page 37

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 don’t have a queue manager of their own. An MQI channel is bidirectional.

Types of message channels:Sender - initiates connection to ReceiverServer - Accepts request to start from requester, then becomes SenderReceiver - Passive; waits for initiation sequence form SenderRequester - Active at start, then becomes ReceiverCluster-sender (used amongst Cluster Queue Managers)Cluster-receiver (ditto)

Page 38: MQ Training DO

Queue Manager Operations

· page 38

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

StrmqmStarts queue manager

DspmqLists all the queue managers

runmqscStarts queue manager scripting interface

Page 39: MQ Training DO

Queue Operations

· page 39

Define/Modify QueueDEFINE QLOCAL('queue1') DESCR(Test Queue)

Creates a local queue named queue1DEFINE QLOCAL('queue1') REPLACE DESCR(Modifieddescription)

Modifies the queue1 description

Displaying QueuesDISPLAY QLOCAL(*)DISPLAY QLOCAL('queue1')DISPLAY QLOCAL('queue1') ALLDISPLAY QLOCAL('queue1') DEFPSIST DESCR CURDEPTH

Altering Queue DefinitionALTER QLOCAL('queue1') propertyDISPLAY QLOCAL('queue1')

Page 40: MQ Training DO

· page 40

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 41: MQ Training DO

· page 41

Alias queueCreating alias QueuerunmqscDEFINE QALIAS('queue1. alias') TARGQ('queue1') DEFPSIST(YES) + DESCR(alias to queue1:

For persistent messages)AMQ8006: WebSphere MQ queue created.end2 : endOne MQSC command read.No commands have a syntax error.All valid MQSC commands were processed.

Displaying Alias queuerunmqscDISPLAY QALIAS('queue1.persistent') TARGQ DEFPSIST DESCRAMQ8409: Display Queue details.QUEUE(queue1.persistent) TYPE(QALIAS)TARGQ(queue1) DEFPSIST(YES)DESCR(alias to queue1: For persistent messages)

Page 42: MQ Training DO

· page 42

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 43: MQ Training DO

· page 43

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 44: MQ Training DO

MQ Connectivity Establish and Testing

· page 44

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 45: MQ Training DO

· page 45

MQ Connectivity Establish and Testing

Page 46: MQ Training DO

· page 46

MQ Connectivity Establish and Testing

Page 47: MQ Training DO

MQ SSL certificate configuration to QManager

· page 47

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 48: MQ Training DO

· page 48

MQ SSL certificate activation to QManagerStep3: upload the .csr for the Qmgr in PKI websiteStep4: 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 binaryStep6: to verify the detail of the certificategsk7cmd -cert -details -db qmgrS.kdb -pw XXXX -label ibmwebspheremqqm.qmgrStep7: Configure the Channel attributes changes: runmqsc QM.MU00243alter 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.MU00243alter 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 49: MQ Training DO

MQ CONTROL COMMANDS

· page 49

Dspmqver :- to display MQ series versionDspmq :- to view all queue managers of MQ series.Crtmqm :- to create a queue managerStrmqm :- to start queue managerRunmqsc :- to enter in to particular queue managerEndmqm :- to end a queue managerDltmqm :- to delete a queue managerDspmqcsv :- to display command serverEndmqcsv :- to end command serverStrmqcsv :- to start command serverRunmqlsr :- to run listener serviceEndmqlsr :- to end listener serviceRunmqchi :- to run a channel initiator for particular queue managerRunmqtrm :- to run trigger monitor on initiation queue for particular queue managerALTER :- to update or modify the existing objectsDELETE :-to delete created objectsCLEAR :- to clear the message from the queueEND :- to come out of the queue managerPING :- check whether other side channel / queue manager is ready to accept our request.START :- to start the particular channel or listenerSTOP :-to stop particular channel or listenerREFRESH :-used to refresh the security every time after giving

Page 50: MQ Training DO

· page 50

Thank You …