25
Copyrighted material John Tullis 06/23/22 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor [email protected]

Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor [email protected]

Embed Size (px)

Citation preview

Page 1: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 1

04/08/00 MQ Series Middleware Presentation

John TullisDePaul [email protected]

Page 2: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 2

MQSeries Part 2

The 3 basic concepts• Messages - covered last week

• Queues

• Queue Managers

Page 3: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 3

MQSeries Part 2

The Queue Manager• Owns and creates Q objects

•Create default QMgr X

• crtmqm /q X

•Start QMgr X

• strmqm X

•End QMgr X (immediate)

• endmqm /i X

•Delete QMgr X

• dltmqm X

Page 4: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 4

MQSeries Part 2

Queues• A queue is a data structure in which messages are stored. The messages may be put on, or got from, the queue by applications or by a queue manager as part of its normal operation.

• Queues exist independently of the applications that use them. A queue can exist in main storage (if it is temporary), on disk or similar auxiliary storage (if it must be kept in case of recovery), or in both places (if it is currently being used, and must also be kept for recovery). Each queue belongs to a queue manager, which is responsible for maintaining it. The queue manager puts the messages it receives onto the appropriate queue.

Page 5: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 5

MQSeries Part 2

Queue attributes determine...• Whether applications can retrieve messages from the queue (get enabled)

• Whether applications can put messages onto the queue (put enabled)

• Whether access to the queue is exclusive to one application or shared between applications

• The maximum number of messages that can be stored on the queue at the same time (maximum queue depth)

• The maximum size of messages that can be put on the queue (maximum message size)

Page 6: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 6

MQSeries Part 2

The Queue Manager• A queue manager provides queuing services to applications, and manages the queues that belong to it. It ensures that:

• Object attributes are changed according to the details received.

• Special events (such as instrumentation events or triggering) are generated when the appropriate conditions are met.

• Messages are put on the correct queue, as requested by the application. The application is informed if this cannot be done, and an appropriate reason code is given.

Page 7: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 7

MQSeries Part 2

The Local Queue Manager• Each queue belongs to a single queue manager and is said to be a local queue to that queue manager.

• The queue manager to which an application is connected is said to be the local queue manager for that application.

• For the application, the queues that belong to its local queue manager are local queues.

Page 8: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 8

MQSeries Part 2

The Remote Queue Manager• A remote queue is a queue that belongs to another queue manager.

• A remote queue manager is any queue manager other than the local queue manager.

• A remote queue manager may exist on a remote machine across the network or it may exist on the same machine as the local queue manager.

• MQSeries supports multiple queue managers on the same machine.

Page 9: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 9

MQSeries Part 2

Message Channels• Communication by applications with queues managed by another queue manager requires message channels to be defined. It is not necessary to define a channel directly to the target queue manager and it is often appropriate to define one only to the next hop (that is, an intermediate queue manager). Message channels available from that queue manager will be used to deliver the message to the target queue manager (or even to a subsequent hop).

Page 10: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 10

MQSeries Part 2

Message Channels• A message channel provides a communication path between two queue managers on the same, or different, platforms. The message channel is used for transmitting messages from one queue manager to another, and shields the application programs from the complexities of the underlying networking protocols. A message channel can transmit messages in one direction only. Two message channels are required if two-way communication is required between two queue managers.

Page 11: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 11

MQSeries Part 2

Message Channels• Channels are used to send messages from one Queue Manager to another Queue Manager

•Channels send messages in one direction only

•A Channel consists of two message channel agents (MCA): a sending MCA and a receiving MCA

remQ1

A

RQ1

Queue Manager

X

Q1

B

remRQ1

Queue Manager

Y

Y.X

X.Y

Channels

RCVR SDR

SDR RCVR

Page 12: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 12

MQSeries Part 2

Message Channels• Queue managers X and Y can be on the same machine.

remQ1

A

RQ1

Q1

B

remRQ1

Channel X.Y

Channel Y.X

Queue Manager

XQueue Manager

Y

Page 13: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 13

MQSeries Part 2

Message Channels• Queue managers X and Y can be on different machines.

remQ1

A

RQ1

Q1

B

remRQ1

Channel X.Y

Channel Y.X

Queue Manager

XQueue Manager

Y

Page 14: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 14

MQSeries Part 2

Local & Remote Q’s•Local Q: queue physically exists on local system (e.g., Q1)

•Remote Q: pointer to queue on another system (e.g., remQ1)

•Transmit Q: special local queue which holds message until the message channel can send message to remote system. (xmitq)

A

B

QMgr YQMgr X

Y.xmitQX.Y

remQ1Q1

Page 15: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 15

MQSeries Part 2

Transmitting a message to a remote Queue

A

B

QMgr YQMgr X

Y.xmitQX.Y

remQ1Q1

1

2

3

4

Page 16: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 16

MQSeries Part 2

Transmitting a message to a remote Queue• (1)Application A puts message to a remote queue (remQ1) (application program does not need to know if target queue is local or remote)

• (2)MQ automatically attaches transmit header to message and places message on transmit q (Y.xmitQ)

• (3) MQ sender channel agent sends message to receiver channel agent, which then places message on local queue of target QMgr (Q1)• (4)Application B gets message from local queue (Q1)

Page 17: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 17

MQSeries Part 2

Round Robin• (1) Application A puts message to a remote queue (remQ1)

• (2) MQ automatically places message on transmit q (Y.xmitQ)

• (3) MQ sender channel agent sends message to other system, which then places message on local queue of target QMgr (Q1)

• (4) Application B gets message from local queue (Q1)

• (5) Application B puts reply message to a remote queue (remRQ1)

• (6) MQ automatically places message on transmit q (X.xmitQ)

• (7) MQ channel sends message to target system and places message on local queue of target QMgr (RQ1)

• (8) Application A gets message from local queue (RQ1) QMgr

Page 18: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 18

MQSeries Part 2

Round Robin

A

B

QMgr YQMgr X

Y.xmitQX.Y

Y.X

RQ1

X.xmitQ

remRQ1

remQ1Q1

Page 19: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 19

MQSeries Part 2

Different Queue Types• Local Queues

• Owned by Queue Manager application connected to

• Applications can put and get messages

• Transmission, Dead-Letter, System Command, Event, etc

•Remote Queue

• Owned by different Queue Manager

• Applications can only put message

•Alias Queues

• used to access another queue

Page 20: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 20

MQSeries Part 2

Alias Queues• allows applications to access a queue by referring to it indirectly in MQI calls

•Name is resolved to local or remote queue at run time (many to one)

•Allows the queues that an application uses to be changed without changing the application in any way

• merely change the alias queue definition

•Access authorization (read/write) can be established using alias queues

• one alias queue has read only,

• another alias to same physical queue has write access

Page 21: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 21

MQSeries Part 2

Processes and Triggering• An application program or a message channel can be started / triggered when a message arrives on a queue

•A MQ process is the definition of that program or channel to MQ

•A queue definition references the MQ process and is used to indicate that triggering is enabled

Page 22: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 22

MQSeries Part 2

Administrative Commands• You use the MQSeries (MQSC) commands to manage queue manager objects, including the queue manager itself, channels, queues, and process definitions. For example, there are commands to define, alter, display, and delete a specified queue. To execute these commands you must invoke the control command:

• runmqsc

• You can use file indirection / redirection:

• runmqsc < filename.in > filename.out

• To run to create system / default objects:

• runmqsc < amqscoma.txt

Page 23: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 23

MQSeries Part 2

Application Programming

MQCONN . . . . . . . . . . . . . connects application to specific queue manager

MQOPEN . . . . . . . . . . . . . opens a particular queue for input / output / both

- - -

MQPUT . . . . . . . . . . . . . . . puts a message onto a message queue with options

- - -

MQGET . . . . . . . . . . . . . . gets a message from a message queue with options

- - -

MQCLOSE . . . . . . . . . . . . closes a queue

MQDISC . . . . . . . . . . . . . . disconnects application from queue manager

Application Program

typically C or Cobolalso Java & LotusScript

"maj

or c

alls

"

Page 24: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 24

MQSeries Part 2

Application Programming•MQPUT1 - implements open, put 1 message, close of queue

•MQCMIT / MQRLBK - commits/rolls back get/put of messages under sync. control

•MQINQ / MQSET - inquiry/set of MQ object options

Page 25: Copyrighted material John Tullis 12/16/2015 page 1 04/08/00 MQ Series Middleware Presentation John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

Copyrighted materialJohn Tullis

04/21/23page 25

MQSeries Part 2

Transactional support• An application program may need to group a set of updates into a unit of work. Such updates are usually logically related and must all be successful for data integrity to be preserved. Data integrity would be lost if one update in the group succeeded while another failed. MQSeries supports transactional messaging.• A unit of work commits when it completes successfully. At this point all updates made within that unit of work are made permanent and irreversible. Alternatively, all updates are backed out if the unit of work fails. Syncpoint coordination is the process by which a unit of work is either committed or backed out with integrity.