Search This Blog

Saturday 12 April 2014

IBM Websphere MQ


websphere family.

MQ,MB,WAS,Portal

Features of MQ:

1) message delivery
2) Asynchronus messaging
3) Time dependent
4) Integrity
5) Support

Plat form independent

we can send messages from one os to other os.

A -------- B
solaris   windows
TCP/IP    SPNX

we can write our own code in any language.

JMS Supports Java language.

MQ is a s/w which is developed on java. but it supports all other languages.

it runs on eclipse palat form.

MQ version

dspmqver

ver 7.0  eclipse 3.3
ver 6.0
ver 5.2
ver 5.1
     .
     .
     .

server
client
client with XA enabled. used for commit and roll back transactions.

Default 4MB info including header.

max 100MB info
300MB segmentation is required.

QM is like our weblogic domain

it contains all queues.

runs on a listener. default 1414 unless you define a port.

Queue types:

Remote Queue
Local Queue
Transmission Queue
Dead letter Queue
Alias Queue
Cluster Queue


Local Queue -- where you store all the messages.
Remote Queue -- Contains All the parameters of definations
                It will not store any messages but it will send the messages to local Queue.

Sender recvr  -- names should be same

surconn -- We use surconn to send the message from the application to MQ.

client A -------> server B
         surconn


Below parameters are required to connect to the client
Qname
servername
port
protocol
   

#dspmqver ( it will display MQ version)

command not found ( MQ is not installed)

Before installation you Make sure that the below dir are exist


/opt/mqm ( all the binaries generated from installation)

/var/mqm ( all the configurations and log file )

Before installing MQ Execute licence file

cd /opt/mqm

./mqlicence.sh

check whether mqm user exist or not

more /etc/passwd | grep mqm

++++++++

#group mqm

mqm unixadms wheel

#pkgadd -d /home/melletit (used to install any s/w in solaris)

execute steps 1,2,3

select below options for MQ installation

1) MQ server

2) Man

3) sample programs

4) mq client

5) IBM jre

6) extended Architecture

enter : 1,3,5,6


cd /opt/mqm

ls -lrt

cd /var/mqm

ls -lrt

#crtmqm QM.DEMO  ( create Queue Manager)

#dspmq  ( It displays QM status )

#dltmq testqmgr ( delete QM)

#strmqm QM.DEMO ( Start Queue manager )

#dspmq ( displays QM status)

#cd /var/mqm

#more mqm.ini ( Contain all the configuration details of QM )

#cd /var/mqm/errors ( Contains installation error logs)

         .FDC ( Contains network issues )

$ffstsummary

The tool ffstsummary is also useful – it produces a summary of FFST reports in the current directory, sorted into time order. This can be a good place to start to see the errors reported in your errors directory.

For example:

[dalelane@dlane ~]$ cd /var/mqm/errors
[dalelane@dlane errors]$ ffstsummary
AMQ21433.0.FDC 2007/04/10 10:05:45 amqzdmaa 21433 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21429.0.FDC 2007/04/10 10:05:45 amqzmur0 21429 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21469.0.FDC 2007/04/10 10:05:45 runmqlsr 21469 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21422.0.FDC 2007/04/10 10:05:45 amqzfuma 21422 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21424.0.FDC 2007/04/10 10:05:45 amqzmuc0 21424 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21431.0.FDC 2007/04/10 10:05:45 amqrrmfa 21431 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21449.0.FDC 2007/04/10 10:05:45 amqzlaa0 21449 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21434.0.FDC 2007/04/10 10:05:45 amqzmgr0 21434 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21452.0.FDC 2007/04/10 10:05:45 runmqchi 21452 2 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
AMQ21417.0.FDC 2007/04/10 10:05:45 amqzxma0 21417 4 XC338001 xehAsySignalHandler xecE_W_UNEXPECTED_ASYNC_SIGNAL OK
[dalelane@dlane errors]$


#cd /var/mqm/qmgrs/QM!DEMO

more qm.ini ( Contains all the details of particular QM - log, Services, service components)

logfile types

1) circular logs -- Info cant be retrived. It will overwrite previous logs.

2) linear logs  -- Will keep on appending the log file. (  use for production )

based on criticality of message we will decide the log types.

logpath = /var/mqm/log/QM!DEMO

cd  /var/mqm/log/QM!DEMO/errors -- give the errors to the particular QM.

cd /var/mqm/log/QM!DEMO/active -- we can check QM is active or not. Some times due to pending message QM goes into inactive state.

#runmqsc  ( used to run mq commands )

There are two ways to configure the objects in MQ

1) command line
2) console

#runmqsc QM.DEMO

AMQ8426: Valid MQSC commands are:

    ALTER
    CLEAR
    DEFINE
    DELETE
    DISPLAY
    END
    PING
    REFRESH
    RESET
    RESOLVE
    RESUME
    START
    STOP
    SUSPEND



Application     QM.DEMO QM.DEMO1 Application
RQ ( DEMO.REMOTE) LQ (LQ.DEMO1)
TX -- local Queue but usage -- transmission Recv chl
Sender channel



Create Remote Q:

define QREMOTE(DEMO.REMOTE)

alter qremote(DEMO.REMOTE) RNAME(LQ.DEMO1) RQNAME(QM.DEMO1) XMITQ(XQ.DEMO)


Create Local Q:

define qlocal(XQ.DEMO)

alter qlocal(XQ.DEMO) usage(XMITQ)

define channel(DEMO.DEMO1) chltype(SDR) trptype(TCP) connname('localhost(1415)') xmitq(XQ.DEMO)

end


creating 2nd QM


crtmqm QM.DEMO1

start QM.DEMO1

dspmq  ( check mq stauts)

ps -ef | grep QM.DEMO1

**it will not show any listener.

dis listener(*)

System.default.listener.TCP

alter listener (System.default.listener.TCP)  trptype(TCP) port(1415)

start listener(System.default.listener.TCP)

ps -ef | grep QM.DEMO1

*** 1415 listener


create local Queue:

define qlocal(LQ.DEMO1)

define channel(DEMO.DEMO1) chtype(RCVR) trptype(TCP)


dis channel(*) chltype(SDR)

start channel(DEMO.DEMO1)

dis chstatus(DEMO.DEMO1)

end

find . -name "amqsput"

$cd /opt/mqm/samp/bin

$./amqsput DEMO.REMOTE QM.DEMO

hi welcome to PavanBlog

$./amsget LQ.DEMO1 QM.DEMO1

hi welcome to PavanBlog



Trouble shooting & Interview questions:
***************************************

1) What is Remote Queue? and Remote Queue parameters

2) Reasons for message is going to retain state.

1) Not able to get the connection
2) Input parameter for remote queue might be wrong ( parameter)
3) Destination QM is not running
4) Sender and REcv channel names should be same ( might be wrong some time)
5) Message will be in local queue
6) Problem with message format



xmit Queue properties-> put : allowed
       get : allowed

Local Queue -> usage : Transmission becomes Transmission Queue.



Dead letter Queue (DLQ)
***********************

1.IF destination is not defined or unavailable then message without loss it will store in DLQ .
each queue manager (QM ) will have one DLQ .it is mandatory or suggested to have DLQ .

QM.DEMO   QM.DEMO1
|->DLQ1  
|->DLQ

RQ LQ
TX Receiver channel.
SC (sender channel)
               

Before sender channel started message seats with or stores in TX .
once connection established it will reached the receiver channel and look for destination queue .
if that moment it will not able to find the destination queue it will store the message in DLQ1(which is with  Qmgr )


mqm@ /home/mqm
dspmq

dis qmgr (dispaly all the queue manager properties)
define qlocal(DLQ)

alter qmgr DEADQ(DLQ)

dis qmgr

dspmq

runmqsc QM.DEMO1

define qlocal(DLQ)

alter qmgr DEADQ(DLQ)

dspmq

runmqsc QM.DEMO

dis qremote(*)
dis qlocal(DLQ)
display

dis queue(DEMO.REMOTE)


alter qremote(DEMO.REMOTE) RNAME(LQ.DEMO)

channel --> start manually .
amqsput DEMO.REMOTE QM.DEMO

cd /opt/mqm
cd sampl/bin/

./amqsput DEMO.REMOTE QM.DEMO

Hai Test msg

runmqsc QM.DEMO

dis queue(XQ.DEMO)

CURDEPTH: properties of the queue *  tell the pending message count .


./amqsbcg DEMO.REMOTE XQ.DEMO   (browse the message )


runmqsc QM.DEMO


dis channel(*)   chltype(sdr)


CHANNEL (DEMO.DEMO1)
Start CHANNEL (DEMO.DEMO1)


dis chstatus(DEMO.DEMO1)

rummqsc

./amqsbcg DLQ QM.DEMO1



cd /var/mqm/qmrs/QM\!DEMO1/errors/



deadletter handler  :program will helps in retriveing the message from dlq to destination queue.


if destination queue is  fulled then receiver channel drop the msg into DLQ .

input count : no .of threads connection to local queue to put the msg . (put )
output count : get


always check mq logs .


if message flow is not happening then check following points;

1. MQ logs.
2. destination properties
3. channel is active ...
4. application security issue ......(proxy)


end .....

Dead letter Queue (DLQ)
***********************

1.IF destination is not defined or unavailable then message without loss it will store in DLQ .
each queue manager (QM ) will have one DLQ .it is mandatory or suggested to have DLQ .

QM.DEMO   QM.DEMO1
|->DLQ1  
|->DLQ

RQ LQ
TX Receiver channel.
SC (sender channel)
               

Before sender channel started message seats with or stores in TX .
once connection established it will reached the receiver channel and look for destination queue .
if that moment it will not able to find the destination queue it will store the message in DLQ1(which is with  Qmgr )


mqm@ /home/mqm
dspmq

dis qmgr (dispaly all the queue manager properties)
define qlocal(DLQ)

alter qmgr DEADQ(DLQ)

dis qmgr

dspmq

runmqsc QM.DEMO1

define qlocal(DLQ)

alter qmgr DEADQ(DLQ)

dspmq

runmqsc QM.DEMO

dis qremote(*)
dis qlocal(DLQ)
display

dis queue(DEMO.REMOTE)


alter qremote(DEMO.REMOTE) RNAME(LQ.DEMO)

channel --> start manually .
amqsput DEMO.REMOTE QM.DEMO

cd /opt/mqm
cd sampl/bin/

./amqsput DEMO.REMOTE QM.DEMO

Hai Test msg

runmqsc QM.DEMO

dis queue(XQ.DEMO)

CURDEPTH: properties of the queue *  tell the pending message count .


./amqsbcg DEMO.REMOTE XQ.DEMO   (browse the message )


runmqsc QM.DEMO


dis channel(*)   chltype(sdr)


CHANNEL (DEMO.DEMO1)
Start CHANNEL (DEMO.DEMO1)


dis chstatus(DEMO.DEMO1)

rummqsc

./amqsbcg DLQ QM.DEMO1



cd /var/mqm/qmrs/QM\!DEMO1/errors/



deadletter handler  :program will helps in retriveing the message from dlq to destination queue.


if destination queue is  fulled then receiver channel drop the msg into DLQ .

input count : no .of threads connection to local queue to put the msg . (put )
output count : get


always check mq logs .


if message flow is not happening then check following points;

1. MQ logs.
2. destination properties
3. channel is active ...
4. application security issue ......(proxy)


end .....


what is OSB?

OSB is a shared domain and used for transformation and routing like Message Broker in Websphere.

OSB requires Weblogic.
MB  requires    MQ.

$runmqsc QM.DEMO

dis channel(*) chtype(snd)  ( it will display All channels)

Xmit Q->Trigger control : on
Trigger type    : first
                          full
 depth

depth   : 1

data    : ALSB.TO.EC -> channel
Init Q  : SYSTEM.CHANNEL.INIT Q

dis qlocal(XQ.DEMO)

alter qlocal(XQ.DEMO) TRIGDATA(DEMO.DEMO1) INITQ(SYSTEM.CHANNEL.INITQ)

SYSTEM.CHANNEL.INITQ : Is default for QM.


Putting some msg into remote Q:
_______________________________

cd /opt/mqm/samp/bin

./amqsput DEMO.REMOTE QM.DEMO

type some text here

runmqsc QM.DEMO  (run queue manager)

dis chstatus(DEMO.DEMO1)

./amqsget DLQ QM.DEMO1


** Triggering can start any process ( Ex: star channel)

Queue ->
-> Advanced
-> channel
-> new - sender channel
server channel

Cluster--Full repository -- All running object info
         Partial repository -- Only info of objects to which it communicating


server   --------->  client
        conn channel
(application)------> (MQ server)

Ex: OSB or TUX application -----> (MQ server)
Conn channel



server--conn channel
--> General
--> Extended ----> Max msg length = (should be more than 4MB)
  hearbeat       = 300
  max instances  = 999999999
  max instance per client = 999999999
  message compression     =
  Keep alive.Auto         =


MCA : Message Channel Agent ---> UserID : MQALSB
-->Exist-> Security exit name: BlockIP(Block Exit)
  user data : FN = /var/mqm/exist641/ALSB.txt

  ALSB.txt file : Contains user details . Those users can only alter the QM using server channel.

-->SSL -- Used for security purpose and some certificates have been installed.
          Cipher Text : /#A&sjfsjslf08j)+/jllljjj


./amgsbcg DLQ12 QM.DEMO1

Error: reason 2085

mqrc 2085 ( It will display error details )

endmqm QM.DEMO1 (stop QM)


IMP Error numbers:
-----------------

mqrc 2085

      2085  0x00000825  MQRC_UNKNOWN_OBJECT_NAME
 mqrc 2058

      2058  0x0000080a  MQRC_Q_MGR_NAME_ERROR
 mqrc 2059

      2059  0x0000080b  MQRC_Q_MGR_NOT_AVAILABLE
mqrc 2035

      2035  0x000007f3  MQRC_NOT_AUTHORIZED
mqrc 2033

      2033  0x000007f1  MQRC_NO_MSG_AVAILABLE
mqrc 2038

      2038  0x000007f6  MQRC_NOT_OPEN_FOR_INQUIRE
mqrc 2039

      2039  0x000007f7  MQRC_NOT_OPEN_FOR_OUTPUT
mqrc 2016

      2016  0x000007e0  MQRC_GET_INHIBITED




binding concept:

/bea/osb103/scripts/jmsadm.scp

binding files : ex: .bindings

binding file contails Queue info in osb

like connection factory, Jndi info , etc.



1 comment:

Unknown said...

very good articles. If you have weblogic version upgradation procedure, please share
Thanks alot for these articles.