M Qi Series Linux

26
© 2009 IBM Corporation [email protected] © 2012 dcyoga.com [email protected] © 2012 dcyoga.com MQiSeriesLinux - set up MQ iSeries to Windows/Linux Frederick James Rathweg Owner / Island Macro Systems, Inc. IBM WebSphere MQ

description

 

Transcript of M Qi Series Linux

Page 1: M Qi Series Linux

© 2009 IBM [email protected] © 2012 [email protected] © 2012 dcyoga.com

MQiSeriesLinux - set up MQ iSeries to Windows/Linux

Frederick James RathwegOwner / Island Macro Systems, Inc.

IBM WebSphere MQ

Page 2: M Qi Series Linux

[email protected] © 2012 dcyoga.com

MQ iSeries to Windows/Linux - set up

• Connect two MQ queue managers together so that messages can be sent between them.

• Preparations needed to allow an application using queue manager QM1 to put messages on a queue at queue manager QM2.

• An application running on QM2 can retrieve these messages, and send responses to a reply queue on QM1.

2

Corporate karma empowers the human will for good。

Page 3: M Qi Series Linux

[email protected] © 2012 dcyoga.com

MQ iSeries Deciding on a connection- set up • For TCP, a host address may be used, each distributed service is

allocated a unique TCP address which may be used by remote machines to access the service.

• The TCP address consists of a host name/number and a port number. All queue managers will use such a number to communicate with each other via TCP.

3

Corporate karma empowers the human will for the achievement of greatness.

• SNA (LU 6.2) requires definition of an SNA logical unit type 6.2 (LU 6.2) that provides the physical link between the iSeries (serving the local queue manager ) and the system serving the remote queue manager.

Page 4: M Qi Series Linux

[email protected] © 2012 dcyoga.com4

SNA Configuration on the iSeries

Configuration parameters for an LU 6.2 connection

Corporate karma is a guide for success and for a positive, dynamic, rich, triumphant and joyous career.

ID Parameter Name Reference Example Use User Value

1 Local network ID NETID

2 Local control point name AS400PU

3 LU name AS400LU

4 LAN destination address 10005A5962EF

5 Subsystem description QCMN

6 Line description TOKENRINGL

7 Resource name LIN041

8 Local Transaction Program name MQSERIES

Page 5: M Qi Series Linux

[email protected] © 2012 dcyoga.com5

Explanation of parameters for an LU 6.2 connection

Corporate karma is a guide for success and for a dynamic, rich, and triumphant career.

• 123 use command DSPNETA.

• 4 LAN destination address You can find the value using the command DSPLIND Line description (6).

• 5 Subsystem description

• 6 Line description If this has been specified it is indicated in the

• 7 Resource name

• 8 Local Transaction Program name For simplicity, wherever possible use a transaction program name of MQSERIES.

Page 6: M Qi Series Linux

[email protected] © 2012 dcyoga.com6

• To display the current network attributes enter the command DSPNETA, to change CHGNETA.

• To display the Resource name, Type WRKHDWRSC TYPE(*CMN) and press Enter.

• If the line description (6) has not already been created use CRTLINTRN and resource name (7).

• Enter ADDRTGE - Subsystem description (5), Compare value (8), Starting position, Program to call.

• STRSBS subsystem description (5) and press Enter

Establishing an LU 6.2 connection - local

Page 7: M Qi Series Linux

[email protected] © 2012 dcyoga.com7

Configuration parameters for an LU 6.2 connection

Corporate karma is a guide for success and for a positive and joyous career.

• Connection to a Linux (x86 platform) system

ID Parameter Name Reference Example Use User Value

9 Network ID 4 NETID

10 Control point name 2 LINUXPU

11 LU name 5 LINUXLU

12 Controller description LINUXPU

13 Device LINUXLU

14 Side information LXCPIC

15 Transaction Program 7 MQSERIES

16 LAN adapter address 8 08005AC6DF33

17 Mode 6 #INTER

Page 8: M Qi Series Linux

[email protected] © 2012 dcyoga.com8

Configuration parameters for an LU 6.2 connection

Corporate karma is a guide for success and for a positive and joyous career.

• Connection to a Windows system

ID Parameter Name Reference Example Use User Value

9 Network ID 2 NETID

10 Control point name 3 WINNTCP

11 LU name 5 WINNTLU

12 Controller description WINNTCP

13 Device WINNTLU

14 Side information NTCPIC

15 Transaction Program 7 MQSERIES

16 LAN adapter address 9 08005AA5FAB9

17 Mode 17 #INTER

Page 9: M Qi Series Linux

[email protected] © 2012 dcyoga.com9

• CRTCTLAPPC Controller description (12), set Link type: *LAN, Online at IPL: *NO. Enter twice, followed by F10. Switched line list (6), Remote network identifier (9), Remote control point (10), and LAN remote adapter address (16). Enter.

• CRTDEVAPPC Device description (13), Remote location (11), Local location (3), Remote network identifier (9), and Attached controller (12).

• CRTCSI (F10) Side information (14), Remote location (11), Transaction program (15), Local location (3), Mode, Remote network identifier (9).

• ADDCMNE Subsystem description (5) and Device (13),

• ADDCFGLE *APPNRMT (F4) Remote location name (11), Remote network identifier (9), Local location name (3), Remote control point (10), and Control point net ID (9).

LU 6.2 connection to partner node

As part of this cosmic stream, expect the unexpected.

Page 10: M Qi Series Linux

[email protected] © 2012 dcyoga.com10

If TCP is already configured there is no configuration, else

• Use ADDTCPIFC to enter this machine’s Internet address and Line description, and a Subnet mask.

• TCP/IP loopback ADDTCPIFC Internet address 127.0.0.1, Line description, and Subnet mask 255.0.0.0

• ADDTCPRTE Enter to create a default route entry.

Establishing a TCP connection

In this fast-moving, eternally dynamic, ever-changing universe, there is nothing unmoving.

Page 11: M Qi Series Linux

[email protected] © 2012 dcyoga.com11

• Start the TCP channel listener STRMQMLSR.

• Start sender: STRMQMCHL CHLNAME(channel_name).

• WRKMQMQ display the WebSphere MQ configuration menu.

WebSphere MQ for iSeries configuration

Page 12: M Qi Series Linux

[email protected] © 2012 dcyoga.com12

• First create a queue manager CRTMQM (Enter).

• Message Queue Manager name: AS400. Undelivered message queue: DEAD.LETTER.QUEUE.

• Start queue manager: STRMQM MQMNAME(AS400).

• Create the undelivered message queue,CRTMQMQ Local Queue Queue name : DEAD.LETTER.QUEUE Queue type : *LCL

MQ for iSeries Basic configuration

The best way to learn and study is to be on the same wavelength, then meaning is transmitted from heart to heart.

Page 13: M Qi Series Linux

[email protected] © 2012 dcyoga.com13

• Local node- Queue Manager Name: AS400, Local queue name: AS400.LOCALQ

• Connection MQ for Windows Remote queue manager name (A) WINNTRemote queue: WINNT.REMOTEQQueue name remote(B ): WINNT.LOCALQTransmission queue: WINNT

Sender (SNA) channel: AS400.WINNT.SNA (TCP/IP) : AS400.WINNT.TCP

Receiver (SNA) channel: WINNT.AS400.SNA(TCP/IP): WINNT.AS400.TCP

Configuration WebSphere MQ for iSeries to Windows

The cosmic stream. You don’t know what is coming.

Page 14: M Qi Series Linux

[email protected] © 2012 dcyoga.com14

• Local node- Queue Manager Name: AS400, Local queue name: AS400.LOCALQ

• Connection MQ for Linux Remote queue manager name (A) LINUXRemote queue: LINUX.REMOTEQQueue name remote (B ): LINUX.LOCALQTransmission queue: LINUX

Configuration WebSphere MQ for iSeries to Linux

The cosmic stream. You don’t know what is coming.

Sender (SNA) channel: AS400.LINUX.SNA (TCP/IP) : AS400.LINUX.TCP

Receiver (SNA) channel: LINUX.AS400.SNA(TCP/IP): LINUX.AS400.TCP

Page 15: M Qi Series Linux

[email protected] © 2012 dcyoga.com15

for WebSphere MQ for iSeries message channel example

MQiSeriesLinux - function

In the light you are able to see,

Page 16: M Qi Series Linux

[email protected] © 2012 dcyoga.com16

• QM1: Remote queue definition CRTMQMQ: QNAME ‘PAYROLL.QUERY’ QTYPE *RMT TEXT ‘Remote queue for QM2’ PUTENBL *YES TMQNAME ‘QM2’ (default = remote queue manager name) RMTQNAME ‘PAYROLL’ RMTMQMNAME ‘QM2’

• QM1: Transmission queue definition CRTMQMQ:QNAME QM2 QTYPE *LCL TEXT ‘Transmission queue to QM2’ USAGE *TMQ PUTENBL *YES GETENBL *YES TRGENBL *YES TRGTYPE *FIRST INITQNAME SYSTEM.CHANNEL.INITQ TRIGDATA QM1.TO.QM2

When the first message is put on this transmission queue, a trigger message is sent to the initiation queue, SYSTEM.CHANNEL.INITQ. The channel initiator gets the message from the initiation queue and starts the channel identified in the named process.

Queue manager QM1 example YAMAS

Ahimsa Ahimsa (अहिं��सा�): not causing pain in thought, word, or deed.

Page 17: M Qi Series Linux

[email protected] © 2012 dcyoga.com17

• Sender channel definition CRTMQMCHL CHLNAME QM1.TO.QM2 CHL TYPE *SDR TRPTYPE *TCP TEXT ‘Sender channel to QM2’ TMQNAME QM2 CONNAME ‘9.20.9.32(1412)’

• Receiver channel definition CRTMQMCHL CHLNAME QM2.TO.QM1 CHLTYPE *RCVR TRPTYPE *TCP TEXT ‘Receiver channel from QM2’

• Reply-to queue definition CRTMQMQ QNAME PAYROLL.REPLY QTYPE *LCL TEXT ‘Reply queue for replies to query messages sent to QM2’ PUTENBL *YES GETENBL *YES

Queue manager QM1 example YAMAS

SatyaSatya (सात्य): truthfulness, in word and thought.

Page 18: M Qi Series Linux

[email protected] © 2012 dcyoga.com18

• QM2: Remote queue definition CRTMQMQ: QNAME PAYROLL QTYPE *LCL TEXT ‘Local queue for QM1 payroll details’ PUTENBL *YES GETENBL *YES’

• QM2: Transmission queue definition CRTMQMQ:QNAME QM1 QTYPE *LCL TEXT ‘Transmission queue to QM1’ USAGE *TMQ PUTENBL *YES GETENBL *YES TRGENBL *YES TRGTYPE *FIRST INITQNAME SYSTEM.CHANNEL.INITQ TRIGDATA QM2.TO.QM1

Queue manager QM2 example YAMAS

Asteya Asteya (अस्ते�य): non-stealing, non-coveting, non-entering into debt.

Page 19: M Qi Series Linux

[email protected] © 2012 dcyoga.com19

• Sender channel definition CRTMQMCHL CHLNAME QM2.TO.QM1 CHLTYPE *SDR TRPTYPE *TCP TEXT ‘Sender channel to QM1’ TMQNAME QM1CONNAME ‘9.20.9.31(1411)’

• Reply-to queue definition CRTMQMQ CHLNAME QM1.TO.QM2 CHLTYPE *RCVR TRPTYPE *TCP TEXT ‘Receiver channel from QM1’

Queue manager QM2 example YAMAS

BrahmacharyaBrahmacharya (ब्रह्मचय�): celibate when single, faithful when married.

Page 20: M Qi Series Linux

[email protected] © 2012 dcyoga.com20

• Shaucha: Shaucha: under YamasYamas; means purity.

Running the example NIYAMAS

When you have created the required objects, you must:

1.Start the channel initiator for both queue managers 2.Start the listener for both queue managers 3.Then the applications can then send messages to each other. 4.Channels are triggered to start by the first message arriving on each transmission queue, so you do not need to issue the STRMQMCHL command.

Page 21: M Qi Series Linux

[email protected] © 2012 dcyoga.com21

• SantoshaSantosha: contentment.

Expanding this example NIYAMAS

This example can be expanded by:

• Adding more queue and channel definitions to allow other applications to send messages between the two queue managers.

•Adding user exit programs on the channels to allow for link encryption, security checking, or additional message processing.

•Using queue manager aliases and reply-to queue aliases to understand more about how these can be used in the organization of your queue manager network.

Page 22: M Qi Series Linux

[email protected] © 2012 dcyoga.com22

• TapasTapas: austerity.

Programming with WebSphere MQ NIYAMAS

• The MQI API is designed as a simple call interface with a limited number of calls and a rich set of options for each call.

• However, sensible default and initial values for the options ensure that it is easy and quick to get applications up and running.

• The WebSphere MQ Application Programming Reference defines the MQI, and uses a language-independent notation to describe each call and its parameters.

Page 23: M Qi Series Linux

[email protected] © 2012 dcyoga.com23

• Svādhyāya: Svādhyāya: self-study or study of spiritual scriptures.

Queue managers and the MQI NIYAMASThere are eight major calls in the MQI:• MQOPEN - open a queue for access• MQCLOSE - close a queue for access• MQPUT- put a message on a queue• MQGET - get a message from a queue• MQPUT1 - open a queue, put a message on it, then close the queue• MQOPEN - open a queue for access• MQCLOSE - close a queue for access• MQPUT- put a message on a queue• MQGET - get a message from a queue• MQPUT1 - open a queue, put a message on it, then close the queueThere are five minor calls in the MQI:• MQBEGIN - begin a unit of work• MQCMIT - commit a unit of work• MQBACK - rollback a unit of work• MQINQ - inquire on the attributes of a WebSphere MQ object (a queue is an example of a WebSphere MQ object; a queue manager is anotherexample)

• MQSET - set the attributes of a WebSphere MQ object

Page 24: M Qi Series Linux

[email protected] © 2012 dcyoga.com

Operator commands sat/asat

asato ma satgamaya - Lead me from asat to the sat Asat means non-existence, non-reality and untruth

24

Channel commands CHG, CPY, CRT, DLT, DSP, END, PNG,RST, RSV, STR, WRK…MQM Channel ENDMQMLSR, End MQM Listener STRMQMCHLI, Start MQM Channel Initiator STRMQMLSR, Start MQM Listener WRKMQMCHST, Work with MQM Channel Status Cluster commands RFR, RST, WRK…MQMCL, Work with Clusters RSM, SPD… MQMCLQM, Resume Cluster Queue Manager Command Server commands DSP ,END, STR …MQMCSVR, MQM Command Server CVTMQMDTA, Convert MQM Data Type Command STRMQMDLQ, Start MQ Dead-Letter Queue Handler RCDMQMIMG, Record MQM Object Image RCRMQMOBJ, Recreate MQM Object

STRMQMMQSC, Start MQSC Commands DSPMQMOBJN, Display MQM Object Names STRMQMTRM, Start Trigger Monitor

Namelist commands CHG, CPY, CRT, DLT, DSP, WRK…MQMNL, MQM Namelists Process commands CHG, CPY, CRT, DLT, DSP , WRK … MQMPRC, (MQM Processes) Queue commands CHG, CPY, CLR, CRT, DLT, DSP, WRK…MQMQ, MQM Queue WRKMQMMSG, Work with MQM Messages Queue Manager commands CCT, CHG, CRT, DLT, DSC, DSP, END, STR, WRK … MQM, Message Queue managers Security commands DSP, GRT, RVK …MQMAUT, MQM Object Authority TRCMQM, Trace MQM Job RSVMQMTRN, Resolve MQSeries® Transaction WRKMQMTRN, Display MQSeries Transaction

Page 25: M Qi Series Linux

© 2009 IBM [email protected] © 2012 [email protected] © 2012 dcyoga.com

Thank You

Frederick James RathwegOwner / Island Macro Systems, Inc.

Page 26: M Qi Series Linux

[email protected] © 2012 dcyoga.com26

• tamaso ma jyotir gamaya (from darkness to light)

Programming with WebSphere MQ

•The MQI API is designed as a simple call interface with a limited number of calls and a rich set of options for each call.

•However, sensible default and initial values for the options ensure that it is easy and quick to get applications up and running.

•The WebSphere MQ Application Programming Reference defines the MQI, and uses a language-independent notation to describe each call and its parameters.