Tuesday 13 August 2013

How To Install IBM MQ On Windows

Installation On Windows
  1. Login as Administrator to the destination windows server using Remote Desktop Connection Tool
  2. Check hostname of the windows server (command is--- hostname). Hostname should not contain any spaces 
We must check Hardware & Software requirements to proceed our MQSeries installation
  •  How much disk space is free. How much disk space is required for our configuration.                 (command is -- dir | find "free") 900MB required for full installation.
  • Speed of the processor.
  • Hardware type (32 bit or 64 bit)                                                                                                 (command is--- systeminfo
  • Get MQseries Software Dump to our destination server.
  • Check whether MQSeries installation supports our destination platform or not by invoking MQLaunchpad
  • Check Eclipse installation required for our MQSeries features.If it is required we must install Eclipse first.
How To Install Eclipse & MQSeries

  • Find following path then invoke the setup.exe.                                                                              (Path is ---- MQV7.X/prereqs/IES/setup.exe)
  • Find MQLaunchpad in the following path.                                                                                          (Path is ----- MQV7.X/MQLaunch.exe)
  • Click On Software requirements in the MQ Installation Wizard. Following wizard shows prerequisite softwares has installed or not
  • Click on WebSphereMQ Installation and then click on Launch IBM WebSphere MQ Installer.

  • It opens following window. accept the license agreement

  • Choose setup type 

  • select folder for program files and then click on next

  • select data-files folder and then click on next

  • select Global securityKit files folder and then click on next


  • select  log files folder and then click on next

  • select features to install in the following window
  • In the following window we can have a look what are the features selected to install and then click on install

  • After installation check MQSeries Installed Version Info Using Command “dspmqver”. (open command prompt then execute command)

Wednesday 3 April 2013

What is a Resource Manager, Transaction & Syncpoint

What is a resource manager?
A resource manager is a computer subsystem that owns and manages resources that can be accessed and updated by applications (i.e., WMQ queue manager – whose resources are its queues, DB2 database – whose resources are its tables).

What is a unit of work?
When a application updates the resources of one or more resource managers, it's often vital that all updates complete successfully as a group, or none of them complete. Updates that complete this way are said to occur within a 'unit of work' or 'transaction'.

What is a sync point coordinator?

The point in time when all updates within a unit of work are either committed or backed out is called a 'sync point'. The computer subsystem that manages units of work is called a sync point coordinator.

What Is Dead Letter Queue & Dead Letter Handler

Dead Letter Queue (DLQ)

- When messages can not be delivered to the intended queue, the messages may be delivered to a Dead Letter Queue (DLQ) if the queue manager has one defined.

- By default a queue manager does not have a Dead Letter Queue but you should define one for every queue manager.

- In every Queue Manager default dead letter queue is SYSTEM.DEAD.LETTER.QUEUE.


Dead Letter Messages

1) Messages can be placed on the DLQ by the queue manager, the channels (MCA) or by applications
2) When the messages are put onto DLQ, they should have a Dead Letter Header (DLH). DLH will be generated by Queue manager and MCA.
3) If application are putting the messages onto DLQ, applications must create the Dead Letter Header (DLH) to message.

Dead Letter Queue Handler

Once a message arrives on the DLQ you can automate the handling of that message using the DLQ handler program. You can have the handler running and waiting for messages to arrive on the DLQ or you can set up the DLQ to trigger the start of the handler program

Starting the DLQ Handler
You can start the DLQ handler using the RUNMQDLQ command.
Example: RUNMQDLQ -Q <DEDA LETTER QUEUE NAME> -M <QMGR NAME>  <rules.tb

where DLQ = name of your dead letter queue
QMGR = queue manager name and
rules.tb is a file with your rules table

Rules Table
It Defines how the DLQ handler will process the messages on the DLQ
Two types of entries in the rules table
-Control Data
-Rules

runmqdlq can take rules table from command line or redirect from file.

Sample Program

Websphere MQ supplies a sample program called amqsdlq which provides similar function as runmqdlq. This allows users to customize the way messages are handled from the DLQ, especially useful if you have applications placing messages directly onto DLQ.

How to write Rules in rule table explained
Rule table is looks something like: Pattern/Keyword Action. ( simillat to find a particular keyword and the do the action specified)

Pattern Keywords – allow you to match only certain messages on the DLQ
Ex: REASON – match only messages with a specified reason code

Action Keywords describe how a matching message is processed
ACTION(DISCARD|IGNORE|RETRY|FWD)
FWDQ – name of queue where message is forwarded
FWDQM – name of qmgr where message is forwarded
HEADER(YES|NO) – do messages have DLH header
PUTAUT(DEF|CTX) – userid of runmqdlq program or userid from the MD of the message on the DLQ
RETRY – number of times to retry each matching rule

More about Rule Table
1) A rules table must contain at least one rule.
2) Keywords can occur in any order.
3) A keyword can be included only once in any rule.
4) Keywords are not case-sensitive.
5) A keyword and its parameter value must be separated from other keywords by at least one blank space or comma.
6) There can be any number of blanks at the beginning or end of a rule, and between keywords, punctuation, and values.
7) Each rule must begin on a new line.
8) For reasons of portability, the significant length of a line must not be greater than 72 characters.

Sample Rule Table
***************************************************
* An example rules table for the runmqdlq command *
***************************************************
* Control data entry
* ------------------
* If parameters are not supplied on the runmqdlq command use
* SYSTEM.DEAD.LETTER.QUEUE as the input queue, use QM1_TEST as the
* queue manager and set retry interval to 20 seconds
inputq('SYSTEM.DEAD.LETTER.QUEUE') inputqm('QM1_TEST') retryint(20)

* Rules entries
* -----
* Include a rule with ACTION (RETRY) first to try to deliver the
* message to the intended destination. If a message is placed on the
* DLQ because its destination queue is full, attempt to forward the
* message to its destination queue. Make 5 attempts at approximately
* 20 second intervals (the default value for RETRYINT). Also include
* the "+" just to show how to wrap a command over to the next line.
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)
* If a message is placed on the DLQ due to put inhibited, attempt to
* forward the message to its destination queue. Make 5 attempts at
* approximately 20 second intervals (the default value for RETRYINT).
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
* Include a rule to handle messages which do not match any of the
* patterns specified above. Send the messages to another queue named
* DEADQ where they can be handled later.
ACTION(FWD) FWDQ('DEADQ')

Runmqdlq examples
If you use the DLQ handler without redirecting stdin from a file (the rules table), the DLQ handler reads its input from the keyboard.
In WebSphere MQ for AIX, Solaris, HP-UX, and Linux, the DLQ handler does not start to process the named queue until it receives an end_of_file (Ctrl+D) character.
In WebSphere MQ for Windows it does not start to process the named queue until you press the following sequence of keys: Ctrl+Z, Enter, Ctrl+Z, Enter

C:\>runmqdlq SYSTEM.DEAD.LETTER.QUEUE QM1_TEST
WAIT(YES) RETRYINT(20)
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
REASON(*) ACTION(FWD) FWDQ('DEADQ')
^Z

2005-04-08 02.20.09 AMQ8708: Dead-letter queue handler started to process
INPUTQ(SYSTEM.DEAD.LETTER.QUEUE)



Best Regards,
MADHU K
IBM MQ Certified Professional
HYDERABAD
+917893751171/+919964371404
mailme.mq@gmail.com
trainingontech.com
http://www.ibmmqadmin-madhu.blogspot.in