Académique Documents
Professionnel Documents
Culture Documents
Websphere MQ Series
Agenda
Websphere MQ Introduction
Websphere MQ Objects
Websphere MQ Administration Basics
Hands-on part 1
Distributed MQ
Websphere MQ Clusters
Hands-on part 2
Websphere MQ Programming Basics
Hands-on part 3
Introduction
Messaging is
Queuing
Requirements
Distributed applications and systems
Increase in program to program communication
Heterogeneous Platforms
Multiple communication protocols
Maximize resource utilization
Development complexity and resource skill set
Windows
UNIX (AIX\Linux\Sun Solaris, HP-UX)
AS/400
Z/OS
MQ Objects
MQ Message
String of bytes meaningful to the entity using it.
Two parts to MQ messages
Application Data
Message Descriptor
MQ Messages
MQ Message Descriptor
Version
Message ID/Correlation ID
Persistent/Non persistent
Priority
Date and time
Life time of a message
Coded Character Set Id
Format
Sender application and type
Report options/Feedback
Back out counter
Segmentation/Grouping information
MQ Object Types
Queue manager
Queue
Process Definitions
Channels
Name lists
System Default Objects
Clusters
Authentication Information Objects
MQ Object Names
Up to 48 characters for all objects except channels
Up to 20 characters for channels
Uppercase A- Z
Lowercase a - z
Numerics 0 - 9
Period (.)
Underscore (_)
Forward slash (/)*
Percent sign (%)*
* - If used, names should be enclosed in double quotes since these are special characters
Managing MQ Objects
Control commands typed in through key board.
MQSC commands through key board or from files
Programmable Command Format (PCF) Messages
MQ Administration Interface (MQAI) call from a
program
MQ Explorer snap-in and MQ services snap-in
running under Microsoft management Console*
MQ Queues
For Applications
Local Queues
Remote Queues
Alias Queues
Model Queues
Dynamic Queues
Used by MQ
Initiation Queues
Transmission Queues
Cluster Transmission
Queues
Dead-letter Queues
Command Queues
Reply-to queues
Event Queues
Process definition
Defines an application that starts in response to a
trigger
Attributes include application type, application ID
(path) and data specific to the application
Channels
Logical communication link
Communication path from one MQM to another
Used to move messages between MQMs
Shields applications from underlying protocols
Message Channels connects two MQMs
Namelist
Contains a list of MQ objects; queue, cluster,
authinfo
Typically used by trigger monitors to identify a
group of queues
Used in clustered environment to inform the
availability of an MQ object to clusters
Maintained independent of application and can be
modified without stopping it
Multiple applications can use a Namelist
MQ Overview1
MQ Overview
MQ Client
MQ Server (MQM1)
MQ Server (MQM2)
Remote Q
Local Q
Application
MQPUT
MQI
Channel
MQI
Channel
Sender
Channel
Receiver
Channel
Putting Together1
Descriptio n
Event queue for channels
Administration command queue. Used for remote MQSC commands and PCF commands.
Event queue for performance events
Event queue for queue manager events
The queue that holds access control lists for the queue manager.
Channel initiation queue
The queue that holds the synchroniz ation data for channels.
Default CICS initiation queue.
The queue used to carry messages to the repository queue manager.
The queue used to store all repository information
The transmission queue for all messages to all clusters
Dead-letter (undelivered-message) queue.
Descriptio n
Default alias queue
Default initiation queue
Default local queue
Default model queue
Default remote queue
MQSC command reply-to queue. This is a model queue.
Support deferred messages in JMS.
SYSTEM.DEFAULT.NAMELIST
Default namelist.
SYSTEM.DEFAULT.PROCESS
Descriptio n
Default authentication information object.
Dynamic receiver channel.
Dynamic server-connection channel.
Default receiver channel for the cluster
Default sender channel for the cluster
Default receiver channel.
Default requester channel.
Default sender channel.
Default server channel.
Default server-connection channel.
Default client-connection channel.
Basic MQ Administration
Basic Administration*
Define MQ Objects
Display MQ Objects
Alter MQ Objects
Delete MQ Objects
Miscellaneous
MQM Administration
Create MQ Manager
CRTMQM
Start MQ Manager
STRMQM
Stop MQ Manager
ENDMQM
Delete MQ Manager
DLTMQM
MQM Administration
Managing Queues
DISPLAY QLOCAL(TEST.LOCAL.QUEUE)
DEFINE QLOCAL(TEST.LOCAL.QUEUE)
ALTER QLOCAL(TEST.LOCAL.QUEUE) +
GET(DISABLED)
Create a Process
Display a Process
Alter a Process
DISPLAY PROCESS(PROC1)
ALTER PROCESS(PROC1)USERDATA('12')
Delete a Process
DELETE PROCESS(PROC1)
Enabling Triggers
DEFINE QLOCAL(TEST.LOCAL.QUEUE)REPLACE +
TRIGGER TRIGTYPE(first)PROCESS(PROC1)+
INITQ(SYSTEM.DEFAULT.INITIATION.QUEUE)
Trigger Types
every
first
N messages
Managing Channels
Create a Channel
DEFINE CHANNEL(MQMA.MQMB)CHLTYPE(sdr)+
XMITQ(MQMB) TRPTYPE(tcp)+
CONNAME(SERVER1.XYZ.COM)
Display a Channel
Alter a Channel
DISPLAY CHANNEL(MQMA.MQMB)
ALTER CHANNEL(MQMA.MQMB)+
CONNAME(SERVER2.XYZ.COM)
Delete a Channel
DELETE CHANNEL(MQMA.MQMB)
Managing Namelist
Create a Namelist
DEFINE NAMELIST(CLUSTERNL)+
NAMES(CLUSA,CLUSB)+
NLTYPE(CLUSTER)REPLACE
Display a Namelist
DISPLAY NAMELIST(CLUSTERNL)
Alter a Namelist
DEFINE NAMELIST(CLUSTERNL)+
NAMES(CLUSA,CLUSB,CLUSC)+
NLTYPE(CLUSTER)
Delete a Namelist
DELETE NAMELIST(CLUSTERNL)
Hands-on Part 1
MQ Administration
Distributed MQ
Distributed MQ
Transferring messages between Queue Managers
Queue Managers can be on the same machine or
world apart
Queue Managers can be on the same platform or
hetrogenous platforms
Implemented using Distributed Queue Management
(DQM) features of MQ including MQ Clusters
Distributed MQ Components
Local and remote Queue Managers and queues
Local is one to which an application is connected
Remote queue definition
Local definition of a queue in a remote MQM
Transmission Queues
Special local queue to store message temporarily
before transmitting to remote destination
Message channel agents (MCA)
Software that handles sending and receiving
Channels
One way communication link between MQMs
Distributed MQ Components
Dead letter queue
Special queue to store undelivered messages
Transport Service
Communication protocol independent of MQ
MQ supports multiple protocols
Platform dependent
Channel Initiators and Listeners
Initiators are trigger monitors for sender channels
Listeners start receiver channels on receiving
request from the sender MCA
Channel Exit Programs
Used for additional processing like encryption
Distributed MQ Components
App
Q
M
C
A
Channel
Transport
Service (TCP)
M
C
A
App Q
XMIT Q
Channel
Initiator
Listener
Init Q
M
C
A
App Q
QM1
Channel
Transport
Service (TCP)
App Q
M
C
A
XMIT Q
QM2
Define QREMOTE(Q1)+
RNAME(Q1)+
RQMNAME(QMB)+
XMITQ(QMB)
DEFINE QLOCAL(QMB)+
USAGE(XMITQ)
DEFINE CHANNEL(A.B)+
CHLTYPE(sdr)+
XMITQ(QMB)+
TRPTYPE(tcp)+
CONNAME(SERVERB.COM)
DEFINE QLOCAL(Q2)
DEFINE CHANNEL(B.A)+
CHLTYPE(rcvr)+
TRPTYPE(tcp)
On QMB
DEFINE QLOCAL(Q1)
DEFINE CHANNEL(A.B)+
CHLTYPE(rcvr)+
TRPTYPE(tcp)
Define QREMOTE(Q2)+
RNAME(Q2)+
RQMNAME(QMA)+
XMITQ(QMA)
DEFINE QLOCAL(QMA)+
USAGE(XMITQ)
DEFINE CHANNEL(B.A)+
CHLTYPE(sdr)+
XMITQ(QMA)+
TRPTYPE(tcp)+
CONNAME(SERVERA.COM)
Valid Combinations
Sender - Receiver
Requester - Server
Requester - Sender
Server - Receiver
Cluster Sender
Cluster Receiver
Define QREMOTE(Q1)RNAME(Q1)+
RQMNAME(QMB)XMITQ(QMB)
Define QREMOTE(QMB_Test)RNAME()+
RQMNAME(QMB)
Define QREMOTE(QMB_Test)RNAME()+
RQMNAME(QMB)XMITQ(QMC)
Define QREMOTE(QMA_Reply) +
RNAME(Answer_QMA)RQMNAME(QMA_Return)
Define QREMOTE(QMA_Return)RNAME()+
RQMNAME(QMA)
Define QLOCAL(QMA_Return)USAGE(XMITQ)
DMQ Commands
DMQ Commands
Start MQ Channel
Stop MQ Channel
DMQ Commands
To test a channel
MQ Clusters
DQM vs Clusters
DQM Components
Local MQM
Remote Q definition
Xmit Q definition
Sender Channel
Remote MQM
Local Q
Receiver Channel
Listener
Cluster Definitions
Local MQM
Cluster receiver channl
Cluster sender channel
Remote MQM
Cluster receiver channl
Cluster sender channel
Cluster Advantages
Reduced system administration due to reduced
number of definitions
Increased availability and scalability due to easy
administration and multiple instances of queues
Work load balancing using multiple instances of
queues
SYSTEM.CLUSTER.REPOSITORY.QUEUE
SYSTEM.CLUSTER.TRANSMIT.QUEUE
Clustered MQ Components
Cluster - CLUA
App Q
XMIT Q
App Q
Full
Repository
App Q1
QM1
QM2
Cluster Definition
On QM1
RUNMQSC
ALTER QMGR REPOS(CLUA)
DEFINE
CHANNEL(TO.QM1)+
CHLTYPE(CLUSRCVR)+
TRPTYPE(tcp)+
CONNAME(QM1.COM)+
CLUSTER(CLUA)
DEFINE
CHANNEL(TO.QM2)+
CHLTYPE(CLUSSDR)+
TRPTYPE(tcp)+
CONNAME(QM2.COM)+
CLUSTER(CLUA)
DEFINE QLOCAL(Q1)+
CLUSTER(CLUA)
On QM2
RUNMQSC
ALTER QMGR REPOS(CLUA)
DEFINE
CHANNEL(TO.QM2)+
CHLTYPE(CLUSRCVR)+
TRPTYPE(tcp)+
CONNAME(QM1.COM)+
CLUSTER(CLUA)
DEFINE
CHANNEL(TO.QM1)+
CHLTYPE(CLUSSDR)+
TRPTYPE(tcp)+
CONNAME(QM1.COM)+
CLUSTER(CLUA)
DEFINE QLOCAL(Q)+
CLUSTER(CLUA)
Verifying a Cluster
Each MQM require a channel initiator to monitor
the system defined init Q SYSTEM.CHANNEL.INITQ
START CHINIT
Each MQM require a channel listener to listen to
incoming network requests
START LISTENER PORT(1414)+
TRPTYPE(TCP)
Verify all the available MQMs in the cluster
DISPLAY CLUSQMGR(*)
Verify all the channel statuses
DISPLAY CHSTATUS(*)
Hands-on Part 2
Creating MQ Clusters
MQ Programming
Publish/Subscribe Pattern 1
Request/Reply Pattern 1
Transaction Management
ACID unit of work
Single phase commit
Two phase commit with XA specification
compliant resource managers
BackoutCount and BackoutThreshold attributes to
avoid looping
Purpose
Connect to a Queue Manager
Disconnect from a Queue Manager
Open a specific Queue
Close a Queue
Put a message on a queue
Get a message from a queue
MQOPEN + MQPUT + MQCLOSE
Inquire Properties of an object
Set properties of an object
Standard or fast path bindings
Begin an unit of work
Commit an unit of work
Back out to the start of unit of work
Purpose
Specifies options for MQBEGIN call
Specifies options for MQCONNX call
Describes the data in a distribution-list message
Specifies options for MQGET call
Message descriptor details to control message in a MQGET or MQPUT call
Object descriptor which is required in a MQOPEN call
Object record identifies the destinations to work with in a distribution list
Specifies options for MQPUT call
MQ Programming Sequence
Connect to
MQM
MQCONN
Open MQ
Objects
MQOPEN
Perform n
operations
Close MQ
Objects
Disconnect
from MQM
BASIC OP
MQCLOSE
MQDISC
MQ JAVA Programming
com.ibm.mq.jar
CLASSPATH=install_dir\lib\com.ibm.mq.jar
Import com.ibm.mq.*;
Connection Modes
Connection Modes
Binding Mode
Client Connection
Mode
MQEnvironment
MQQueueManager
MQGetOptions
MQPutOptions
MQMessage
MQQueue
MQException
Hands-on Part 3
MQ Programming
MQ Security
Security Services
Identification and Authentication
Access Control
Confidentiality
Data Integrity
Non repudiation
Security Mechanism
Access Control Lists
Cryptography
Digital Signatures
Cryptography
Concept
Convert plain text to ciphertext called encryption
Transmit ciphertext to receiver
Convert ciphertext to plain text called decryption
Message Digest
Concept
Fixed size numeric representation of contents of message
Computed by hash function which is one way
No two different message will have the same value
Digital Signatures
Concept
Formed by encrypting a representation of message
Encryption done using the private key of the signatory
Normally done on the message digest for efficiency
Digital Certificates
Concept
Binds public key to a owner and prevents impersonation
Also known as public key certificates
Involves trusted third party called Certification Authority
Digital Certificates
Concept
Binds public key to a owner and prevents impersonation
Involves trusted third party called Certification Authority
Also known as public key certificates
MQ Security Considerations
Authority to administer Websphere MQ
Authority to work with Websphere MQ objects
Channel Security
MQ Clusters
MQ Publish/Subscribe
MQ Internet Pass-Thru
Link level security
Application level security
MQ Security Options
MQM can verify the administration authority
MQM can verify the authority to access objects
MCA can authenticate a partner MCA
Messages can be encrypted before sending and
decrypted when receiving
User-id in the message descriptor can be used to
verify the authority to access MQM objects
COA and COD report options to implement nonrepudiation functions in an application
MQ Framework
MQ Framework Components
Trigger Monitor Interface
Message Channel Interface
Name Service Interface
Security Enabling Interface
Data Conversion Interface
MQ Performance
MQ Performance Improvement
Use MQCONNX with fastpath binding option
The application should be trusted
Use MQCONNX to create thread independent
connection
bnair@asquareb.com
blog.asquareb.com
https://github.com/bijugs
@gsbiju