Quick guide to Websphere MQ


It is the Messaging style of communication the communication takes place between Queue Managers.

Firstly the application program writes to the some name queue then the queue manager determines the location of those queues and handles all of the communication.

MCA ( Message channel agent ) is the Queue Manager program to perform the network communication.

If messages to be delivered to the remote queue the queue manager checks it and put it into the transmission queue to process further.

MQPUT (write) to MQGET (read)

IBM WebSphere reference architecture

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r1/index.jsp

Synchronous

Asynchronous

SOA

Reduce the service to bare business logic

Resource Manager Or Queue manger owns the queue (MCA – Message channel agent)

MQPut

MQGet

Application –> MQ Interface (MQI) –>Queue Manager –> Process Definition –> Queues

Major Calls

  • MQCONN
  • MQCONNX
  • MQDICS
  • MQOPEN
  • MQCLOSE
  • MQPUT – Write
  • MQPUT1
  • MQGET – Read
  • MQSUB
  • MQSUBRQ

Minor Calls

  • MQBEGIN
  • MQCOMIT
  • MQBACK
  • MQINQ
  • MQSET

MQ Messages = Header + Application Data

Header – Message descriptor

WebSphere MQ largest message size is 100 MB

Easily process data in parallel

Conversation

Call and return

Messaging

Program MQI

retrieve messages from queue

Lets now jump in and create the real life example

I will share an example of StockQuote (i.e. stock price)

We require IBM WebSphere MQ Explorer 7.1 software

1)

StockQuotes
1414

****************************************
* Command: “E:\Program Files\IBM\WebSphere MQ\bin\crtmqm” -sa StockQuotes
****************************************
WebSphere MQ queue manager created.
Directory ‘E:\Program Files\IBM\WebSphere MQ\qmgrs\StockQuotes’ created.
The queue manager is associated with installation ‘Installation1’.
Creating or replacing default objects for queue manager ‘StockQuotes’.
Default objects statistics : 74 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
exitvalue = 0
****************************************
* Command: “E:\Program Files\IBM\WebSphere MQ\bin\strmqm” StockQuotes
****************************************
WebSphere MQ queue manager ‘StockQuotes’ starting.
The queue manager is associated with installation ‘Installation1’.
5 log records accessed on queue manager ‘StockQuotes’ during the log replay phase.
Log replay for queue manager ‘StockQuotes’ complete.
Transaction manager state recovered for queue manager ‘StockQuotes’.
WebSphere MQ queue manager ‘StockQuotes’ started using V7.1.0.0.
exitvalue = 0
****************************************
* Command: “E:\Program Files\IBM\WebSphere MQ\bin\runmqsc” StockQuotes
* Input: DEFINE LISTENER(‘LISTENER.TCP’) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)
****************************************
5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.
Starting MQSC for queue manager StockQuotes.
1 : DEFINE LISTENER(‘LISTENER.TCP’) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR)
AMQ8626: WebSphere MQ listener created.
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
exitvalue = 0
****************************************
* Command: “E:\Program Files\IBM\WebSphere MQ\bin\runmqsc” StockQuotes
* Input: START LISTENER(‘LISTENER.TCP’)
****************************************
5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.
Starting MQSC for queue manager StockQuotes.
1 : START LISTENER(‘LISTENER.TCP’)
AMQ8021: Request to start WebSphere MQ listener accepted.
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
exitvalue = 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s