Wednesday, 17 May 2017

Installing an IBM MQ server on LINUX

Installation of MQ in LINUX

Software requirements: OS compatibility and kernel parameters.

Hardware requirements: Need to check the space availability for the file systems.
(/var/mqm and /opt/mqm)

Installation directories:
/opt/mqm/samp/bin for solaris and linux
/user/mqm/samp/bin for AIX

Working directories:
/var/mqm for solaris , AIX and linux.

> To proceed with installation we need to login as a 'root' user

>To check which MQ packages installed
rpm -qa| grep MQseries

> To display which version of MQ installed
  dspmqver

> To find out hostname
  hostname

> To find out OS version
    uname-a
cat /etc/issue
cat /etc/redhat-release

> To check the space for the file system
   df -h |grep mqm

> We need to go to the /opt/mqm/samp/bin here we need to unzip or untar the MQ software file. To unzip the zip file
    gunzip -filename

> To untar the package or file.
   tar -xvf <filename>

 > To accept the license execute below command
    ./mqlicense.sh -accept

> After accepting the license we need to proceed with install required packages by using below command.
   rpm -ivh <packagename>

> To check the number of MQ packages installed

   rpm -qa | grep MQ

Tuesday, 16 May 2017

How to Work with MQ and Explanation of MQ Objects

 work with MQ in two ways:

1 command prompt
2 GUI (MQ EXPLORER)
Command prompt: For command prompt  goto run and type cmd

open command prompt in  'Run as Administrator' mode.


2.To open MQ Explorer go to command prompt. and enter the command for opening MQ explorer. enter STRMQCFG
Run and open the IBM MQ Explorer.


MQ OBJECTS: There are five types of MQ objects , Those are

                         QUEUE MANAGER
                     QUEUES
                     CHANNELS
                     LISTENERS
                     PROCESS

QUEUE MANAGER: Queue manager is a major object in MQ .QM is a system container it holds all other MQ objects.
max characters for creating  queue manager is 48
Queue manager name is a case sensitive that takes only capital format, make sure to create the queue manager always in capital letters.
Queue manager name should be unique in network to which it is connected.
Queue manager provides MQI interface to application to work with MQ.

SYNTAX:
  • Create the Queue manager:   CRTMQM QUEUE MANAGER NAME
  • Start the Queue manager:      STRMQM QUEUE MANAGER NAME
  • Stop the Queue manager:      ENDMQM QUEUEMANGER NAME
TO START THE MQSC COMMANDS :
  • Enter into the Queue manager: RUNMQSC QUEUEMANAGER NAME
  • Exit from  the Queue manager: END
  • Delete queue manager            : DLTMQM QUEUEMANAGER NAME

QUEUES: Queue is a container which stores the messages.
queues are used to either store the messages coming from other queue manager or send the messages to other queue managers.
Types of queues:
            A)LOCAL QUEUE
                B)ALIAS QUEUE
                C)REMOTE QUEUE
                D)MODEL QUEUE
                E)DYNAMIC QUEUE
                F)TRANSMISSION QUEUE
                G)INITIATION QUEUE
                H)DEADLATTER QUEUE
                I)EVENT QUEUE               
                J)CLUSTER QUEUE

A)   LOCAL QUEUE: A local queue is the only place where messages are physically stored.
an application can put and get the messages from the local queue.

SYNATAX:
 DEFINE QLOCAL(local queue name)

 B)  ALIAS QUEUE: An alias queue is a duplicate queue which points to original queues.

SYANTAX:

DEFINE QALIAS(aliasqueue name) TARGETQUEUE(targetlocalqueue name)

C) REMOTE QUEUE:  Remote queue is a queue that contains the address details of the destination queue manager and destination local queue.

Syntax:

DEFINE QREMOTE(remote queue name)  RNAME(remotelocalqueue name)  RQMNAME(remote queueumanager name)  XMITQ(xmitqname)

D)MODEL QUEUE: a model queue is a template that can be used by an application to dynamically create a real queue .these templates are often used to create a unique queue for reply messages and then the queue is automatically deleted when the applications ends.

SYSNTAX:

DEFINE QMODEL(MODEL QNAME) DEFNTYPE(PERMDYN)

E) DYNAMIC QUEUE: These queues are created by the process of opening a model queue by using the mqi call mq open. and automatically deleted when the application ends.

There are two types of dynamic Queues.

1) Temporary dynamic queue : The Queue which deleted automatically when application ends.

2)Permanent dynamic Queue: The permanent dynamic queue which can be used by another application also.

F)TRANSMITION QUEUE:  Transmition queue is a type of local queue that transmit the messages to the destination queue. usage attribute as 'xmitq'.

SYNTAX:

DEFINE QLOCAL(xmitqname) USAGE(xmitq)

G)INITIATION QUEUE: it is local queue to which a queue manager writes a trigger message when certain conditions are met on another local queue.

SYNTAX:

DEFINE QLOCAL(intiation qname) USAGE initq

CHANNEL INITIATOR PROCESS: channel initiator monitor the initiation queue. it will start the channel automatically when trigger condition met on inition queue.

H)DEADLATTERQUEUE: Dead latter queue is a local queue, it is used for handling the messages that are undelivered for every Q manager it is recommended to keep one dead latter queue.
dead later handler process we are using here.

SYNTAX:

DEFINE QLOCAL(deadlater qname) ALTER QMGR DEADQ(dlqname)

Scenarios:

If the destination queue is full.(2053)

Destination queue does not exist.

Put option have been inhibited on the destination queue.(2051)

The sender message channel  is not authorized to use destination queue.(2035)

Message is too large.(2030)

I)EVENT QUEUE:  The queue manger generates event messages when certain thing happen
for example event can occur when a queue is nearly full or when an application is not authorized to open a queue. these event messages are written to one of the pre defined event queues and can then be process by management tools.

SYSTEM.ADMIN.QMGR.EVENT

SYSTEM.ADMIN.CHANNEL.EVENT

J)CLUSTERQUEUE: It is a local queue, we just add the local queue in cluster.

CHANNELS:
Channel is a logical communication link in MQ. we have 2 types of channels,
A)  Message channel
B  MQI channels

CHANNEL STATUS:
  • ·         RUNNING STATUS
  • ·         RETRAINING STATUS
  • ·         STOPPED STATUS
  • ·         INBOUND STATUS.


 A) Message channel: A message channel connects two Queue managers via message channel agents(MCA).
Message channel agent: An mca is a program that transfers messages from a transmition queue to a communication link(channel) and from a communication link to the target queue.
message channels are uni directional.
different types of message channels

1)  sender channel(sdr): A channel that can be created on sender side or sender queue manager to send a message to the destination queue manager.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(SDR) CONNAME('HOST(PORTNUMBER)')XMITQ(XMITQNAME)

2 )Receiver channel(rcvr): a channel that can be created on sender side to receive messages from destination queue manager.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(RCVR)

3 )Server channel(svr): server channel is like sender channel. it can be started by remote user or receiver end.

Syntax:
DEFINE  CHANNEL( chlname) CHLTYPE (svr) CONNAME('host(portnumber)'xmitq(xmitqname)

4) Requested channel(rqstr): Destination queue manager can request a response message from source queue manager by using requester channel.

Syntax:
DEFINE CHANNEL(CHLNAME) CHLTYPE(RQSTR) CONNAME('HOST(PORTNUMBER)')

combination : Message channel combination
·         sender-receiver.
·         sender-requester
·         server-requester.
·         cluster sender-cluster receiver

5) Cluster sender channel(CLUSSDR):it is nothing but sender receiver channels, but here we give connection name. we define in cluster.

SYSNTAX:
DEFINE CHANNEL(CHLNAME) CHLTYPE(CLUSSDR) CONNAME(DESHOSTNAME (PORTNUM)) CLUSTER(CLUSNAME)

6) cluster receiver channel(CLUSRCVR) It is nothing but sender receiver channels, but here we give connection name. we define in cluster.

SYNTAX:
DEFINE CHANNEL(CHLNAME) CHLTYPE(CLUSRCVR) CONNAME(LOCALHOST(PORTNUMBER)) CLUSTER(CLUSNAME)

B) MQ I CHANNELS(Message queue interface):
MQI channels communicate client and queue manager.
A message queue interface channel connect websphere mq client to a queue manager across the network.
These  channel s are bidirectional , in that one channel can be used for a client to both send and receive messages. there are two types of MQI channels.

1) server con channel: It is a queue manager defined MQI channel which is secured by ssl.
 Install mq client in application side first,

SYNTAX:
DEFINE CHANNEL(CHLNAME) CHALTYPE(SVRCONN) TRPTYP(TCP)
TRP:TRANSPORT PROTOCAL:WE ARE USING I NETWORKING LEVEL,

2 )client con channel: Client connection chal is nothing but server con chl only difference  is channel type. and we must give connection name in client con channel definition.
We also use client channel tables to connect multiple queue managers at a time.

Syntax:
 DEFINE CHANNEL(CHLNAME) CHLTYPE(CLIENTCONN) CONNAME(LOCAL HOSTNEM(PORT NUMBER))TRPTYPE(TCP).

LISTENER:  LISTENER  IS a program, that accepts the connection request and then start the channel to handle the communication between two Queue managers.

Syntax:
 DEFINE LISTENER (listenername) TRPTYPE(tcp) PORT (PORTNUMBER).

PROCESS: Process is an object that defines applications to start automatically in response to a trigger message.

SYNATAX:

DEFINE PROCESS (process name) APPLICID(name) APPLICTYPE(type of application).




Monday, 15 May 2017

IBM MQ INSTALLATION PROCESS IN WINDOWS SERVER

INSTALLATION PROCESS:

Before installing the MQ we need to make sure the following things to be checked out
MQ packages

Client Package: Client package is software which requires by an application to connect to MQ. This package must be installed on the server from where the application is trying to connect to an MQ server. It is free of cost

Server package: Server package is software which is used for creating the object like Queue Manager, Queue, Listeners, Channels, Process. This server package is compulsory to be installed for creating any of the objects

To download the MQ Software, steps to go

  • Open google and enter IBM Mq download

> Open the link and select the download button on window.


 > If you have IBM id check the box "I already have an IBM id" and continue to login.
> Those who don't have IBM id please leave check box and click on continue to create an count.

> Here fill your details and register.
> After register , login to the IBM page.
> Select the proper version and continue to download.
> After that we have to fill all the required details and click on conform



 > After that we have to fill all the required details and click on conform

> should select the DOWNLOAD USING HTTP.
Select the required version and click on i agree. then the MQ downloaded.

After download the MQ , Maintain floder information like below.
IMPORTANT FOLDERS, PATHS AND LOCATIONS
Data folderàworking files will save here
Log folderàlog info
Bin Details or Installation Path àAll executable files.
Ex:
BIN PATH: C:\Program Files (x86) (x86)\IBM\WebSphere MQ\bin
Working Directory: C:\Program Files (x86) (x86)\IBM\WebSphere MQ\QMGRs
Log Directory: C:\Program Files (x86) (x86)\IBM\WebSphere MQ\log
We need to consider the following...
1) S/W Requirements (OS Compatibility, Computer name (should not contain any spaces), IES (MQ Explorer for GUI mode))
2) H/W Requirements (disk space)
Once these are checked out we need to install the MQ Explore as below go to PREREQ folder under that Click on IES under this folder we will see the setup.exe file for Explorer.
In before unzip the Downloaded file and placed into proper location. 

Once this is done we need to install the software by using the launch pad from the main folder ,on the left hand side we do have several options  check for software requirements and then use the WebSphere installation tab to launch installation process.


After accepting the License we do have options for installing
a) COMPACT
b) TYPICAL
c) CUSTOM
Select the custom option and then select the packages whatever you required…and click install.
Note: The only the client package is required we can select only one package and then click for install.
Once complete installation is done it will ask for Domain configuration which is configuring the domain details with particular domain name, user id and password
In general these are done by Windows Admin team so we don’t require select NO option so it will stop configuring the domain configuration.
If you want domain configuration click YES and fill the below details Once this is done Installation is done



    UNDER WHICH USER ID THE MQ SOFTWARE RUNS?
Once you installed MQ software it will be running with 'mqm' group and with user id 'MUSR_MQADMIN'
If you want to see the ‘users and groups’ in Windows 7, right click on MY computer and select ‘Manage’ it will take to a windows where you can see ‘users and groups tab’
Once you installed the Software you will have the service name 'IBMMQSeries' under service tab(services.msc ) which will be started automatically by default, if you want to change it to manual we can do it.
If the service is in stopped state or not started then you will get the below error while you start to work on MQ commands.
C:\Windows\System32>strmqm QM1
AMQ7257: The MQ service must be running to perform the requested operation.
NOTE: while you are working on windows 7 OS please start the command prompt as ‘Run as Administrator’
Note: The users who are part of ‘mqm’ group will be able to run the MQ commands, creation of user id’s and adding them to ‘mqm’ group will be taken care by windows/unix admin.

Friday, 12 May 2017

IBM WEBSPHERE MESSAGE QUEUE

IBM MESSAGE QUEUE:

 Message Queue: Message queue is a middleware product that can communicate or integrate two applications by sending or receiving the data.
Message: A message is a representation of data or information exchanged between the applications.

·         Binary information
·         Text data
·         Structured data

What message contain:

·         MQ Message Description
·         Body of the Message or Message body

MQ Message Description: In message description there are different values

·         Expire date and time        
·         Message ID
·         correlation ID
·         Group ID
·         Sequence Number
·         Put date and Time
·         Application name
·         QManager name
·         Queues name

Message body: Message body can contains the data or information for the application.


METHODS OF MESSAGING:

   Two types of messaging methods are there. Those are
·         Synchronous messaging
·         Asynchronous messaging

Synchronous messaging: The sender can send a message and wait for the acknowledgement from the receiver.

Asynchronous messaging: The sender can send a message continuously without waiting for the acknowledgement from the receiver.   

TYPES OF MESSAGES:

There are four types of messages
·         Data gram
·         Request
·         Reply
·         Report

Data gram: A message cannot expect response is called data gram message.

Request message: A message that can expect a response is called request message.

Reply message: A message in response to a request message is called reply message.

Report message: Report message is  a message that tells about an occurrence or an event is called 
report message.

APPLICATION PERSPECTIVE MESSAGE TYPES:
Those are two types
·         Persistent message
·         Non Persistent message
Persistent message: A message that can recoverable when failure occurs.

Non Persistent message: A message that cannot recoverable when failure occurs.


WHAT ARE THE METHODS BY USING APPLICATION TO CONNECT MQ:
Application can connect to the MQ
1.      Binding mode
2.      External mode

Binding mode: Application and MQ should be on same server.

External mode: Application and MQ on different servers.

WHAT ARE THE MQI CALLS:

  MQI calls: Application can use MQI calls to connect to the MQ Qmanager.These are divided into two categories.
1.      Major calls
2.      minor calls

Major calls:
1.      MQCONN and MQCONNX: TO connect to the Queue Manager.
2.      MQOPEN :It is using for open a queue.
3.      MQCLOSE: It is using for to close a queue.
4.      MQDISC : It is using to end the connection to the Queue Manager.      
5.      MQPUT : It is using to put a message on a queue.
6.      MQPUT1 : it means The combination of MQOPEN , MQPUT and MQCLOSE.
7.      MQGET: To get a message from the Queue.

Minor calls:
1.      MQBEGIN: To begin a unit of work.
2.      MQCMIT: To commit a unit of work.
3.      MQSET: Can be used by application to set the some of the attribute on the queue.
4.      MQBACK: To rollback the commands for unit of work.
5.      MQINQ: To Inquire about attributes of an object.

DIFFERENCES BETWEEN MQ VERSION8 AND MQ VERSION 9.

MQ Version 8

1.       new feature introduced in v8 is apiexits  which themselves make apicalls.
2.      On unix and linux systems the object authority manager (OAM) can now use userbased authorization as well as group based authorization.
3.      In IBM V8 a new Queue Manager security parameter conauth chcklocl has been introduced.

MQ Version 9

1.      A new delivary and suport model for IBMMQ has been introduced.
From version 9 two release types will be made available
                       1. long term support release(lTS)
                      2.Continues delivery Release.
     2. In v9 WEB UI has been introduced to administer MQ.

Thursday, 11 May 2017

Middleware

MIDDLEWARE:  Middle ware is a software product that acts as a bridge between operating system or database and applications.
    Middleware is a software product that works as a communication platform between two applications or one application and one database and it controls the flow of information between an application and its network.