Middleware Tech

July 13, 2011

Websphere Message queue

Filed under: MQ — Vijay Nekkanti @ 5:06 am

WebSphere MQ

 

MQ: Messaging and Queueing. It is used for the transport of data from one server to another and the data will be transferred in the form of messages and messages will be placed(stored) on queues one after the other, that is the reason it is called messaging and queuing.

Message: Everything(Any piece of business data) is called a message in middleware.

4 Types of messages:

  • Request: A message for which a reply is expected.
  • Reply: A reply to a request message.
  • Datagram: A message for which no reply is expected.
  • Report: Is an occurrance of an issue or an error.
  • ·

MQ: Supporting OS

32+ platforms: AS/400, Z/OS, all UNIX flavors (LINUX, SOLARIS SPARC, SOLARIS INTEL, IBM AIX and HP_UX), Windows and ISERIES.

Mq supported Languages: COBOL, C, JAVA, ASSEMBLER, .NET, JMS

MQ has two types of softwares:

  • MQ Server: If you installed MQ Server s/w on a machine an MQ service will run on the machine and you can define all the WebSphere MQ objects(for example, Queue Manager, Queues etc.,). 15-20 min
  • ·
  • MQ Client: If you install MQ client S/W on a machine, there will be no service run that machine, it is a set of libraries used to communicate with MQ Server running on the Server machine). 2-3 min
  • ·

Queue Manager: It is the overall govern for the entire WebSphere MQ system. It is also a WebSphere MQ object. This is logical object. There are separate queue managers for Production, TEST and USER region environment.

Queue: It is the named destination for messages. It is a WebSphere MQ object.

MQ Administration can done using:

  • MQSC (MQ script commands).
  • Control commands.
  • MQ Explorer: It is a GUI tool built on top of the eclilipse platform and is available on Windows Intel and Linux(X86) machines only.
  • PCF(Programmable Format Commands).
  • ·

Message: Message is logical in MQ, message consists of two parts:

  1. Message Header or Control information: This contains the complete information about the message. For example, the date and time the message was put, the user who put the message & the type of O.S that put the message etc., The length of the header will be around 324 bytes.
  2.  Message Data: This is the actual business data.

2.

Put: Writing a message into a queue. This is similar to inserting a record into a DB2 table.

Get: Reading or getting a message from a queue. This is similar to selecting a record from a DB2 table.

SQL: It is interface between an application program and the physical relational database (it can be DB2 or Oracle).

MQI (Message Queueing Interface): It is the interface between an MQ application program and MQ Queue Manager or Server. MQI provides a set calls thru that an application program can put and get messages to and from the queue.

Note: The default message get in MQ is destructive, if you want a message to be get in browse mode the application program has to set the options for the Browse get in the get message options structure.

Steps: To install Websphere MQ in windows

1. Copy the S/w: .zip

2. Extract the s/w.

3. Launch

4. Select Software requirements — > Ecilipse  (3.3) — Install

5. Server installation —> Select Custom —

Select — MQ Server, File transfer, JMS, Development Kit and MQ explorer.

First Steps:

#strmqcfg — > Control commands to start the MQ explorer.

#dspmqver — > To display the MQ version and product information.

#dspmq    — > The environment infomtation, the queue managers created and the status of the queue managers

#crtmqm  QMGR_NAME —-> To create the queue manager.

#strmqm  QMGR_NAME —-> To start the created queue manager.

#endmqm  QMGR_NAME —-> To stop the running queue manager.

#dltmqm  QMGR_NAME —-> To delete the queue manager.

Queue Manager: Queue manager is the overall governer for the entire WMQ system.

Creating a Queue Manager ( In Windows CLI)

 

C:\Documents and Settings\USER1>crtmqm TEST

WebSphere MQ queue manager created.

Directory ‘C:\Program Files\IBM\WebSphere MQ\qmgrs\TEST’ created.

Creating or replacing default objects for TEST.

Default objects statistics : 68 created. 0 replaced. 0 failed.

Completing setup.

Setup completed.

C:\Program Files\IBM\WebSphere MQ\qmgrs\TEST: This is the path where the queue manager data will be stored.

C:\Program Files\IBM\WebSphere MQ\ —-> This is the default MQ path.

Note: The install path and the run time data path on Windows machines is the same.

Default objects statistics : 68 created. 0 replaced. 0 failed: 68 system default objects are created. This objects can be used be used as a model for creating new MQ user objects. All the system MQ objects startes wil SYSTEM.*.

C:\Documents and Settings\USER1>endmqm TEST

Quiesce request accepted. The queue manager will stop when all outstanding work is complete.

Quiesce State:  In this state MQ will wait for the all the current running activity to be completed, then it will go for shutting dowm itself. In this state MQ cannot accept new MQ connections.

Message in MQ: Message is logical in MQ. Message consists of two parts:

  1. Message header: This is also called as the control information or the MQMD header. It contains the complete information about the message. For example, the date and time the message was put to the queue, the id of the user who put the message, the priorty of the message , the type of the message etc.,
  1. Message data: This is the actual business data.

2.

Queue: Queue is the named destination for MQ messages.

Types of queues:  (Basic Important )

 

  1. Local Queue: It is local or under the control of the queue manager.

1.

  1. Remote Queue: It is under the control of some remote queue manager.

2.

Note: We can put and get messages from a local queue.

We can only put messages to the remote queues.

SQL: SELECT, UPDATE, INSERT, DELETE, CREATE

MQI:  (Message queueing interface): It is an interface between the application program and the MQ server. MQI contains calls for communicating with MQ server.

MQI Calls

A. Put a message into a queue:

  • MQCONN: Is the call to connect to queue manager.
  • MQOPEN: Open the queue.
  • MQPUT: To put a message(s) into the queue.
  • MQCLOSE: To closed the opened queue.
  • MQDISC: To disconnect from the queue manager.
  • ·

B. Get a message into a queue:

  • MQCONN: Is the call to connect to queue manager.
  • MQOPEN: Open the queue.
  • MQGET: To get a message(s) into the queue.
  • MQCLOSE: To closed the opened queue.
  • MQDISC: To disconnect from the queue manager.
  • ·

C. put a single message into a queue.

  • MQCONN: Is the call to connect to queue manager.
  • MQPUT1: To put a single message into the queue.
  • MQDISC: To disconnect from the queue manager.
  • ·

D.

  • MQINQ: To inquire about the attributes of MQ object.
  • MQSET: To set the attributes of an MQ object.
  • ·

E.

  • MQCOMMIT: To commit the MQ changes.
  • MQRLBK:   To rollbak the MQ changes.

Sample Programs:

Source:

C:\PF\IBM\WebSphere MQ\Tools\ — Windows

/opt/mqm/Tools — UNIX

All the executable control commands and IBM supplied programs will be available in

C:\PF\IBM\WebSphere MQ\bin   —— Windows

/opt/mqm/bin —– UNIX

To Put a message on the queue:

Run the amqsput program:

#amqsput Queue_Name Queue_Manager_Name

C:\Documents and Settings\kumar>mqrc 2058

2058  0x0000080a  MQRC_Q_MGR_NAME_ERROR

C:\Documents and Settings\kumar>mqrc 2085

2085  0x00000825  MQRC_UNKNOWN_OBJECT_NAME

To get a message from a queue:

To run the amqsget program:

#amqsget Queue_Name Queue_Manager_Name

The default message get is destructive. If we want to get the message in the browse mode, we have to set the MQ getoptions to MQGMO_BROWSE to get the message in the browse mode.

MQ- Message

  • Message Header : contains 25-30 fields, giving the complete information about the message. The length

                                of the header is around 320 bytes.

  • Message data: Depends on type of business transaction. The maximum length allowed for a single

message is 100 MB. 1kb, 2kb, 3kb.

Headers:

These header are available in the form of copybooks in COBOL, includer files in C language and Classes in Java. The length of the message header will be around 320 bytes. The message data depends on the type of the business transaction, it can be 1kb, 2kb etc.,

 MQMD (Message Descriptor or message header or control information)

MQMD-MSGTYPE: This is the type of the message, this is application driven and the default message type is

datagram.

MQMD-ENCODING: This is machine dependent and queue manager driven and this will tell, the numeric

representation of data on a particular server.

MQMD-CODEDCHARSETID: this is machine dependent and queue manager driven and this will tell, the

character set identifier of the machine that put the message into the queue.

MQMD-FORMAT: this contains the format of the data that was put to the queue, this is queue manager driven.

MQMD-PRIORITY: Any message we put to the queue can have priority of 0-9. 0 is the lowest priority and 9 is the

highest priority. The messages with hight priority will be processed first if two messages

placed at the same time into the queue and with different priorities. Priority value has a

meaning if the Message Delivery Sequence queue attribute is set to priority.

Simillar to the persistence, priority can also be set in the program or the message will take the

queue default priority.

MQMD-PERSISTENCE: Persistence messages will survive the restart of the queue manager. Persistence

messages will be written to the logs and MQ queue and non-persistent messages will be

written only to the queues and will get deleted in the queue manager re-start.

We can set the persistence to persistent or non-persistent in the program. If no t set in

the program MQ will take the queue default persistence.

MQMD-MSGID: This is the identifier for the message, generaly messages from a particular client can be placed

into the queue with unique message identifiers.

MQMD-CORRELID: Befor sending the reply back to the client, we can copy the message id to the correlation

identifier, so the client can correlate the request with the reply.

MQMD-BACKOUTCOUNT: This will tell the  number of times the same message was put to the queue and get from the queue, it is 0, if the message was put first time and 1 for the second time, and 2 for the third time and etc., Its value is more than 1 or 2 if the application program processing the message is in infinite loop, This field is queue manager driven.

MQMD-REPLYTOQ: For a request message, this is the queue where to send the reply.

MQMD-REPLYTOQMGR: For a request message, this is the queue manager where to send the reply.

MQMD-USERIDENTIFIER: This contains the Id of the user who put the message. This will be your windows login

id or mainaframe RACF or TSO id or a UNIX user iD. Application also can write some

data into this field.

MQMD-APPLIDENTITYDATA: This can be filled by the application to give the identity of the client that put the

message into this queue.

MQMD-PUTAPPLTYPE: This is the type of the server that put the message into the queue, for example: 32-bit

windows, UNIX or a mainframe CICS transaction Server. This field is queue manager

driven.

MQMD-PUTAPPLNAME: This contains the application program which put the message into queue. This is queue

manager driven.

MQMD-PUTDATE: Date the message was put to the queue. This will written only by the queue manager, we can

not write some data into this field.

MQMD-PUTTIME. Time the message was put to the queue. This will written only by the queue manager, we can

not write some data into this field.

MQMD-APPLORIGINDATA: This can be filled by the application to give the details about the origin of the client

that put the message into the queue.

MQMD-OFFSET: This is the starting position of the message in the message data area. 0 means first byte. This

is other than zero, if your message is segemented.

MQMD-ORIGINALLENGTH: This is the length of the message that was put to the queue, this is queue manager

driven field.

Persistent messages survive the re-start of the queue manager.

These messages will written to the log and queue location, Whenever queue manager is re-started all the messages will automatically deleted from the queue and only the persistent messages will get copied from the logs into the queue.

Non-persistent messages cannot be written to the logs, we will lost this messages after the queue mager re-start.

Priority: 0-9

Messages with high priority will be processed first when multiple messages with different priority values were put to the queue.

 3.Alias Queue: It is a local queue, it is a logical queue and will be resolved to a base queue. Using the alias

queues, we can set different attributes for persistence and priority on the same base queue for

different clients. We can also set different put and get authorities for different clients using the alias

queues on the same base queue.

We no need to change the base queue, we can set different put authority, get authority, priority and persistence for diffenents client thru the alias queues.

MQRC 2016: Get inhibited on a queue.

MQRC 2051: put inhibited on a queue.

MQRC 2085: Object not found in the system.

MQRC 2058: Queue Manager name error (Queue Manager is not found in the system).

4.Model Queue: Model is just a template for defining dynamic queues at run time. Dynamic queue are defined in

the program at runtime taking the attributes from the model queues.

There are two types of dynamic queues:

  • Temporary Dynamic Queue: This queue will be created in the program at runtime and will be deleted

                                                 after the program is completed.

  • Permanent Dynamic Queue: This queue will be created in the program at runtime and will stay in the

                                                 system permanently after the program is completed.

Dynamic queues will be created using the AMQ* prefix.

For defining the permanent model queues set the Definition Type as Permanent Dynamic.

For defining the temporary model queues set the Definition Type as temporary Dynamic.

Once a model is opened in the program automatically MQ will create Temporary or a Permanent Dynamic queue based on the type of the model queue.

Runmqsc:

#runmqsc TEST

DISPLAY QLOCAL(*) ALL

DISPLAY QLOCAL(A*) ALL

 

 

 

Windows: MQ will run as a service.

amqmsrvn MUSR_MQADMIN — Process related to the MQ service. MUSR_MQADMIN is a user-id created by MQ at the time of installation. All the queue manager process and MQ service process amqmsrvn run under this user-id.

UNIX: Once the queue manager is started the MQ process related to the queue manager will start and runnning. The process will be run under user mqm, mqm user group will created at the time of the MQ server installation.

Mainframe: MQ will run as a job in mainframes, there are two jobs that will a single manager, one is the queue manager job and the other is the channel initiator job.

Queue Manager type of start-up:

  • Automatic: Configures the queue manager to start automatically when the machine starts up.
  • Service Manual: Configures the queue manager to start only when manually requested, once started it

will continue to run even after the user who started it has logged off

  • Interactive Manual: Configures the queue manager to start only when manually requested, it will end

                                  when the user who started it logs off

Start Queue manager:

1. Start a queue manager as created.

     #strmqm QMGR_NAME

 

2. Start a queue manager as a service:

     #strmqm -ss QMGR_NAME

 

3. Start a queue manager in interactive mode:

     #strmqm -si QMGR_NAME

Stop Queue manager:

  • Stop the queue manager in controlled mode:

#endmqm -w QMGR_NAME or #endmqm QMGR_NAME

In this mode, the queue manager will first go to Quiscing mode, in this state queue manager will allow the

existing MQ connections to be completed and does not any new MQ connections. Once all the

connections are closed the queue manager will shutdown.

  • Stop the queue manager in immediate mode:

#endmqm -i QMGR_NAME

In this mode, queue manager doesn’t care about running MQ connections and will stop the queue

manager immediately, in this mode, we may loose some business data. Use this mode, if you are not

able to stop the queue manager in a controlled mode one.

  • Stop the queue manager in pre-emptive:

             #endmqm -p QMGR_NAME

Stop the queue manager in this mode, if you are not able to stop the queue manager in the above two

modes.

What if you are not able to stop the queue managers in any of the above modes: Stop the indivudual processes of the queue manager:

#tasklist

 

#ps -ef | grep QMGR_NAME

#runmqsc QMGR_NAME

DIS CONN(*)

To get the process Ids of all the running connections against the queue manager.

C:\Documents and Settings\kumar>runmqsc C1

5724-H72 (C) Copyright IBM Corp. 1994, 2009.  ALL RIGHTS RESERVED.

Starting MQSC for queue manager C1.

dis conn(*) all

1 : dis conn(*) all

AMQ8276: Display Connection details.

CONN(3613BE4D20000001)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(4844)                               TID(1)

APPLDESC(WebSphere MQ Object Authority Manager)

APPLTAG(ebSphere MQ\bin\amqzfuma.exe)   APPLTYPE(SYSTEM)

ASTATE(NONE)                            CHANNEL( )

CONNAME( )                              CONNOPTS(MQCNO_FASTPATH_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA( )                              UOWSTTI( )

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

AMQ8276: Display Connection details.

CONN(3613BE4D20000601)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(5044)                               TID(1)

APPLDESC(WebSphere MQ Cluster Repository)

APPLTAG(ebSphere MQ\bin\amqrrmfa.exe)   APPLTYPE(SYSTEM)

ASTATE(NONE)                            CHANNEL( )

CONNAME( )                              CONNOPTS(MQCNO_SHARED_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA(2011-05-02)                     UOWSTTI(07.45.14)

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.20)                            UOWSTATE(ACTIVE)

AMQ8276: Display Connection details.

CONN(3613BE4D20000701)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(5180)                               TID(1)

APPLDESC(WebSphere MQ Deferred Message Processor)

APPLTAG(ebSphere MQ\bin\amqzdmaa.exe)   APPLTYPE(SYSTEM)

ASTATE(NONE)                            CHANNEL( )

CONNAME( )                              CONNOPTS(MQCNO_SHARED_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA( )                              UOWSTTI( )

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

AMQ8276: Display Connection details.

CONN(3613BE4D20000D01)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(4924)                               TID(1)

APPLDESC(WebSphere MQ Channel Initiator)

APPLTAG(ebSphere MQ\bin\runmqchi.exe)   APPLTYPE(SYSTEM)

ASTATE(NONE)                            CHANNEL( )

CONNAME( )                              CONNOPTS(MQCNO_SHARED_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA( )                              UOWSTTI( )

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

AMQ8276: Display Connection details.

CONN(3613BE4D20000E01)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(4984)                               TID(1)

APPLDESC(WebSphere MQ Command Server)

APPLTAG(ebSphere MQ\bin\amqpcsea.exe)

APPLTYPE(SYSTEM)                        ASTATE(NONE)

CHANNEL( )                              CONNAME( )

CONNOPTS(MQCNO_SHARED_BINDING)          USERID(kumar)

UOWLOG( )                               UOWSTDA( )

UOWSTTI( )                              UOWLOGDA( )

UOWLOGTI( )                             URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

AMQ8276: Display Connection details.

CONN(3613BE4D20001D01)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(3812)                               TID(187)

APPLDESC( )

APPLTAG(re MQ\java\jre\bin\javaw.exe)

APPLTYPE(USER)                          ASTATE(NONE)

CHANNEL( )                              CONNAME( )

CONNOPTS(MQCNO_HANDLE_SHARE_BLOCK,MQCNO_ISOLATED_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA( )                              UOWSTTI( )

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

AMQ8276: Display Connection details.

CONN(3613BE4D20001F02)

EXTCONN(414D5143433120202020202020202020)

TYPE(CONN)

PID(2440)                               TID(1)

APPLDESC(WebSphere MQ Script Command Processor)

APPLTAG(WebSphere MQ\bin\runmqsc.exe)   APPLTYPE(SYSTEM)

ASTATE(NONE)                            CHANNEL( )

CONNAME( )                              CONNOPTS(MQCNO_SHARED_BINDING)

USERID(kumar)                           UOWLOG( )

UOWSTDA( )                              UOWSTTI( )

UOWLOGDA( )                             UOWLOGTI( )

URTYPE(QMGR)

EXTURID(XA_FORMATID[00000000] XA_GTRID[] XA_BQUAL[])

QMURID(0.0)                             UOWSTATE(NONE)

#taskkill pid — Windows or Windows Task Manager

#kill -pid

Triggering: Automatically starting a program or transaction when trigger conditions are satisfied for a queue.

1 . Trigger Control: It must be on for a trigger queue

2. Trigger Type:

  • First     : Trigger conditions will be satisfied whenever the first message arrives on queue.
  • Every   : Trigger conditions will be satisfied for every message arrives on the queue.
  • Depth   : Trigger conditions will be satisfied whenever depth number of messsages arrived on the

                queue.

3. Trigger depth: This has the meaning when the trigger type is Depth. When Depth number of    messages arrived on the queue, trigger conditions will be satisfied for the queue.

4. Trigger Message Priority: All the messages with priority > = this proiority of the message value will be taken into consideration for triggering.

5. Initiation Queue: It is local queue, queue manager will write the trigger messages into          this initiation queue whenever trigger conditions are satisfied for the queue.

6. Process Object: Contains the application program or the transaction to be started.

There is a continously running trigger monitor program which will always look into this initiation queue for trigger messages and whenever a trigger message arrives, the trigger monitor program will read destructive that message and start the application program or the transaction.

Start the trigger monitor program:

#runmqtrm -q INITQ-Name – m Queue-Manager-Name

Note: First will useful when ever you have to process some number of messages as a unit of work or batch. Only one trigger message will be enough to process all the messages in the queue.

Scenario1: Trigger queue is getting one message every 5 min from a client, In this case there is no diff b/w trigger type first and every.

Scenario2: Trigger queue is getting 100 messages in one shot every one hours. In this case if I give trigger type as EVERY, 100 trigger messsages will generated and system will be heavy loaded. If we give trigger TYPE as First in this case, only one Trigger msg will get generated that will be enough to process all the 100 messages in the queue. The application program once started has to make sure to get all the messages from queue(check for MQ return code 2033 — enf of the queue) to process all the message with a single trigger message.

Intercommunication :

 

Sending a message from one queue manager(local machine) to another manager(remote machine).

Sender(FID):

  1. Local definition of remote queue (QREMOTE):  This is a logical queue.contains the target queue name (JPMC.QLOCAL) , remote queue  manager name(JPMC) and transmission queue namer(XMITQ).

The name of the transmission queue must be the same as the remote queue manager.

  1. Trasmission queue (JPMC): This is a local trigger queue with the Usage set XMITQ or transmission. The name of this queue must be the same as the target queue manager name.
  1. Initiation Queue (FID.INITQ): This the local queue where the queue manager will write the trigger messages when channel trigger happend or trigger conditions are satisfied for the transmision queue. This should be defined based on the System queue SYSTEM.CHANNEL.INITQ.
  1. Process(FID.PROCESS): This contains the sender channel (FID.TO.JPMC) to be started (in user data field) when trigger conditions are satisfied for the local transmission queue.
  1. Sender channel(QM1.TO.QM2): This contains the machine name or address of the receiver queue manager (including the port number) and the transmission queue(FID) and the transport protcol(TCP.
  1. Start the channel initiator program against the initiation queue.

#runmqchi -q INITQ-NAME -m QMGR-NAME

#runmqchi -q FID.INITQ -m FID

Once trigger conditions are satisfied for the transission queue, queue manager will write a trigger message into the initiation queue, the channel initiator program will look for trigger messages in the initiation queue continously, once a trigger message is arrived, it will get that message which contains the sender channel to be started and will start the sender Chanel.

Note: Application programmers will only have acces to the QREMOTE. Once the message was put to the QREMOTE it will be moved to the transmission queue.

Note: Once the message was put to the  QREMOTE, Queue manager will add a Transmision header to the message which contains the remote destinaltion address and route it to the transmission queue, this header contains the remote machine queue name, queue manager. This will be removed once the message reaches the destination, before placing the message on the target.

Receiver(JPMC):

  1. JPMC.QLOCAL : this is the target for the messages.
  1. Receiver channel(FID.TO.JPMC): the name must be same as the sender channel.

 

  1. Listener: Listener is a WMQ object, the Listener looks for incoming MQ network requests on a particular port number. WMQ queue manager default port number is 1414.

Channel States:

  1. Initialization state: In this state channel will initialize itself.
  1. Binding state: This is the state the sender channel will bind with the receiver system, it will do a internal ping to receiver channel to check for any issues with the receiver system. Once the channel completed states 1 and 2 successfully, the sender channel will get started and it drives also the receiver channel to be started.
  1. Running: This is the channel running state, if the sender channel is running, the corresponding receiver channel will also be in the running state and messages will be moved from the sender to the receiver side.
  1. Inactive: If the sender channel is idle for more than the disconnect interval mentioned in the sender channel’s disconnect interval attribute, the sender channal and also the receiver channel will be moved to the inactive state. This state is not an issue, this is to save the resources on the system. Whenever a new message was placed on the XMIT queue, automatically the sender channel will again go to the running state.

If the Sender is getting a message every one hour, in this case it is good to give less disconnect interval

to save the system resources.

Sender is getting a message 5 min, in this case it is good to give a high disconnect interval to save the

system resources.

  1. Paused: We will see this channel state only for the receiver channel. This occurs if the receiver target queue is full. This is an issue. The moment the receiver channel went to a paused state an alert will be issues to resolve the issue. If the target queue is full the messages will be lost if we have no defined dead letter queue for the queue manager.
  1. Retry: This is an issue state. That should be resolved immediately, this indicates some issue with the remote system queue manager, for example, the remote sever or the queue manager is down or the Listener object is not running on the remote queue manager or there is some other network issue (For example, the port number and machine address in the sender channel is wrong).

If the channel is in re-try state MQ queue manager will trigger off the trasmission queue, so mesages will

stay in the transmission queue. Once the issues is resolved(starting the queue manager or the Listener),

mq will autocorrect the system by using the sender channel re-connect intervals. Sender channel will

come to running and the trasmission will be triggered on automatically and the message sitting in the

transmission queue will be sent to the remote Queue Manager’s target queue.

  1. Stopped: This can a manual stop of the channel or the channel went to the stopped state from the retry state. If the channel is in retry, queue manager will wait for the short and the long retry count intervals in the sender channel definition for the issue to get resolved, if the issue is not resolved within this period the channel will go to the stopped state.

Note: If the channel is in the Sttopped STate, we have to start that channel manually.

LOGS :

 

Logs contains the persistent messages, uncommited unit work(uow), the record image of an object.

MQ has two types of logs:

  1. Circular logs (default logging in MQ)

1.

  1. Linear logs

2.

Log path:

WINDOWS :  C:\Program Files\IBM\WebSphere MQ\log

 

LINUX :           /var/mqm/Qmgrs/log

Default logging is circular logging, once all the logs are filled, MQ will start re-using from the first log, So, we cannot the log out of space issues. We cannot have record of an object if we use circular logging for the queue manager logs.

In Liner logging once all the primary and secondary logs allocated are filled, we will log out of space issues.

Queue Manager Data Path: C:\Program Files\IBM\WebSphere MQ\qmgrs/QMGR_NAME

/var/mqm/qmgrs/QMGR_NAME

It contians all the queues, channels, process etc.,

Note: Major of the installations will have the circular logging. But there is a legal thing in some financial projects we should use the linear logging to avoid the loss of log data.

How to increase the primary and secondary logs, once the queue manager is created:

Windows: Change the registry entries for the queue manager logs. Command is regedit.

UNIX:    Updata the queue manager configuration file /var/mqm/Qmgrs/QMGR_NAME/qm.ini file logs entries.

Note: The increased primary log files can be treated as secondary and will be created on a need basis simillar to how the seconday log file will be created.

Once the update is done re-start the queue manager.

Note: The Maximum size of a single log file is 65,535 (256MB)

Total log files size = 64GB(win)/128GB(unix)

The total number of primary and secondary log files should be 255.

How to calculate the best log file size:

1. Maximum number of persistent messages that can sit in the system at any point of time.

2. Consider the activity between two syncpoints in a business application.

3. Calcualte the down time (how much time required to shift the activity from a live system to a    back up system — consider here the MQ activity for that time)

Note: Give all the required log space in the primary log files itself.

If I need 1GB of log space, create 4 primary log files with 256 MB of space, so you never get the log file issues even the activity is more than calculated seconday will take care.

ERRORS:

 

Errors:

This contains errors related to the system level.

WINDOWS :   C:\Program Files\IBM\WebSphere MQ\errors:

LINUX        :     /var/mqm/errors

Which contains the queue manager specific errors.

WINDOWS :   C:\Program Files\IBM\WebSphere MQ\Qmgrs\QM2\errors

LINUX         :    /var/mqm/Qmgrs/QM1/errors

LOG: This contains the uncommitted unit of work, persistene messages and record of an objects.

Log path:

Windows    :     C:\Program Files\IBM\WebSphere MQ\log

LUNIX        :      /var/mqm/Qmgrs/log

Default logging is circular logging, once all the logs are filled, MQ will start re-using from the first log, So, we cannot the log out of space issues.

We cannot have record of an object if we use circular logging for the queue manager logs.

In Liner logging once all the primary and secondary logs allocated are filled, we will log out of space issues.

Queue Manager Data Path:

WINDOWS :    C:\Program Files\IBM\WebSphere MQ\qmgrs/QMGR_NAME

LINUX         :     /var/mqm/qmgrs/QMGR_NAME

It contians all the queues, channels, process etc.,

FFST:

#amqldbgn -p 4028

System errors

Queue Manager error

trace files

generate FFST files.

Errors:

2 types of errors:

  1. System level errors:

1.

                 WINDOWS  :    C:\Program Files\IBM\WebSphere MQ\errors

LINUX          :    /var/mqm/errors

  1. Queue manager level errors:

2.

WINDOWS    :   C:\Program Files\IBM\WebSphere MQ\Qmgrs\FID\errors

             LINUX            :    /var/mqm/qmgrs/QMGR_NAME

In the    C:\Program Files\IBM\WebSphere MQ\errors , /var/mqm/errors MQ MQ will automatically create FFST (First Failure Support Technology) reports that contains the errors information in the system. FFST contains the process Id that has the error.

#amqldbgn -i PID

We can also create trace files for different application process to help in resolving serious errors with the application process:

#strmqtrc -i PID

Make sure to stop the tracing

#endmqtrc -i PID

Trace files wil be stored in

WINDOWS    :    C:\Program Files\IBM\WebSphere MQ\trace

LINUX            :     /var/mqm/trace

Client – Sever Configuration:

Setup-1:

  1. Install the MQ client software on the client machine.

1.

  1. Install the MQ server and create and start queue manager and create a target queue for the client in the server machine.

2.

  1. Define Client Connection Channel using the MQServer environment variable on the client machine:

3.SET MQSERVER=CHANNEL20/TCP/192.168.1.2(1415)

3.

  1. Define the Server-Connection-Channel on the server side, the name of the channel must be the same    as the Client-Connection-Channel on the client’s side.

4.

  1. Put the message from the cliet side #amqsputc Q1 TEST1

5.

  1. 6. The server-connection-channel on the server side will come to running state and the messages will    be moved from client to server target queue.

6.

Setup-2:

  1. Define both the client and server channels on the server queue manager.

1.

  1. The names of the channels must be same.

2.

  1. FTP the channel definition table from C:\Program Files\IBM\WebSphere          MQ\Qmgrs\TEST\@ipcc\AMQCLCHL.TAB to the client machine, the copy must be in binary format.

3.

  1. Copy the channel definition table to C:\PF\IBM\AMQCLCHL.TAB on the client box.

4.

  1. SET the environment variable MQCHLTAB on the client side SET MQCHLTAB=C:\PF\IBM\AMQCLCHL.TAB

5.

  1. Put the messages from the client for testing using the IBM program amqsputc #amqsputc Q1 TEST1

6.

MQIVP — Java Program.

2059 :

UNIX:

Winscp

Extended Transactional Client:

Windows               —————————————————à  Mainframes

MQ Client Software on Windows                                               MQ Server on Z/OS

MQ Client Java Program      ————-request msg ————> Request Queue (Trigger Queue)

Wait for the reply on the reply queue                                         Reply Queue (reply msg)

Client Connection Channel                                                       Server Connection Channel (the name must be the

same the Client connection channel)

Server ——————- > Server

Client ——————— > Sever

Client ——————— > Client (NOT-Possiable)

NO   ———————– Client/Server ( NOT-Possiable )

June 29, 2011

How to use Eclipse as XML editor.

Filed under: IBM DataPower,Important links — Vijay Nekkanti @ 7:48 pm

Eclipse as an XML Editor.

Below link specifies that Eclipse as a XML Editor.

http://www.ibm.com/developerworks/opensource/library/os-eclipse-orangevolt/index.html

May 4, 2011

WebSphere MQ Commands

Filed under: MQ — Vijay Nekkanti @ 8:01 pm

Websphere MQ Commands / ibm websphere mq commands
=================================================

MQ commands
Command name Purpose
amqccert Check certificate chains
amqoamd Output setmqaut commands
amqmdain Configure or control WebSphere MQ services (Windows® systems only)
amqtcert Transfer certificates
crtmqcvx Convert data
crtmqm Create a local queue manager
dltmqm Delete a queue manager
dmpmqaut Dump authorizations to an object
dmpmqlog Dump a log [url]
dspmq Display queue managers
dspmqaut Display authorizations to an object
dspmqcsv Display the status of a command server
dspmqfls Display file names
dspmqrte Display route application
dspmqtrc Display formatted trace output (UNIX® systems only)
dspmqtrn Display details of transactions [pareja de rsvmqtrn]
dspmqver Display version number
endmqcsv Stop the command server on a queue manager
endmqdnm Stop .NET monitor
endmqlsr Stop the listener process on a queue manager
endmqm Stop a local queue manager
endmqtrc Stop tracing for an entity
mqftapp Run the File Transfer Application
mqftrcv Receive file using the File Transfer Application (server)
mqftrcvc Receive file using the File Transfer Application (client)
mqftsnd Send file using the File Transfer Application (server)
mqftsndc Send file using the File Transfer Application (client)
rcdmqimg Write an image of an object to the log
rcrmqobj Recreate an object from their image in the log
rsvmqtrn Commit or back out a transaction [pareja de dspmqtrn]
runmqchi Start a channel initiator process
runmqchl Start a sender or requester channel
runmqdlq Start the dead-letter queue handler
runmqdnm Run .NET monitor
runmqlsr Start a listener process
runmqsc Issue MQSC commands to a queue manager
runmqtmc Invoke a trigger monitor for a client (AIX® clients only)
runmqtrm Invoke a trigger monitor for a server
setmqaut Change authorizations to an object
setmqcrl Set certificate revocation list (CRL) LDAP server definitions (Windows® systems only)
setmqprd Enroll production license
setmqscp Set service connection points (Windows® systems only)
strmqcsv Start the command server for a queue manager
strmqm Start a local queue manager
strmqtrc Enable tracing

February 13, 2011

copy file from one linux to another linux box using SCP

Filed under: Application server,JBOSS,Unix or Bash Commands — Vijay Nekkanti @ 6:55 pm

sending a file from one linux box to another linux box.

scp stands for secure cp (copy), which means that you can copy files across an ssh connection that will be encrypted, and therefore secured.

You can this way copy files from or to a remote server, you can even copy files from one remote server to another remote server, without passing through your PC.

Usage

scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]

Description of options

from-host
Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command
user
Is the user which have the right to access the file and directory that is supposed to be copied in the cas of the from-host and the user who has the rights to write in the to-host
source-file
Is the file or files that are going to be copied to the destination host, it can be a directory but in that case you need to specify the -r option to copy the contents of the directory
destination-file
Is the name that the copied file is going to take in the to-host, if none is given all copied files are going to maintain its names

Options

-p
Preserves the modification and access times, as well as the permissions of the source-file in the destination-file
-q
Do not display the progress bar
-r
Recursive, so it copies the contents of the source-file (directory in this case) recursively
-v
Displays debugging messages

Examples

scp *.txt user@remote.server.com:/home/user/

This will copy all files with .txt extension to the directory /home/user in the remote.server.com host

scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel/

This is going to recursively copy all files from miguel’s Home directory on 10.1.2.2 host to his Home directory in 10.1.2.3 host.

February 1, 2011

How to install GCC in linux

Filed under: Application server,JBOSS — Vijay Nekkanti @ 10:53 pm

Important messages about GCC:

GCC version :     $ gcc -v

gcc path  :  $which gcc

If you are using Red Hat Enterprise Linux, type the command:

# up2date gcc

If you are using CentOS/Fedora Core Linux, type the command:

# yum install gcc

Some important GCC commands :

$ which gcc
/usr/bin/gcc

$ whereis gcc
gcc: /usr/bin/gcc3.2-version /usr/bin/gcc /usr/local/bin/gcc /usr/share/man/man1/gcc.1.bz2 /usr/share/man/man1/gcc.1

$ gcc -v
Reading specs from /usr//bin/../lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1/specs
Configured with: /usr/local/src/gcc-3.3.1/configure –prefix=/usr –libdir=/usr/lib –with-slibdir=/lib –mandir=/usr/share/man –infodir=/usr/share/info –enable-shared –enable-threads=posix –disable-checking –enable-long-long –enable-__cxa_atexit –enable-languages=c,c++,ada,f77,objc,java –host=i586-mandrake-linux-gnu –with-system-zlib
Thread model: posix
gcc version 3.3.1

$ gcc –version
gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Install GCC in linux:

su –
passwrd:

mkdir /usr/local/src
cd /usr/local/src

gunzip /tmp/gcc-3.3.1.tar.gz #where I downloaded the file
tar xvf /tmp/gcc-3.3.1.tar

cd /opt/build
/usr/local/src/gcc-3.3.1/configure
–prefix=/usr –libdir=/usr/lib –with-slibdir=/lib –mandir=/usr/share/man –infodir=/usr/share/info –enable-shared –enable-threads=posix –disable-checking –enable-long-long –enable-__cxa_atexit –enable-languages=c,c++,ada,f77,objc,java –host=i586-mandrake-linux-gnu –with-system-zlib

make
make install



January 30, 2011

Change Default port 8080 in jboss server

Filed under: Application server,JBOSS — Vijay Nekkanti @ 6:30 am

How to change default port in Jboss application server:

Directory :   /home/chowdary/apps/jboss/jboss-5.1.0.GA/server/default/deploy/jbossweb.sar

File : server.xml

[root@localhost jbossweb.sar]# cat server.xml
<Server>

<!– Optional listener which ensures correct init and shutdown of APR,
and provides information if it is not installed –>
<Listener className=”org.apache.catalina.core.AprLifecycleListener” SSLEngine=”on” />
<!–Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html –>
<Listener className=”org.apache.catalina.core.JasperListener” />

<Service name=”jboss.web”>

<!– A HTTP/1.1 Connector on port 8080 –>
<Connector protocol=”HTTP/1.1″ port=”8080″ address=”${jboss.bind.address}”
connectionTimeout=”20000″ redirectPort=”8443″ />

Change that 8080 to any port number which is available.

January 21, 2011

Jboss Application Server Commands

Filed under: Application server,JBOSS — Vijay Nekkanti @ 7:57 am

Install Jboss Application server:

  • Unzip the Jboss file using  unzip, gzip…etc commands.
  • go to the bin directory in jboss  and execute run.sh file.
  • command to run jboss  ./run.sh

To shutdown the Jboss Applivation server:

  • [bin]$  ./shutdown.sh -S

To start the server with minimal configration file set:

  • [bon]$./run.sh  -c  minimal

January 20, 2011

Set Java Path in linux

Filed under: Application server,JBOSS — Vijay Nekkanti @ 7:39 pm

SET JAVA PATH IN LINUX:

Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-java>. If your path is set to /usr/java/jdk1.5.0_07/bin/java, set it as follows:

$ export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java


Set PATH as follows:

$export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

Save and close the file. Just logout and login back to see new changes:

$ echo $JAVA_HOME
$ echo $PATH

Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:

$ which java

Set JAVA_HOME / PATH for all user

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:

# vi /etc/profile

Next setup PATH / JAVA_PATH variables as follows:

export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin



December 21, 2010

CURL Commands

Filed under: Curl Commands — Vijay Nekkanti @ 9:03 pm

Curl commands:-

Password secure:
curl –data-binary @<Filename> -k -u admin https://hostname:5550
Admin Password

Non password secure:
curl –data-binary @request.xml https://hostname:5550 -u admin:{adminPW} -k


To check weather server is up or not:
curl -f http://<hostname&gt;:7400/monitor

December 15, 2010

Linux Commands in realtime

Filed under: JBOSS,Unix or Bash Commands — Vijay Nekkanti @ 12:01 am

1———->How to find  ramsize , os, os bit in Linux

arch; free -m; cat /etc/redhat-release    ( This command will tell you all these details )

2———>How to know which is 32bit and 64 bit in linux

uname -m
i386 or i686 then it is 32 bit
x86_64 is 64bit

3——-> How to use traceroute in windows and linux:

——->in windows

> tracert <domain or IP address>

Example—> tracert http://www.yahoo.com

——->in linux

# traceroute <domain or IP address>
Example----> traceroute www.google.com

Next Page »

Blog at WordPress.com.