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

Middleware


Middleware

Client/server is dead. That’s the buzz now that newer Internet-based technologies are flourishing. But those new technologies are merely the natural evolution of earlier approaches, implemented with newer, more open protocols and designed to provide greater scalability, manageability, and diversity.

Middleware is computer software that connects software components or applications. It is used most often to support complex, distributed applications. It includes web servers, application servers, content management systems, and similar tools that support application development and delivery. Middleware is especially integral to modern information technology based on XML, SOAP, Web services, and service-oriented architecture.

Types of middleware

  • Remote Procedure Call (RPCs) — Client makes calls to procedures running on remote systems. Can be asynchronous or synchronous.
  • Message Oriented Middleware (MOM) — Messages sent to the client are collected and stored until they are acted upon, while the client continues with other processing.
  • Object Request Broker (ORB) — This type of middleware makes it possible for applications to send objects and request services in an object-oriented system.
  • SQL-oriented Data Access — middleware between applications and database servers.
  • Other sources include these additional classifications:
    • Transaction processing (TP) monitors — Provides tools and an environment for developing and deploying distributed applications.
    • Application servers — software installed on a computer to facilitate the serving (running) of other applications.
    • Enterprise Service Bus — An abstraction layer on top of an Enterprise Messaging System.