December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories

WordPress Quotes

If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Recent Comments

December 2018
M T W T F S S
« Nov    
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (34)
Ansibile (19)
Apache (133)
Asterisk (2)
cassandra (2)
Centos (209)
Centos RHEL 7 (259)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (28)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (2)
Ldap (5)
Linux (189)
Linux Commands (167)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (22)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (31)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (34)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (60)
Uncategorized (29)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

30 visitors online now
1 guests, 29 bots, 0 members

Hit Counter provided by dental implants orange county

MQ messaging

This example is a simple demonstration for understanding how MQ transfer messages between two queue managers and the minimum required MQ components for the same.
Kindly Share/Like/Follow the page if you like this article.

Below are the steps involved in this example.Source queue manager
——————————
1.) Create source queue manager.
2.) Start source queue manager.
3.) Connect to source queue manager using runmqsc command.
4.) Create a listener in source queue manager.
5.) Create transmission queue in source queue manager.
6.) Create a remote queue in source queue manager.
7.) Create a sender channel in source queue manager.
8.) Quit MQSC

Destination queue manager
————————————-
1.) Create destination queue manager.
2.) Start destination queue manager.
3.) Connect to destination queue manager using runmqsc command.
4.) Create a listener in destination queue manager.
5.) Create a receiver channel in destination queue manager.
6.) Create a local queue in destination queue manager.
7.) Quit MQSC.

Restart Source & Destination Queue Managers.
————————————————————-
1.) Stop source queue manager.
2.) Stop destination queue manager.
3.) Start source queue manager.
3.a.) Make sure that the listener started for source queue manager , if not start the listener.
4.) start destination queue manager.
4.a.) Make sure that the listener started for destination queue manager, if not start the listener.
5.) Connect to source queue manager using runmqsc command.
6.) Start sender channel on source queue manager.
7.) Check the channel status of both queue managers and make sure that both channels are running..
8.) Quit MQSC.

Testing
———-
1.) Put a message in remote queue of source queue manager.
2.) browse/get messages from local queue of destination queue manager.

Now let us implement above steps in a test server.

A.) Source queue manager (MqM1)
———————————————

1.) Create source queue manager MqM1

[root@myhost mqm]# crtmqm MqM1
WebSphere MQ queue manager created.
Directory ‘/var/mqm/qmgrs/MqM1’ created.
Creating or replacing default objects for MqM1.
Default objects statistics : 65 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.

2.) Start source queue manager MqM1
[root@myhost mqm]# strmqm MqM1
WebSphere MQ queue manager ‘MqM1’ starting.
5 log records accessed on queue manager ‘MqM1’ during the log replay phase.
Log replay for queue manager ‘MqM1’ complete.
Transaction manager state recovered for queue manager ‘MqM1’.
WebSphere MQ queue manager ‘MqM1’ started.

3.) Connect to source queue manager MqM1 using runmqsc command.
[root@myhost mqm]# runmqsc MqM1
5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MqM1.

4.) Create a listener in source queue manager MqM1.

define listener (‘MqM1.LSNR’) TRPTYPE( TCP ) PORT (1486)
1 : define listener (‘MqM1.LSNR’) TRPTYPE( TCP ) PORT (1486)
AMQ8626: WebSphere MQ listener created.

5.) Create transmition queue in source queue manager.
define qlocal (‘TR1.MqM1.Q1’) USAGE (XMITQ)
2 : define qlocal (‘TR1.MqM1.Q1’) USAGE (XMITQ)
AMQ8006: WebSphere MQ queue created.

6.) Create a remote queue in source queue manager.

define qremote (‘RMT.MqM1.Q1’) XMITQ (‘TR1.MqM1.Q1’) RQMNAME(‘MqM2’) RNAME(‘LOC.MqM2.Q1’)
3 : define qremote (‘RMT.MqM1.Q1’) XMITQ (‘TR1.MqM1.Q1’) RQMNAME(MqM2) RNAME(‘LOC.MqM2.Q1’)
AMQ8006: WebSphere MQ queue created.

Points to be noted:-
XMITQ :- Should be the same name mentioned while creating transmission queue in step A.5
RQMNAME :- Specify the same name mentioned while creating destination queue manager B.1

7.) Create a sender channel in source queue manager.
define channel (‘MqM1.SNDR’) CHLTYPE(SDR) CONNAME(‘localhost(1487)’) XMITQ(‘TR1.MqM1.Q1’)
4 : define channel (‘MqM1.SNDR’) CHLTYPE(SDR) CONNAME(‘localhost(1487)’) XMITQ(‘TR1.MqM1.Q1’)
AMQ8014: WebSphere MQ channel created.
Points to be noted:-

XMITQ :- Should be the same name mentioned while creating transmission queue in step A.5
CONNAME:- Specify the hostname/ipaddress and port number of the remote queue manager

8.) Quit MQSC

end

B.) Destination queue manager (MqM2)
—————————————————-

1.) Create destination queue manager MqM2
[root@myhost mqm]# crtmqm MqM2
WebSphere MQ queue manager created.
Directory ‘/var/mqm/qmgrs/MqM2’ created.
Creating or replacing default objects for MqM2.
Default objects statistics : 65 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.

2.) Start destination queue manager MqM2
[root@myhost mqm]# strmqm MqM2
WebSphere MQ queue manager ‘MqM2’ starting.
5 log records accessed on queue manager ‘MqM2’ during the log replay phase.
Log replay for queue manager ‘MqM2’ complete.
Transaction manager state recovered for queue manager ‘MqM2’.
WebSphere MQ queue manager ‘MqM2’ started.

3.) Connect to destination queue manager MqM2 using runmqsc command.

[root@myhost mqm]# runmqsc MqM2
5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MqM2.

4.) Create a listener in destination queue manager.
define listener (‘MqM2.LSNR’) TRPTYPE( TCP ) PORT (1487)
1 : define listener (‘MqM2.LSNR’) TRPTYPE( TCP ) PORT (1487)
AMQ8626: WebSphere MQ listener created.

5.) Create a receiver channel in destination queue manager.
define channel (‘MqM1.SNDR’) CHLTYPE(RCVR)
2 : define channel (‘MqM1.SNDR’) CHLTYPE(RCVR)
AMQ8014: WebSphere MQ channel created.

Points to be noted:-
Channel name should be the same name mentioned while creating channel in step A.7

6.)  Create a local queue in destination queue manager.
define qlocal (‘LOC.MqM2.Q1’)
3 : define qlocal (‘LOC.MqM2.Q1’)
AMQ8006: WebSphere MQ queue created.

7.) Quit MQSC

end

C.) Restart Source and Destination Queue Managers
——————————————————————–

1.) Stop source queue manager MqM1.
[root@myhost mqm]# endmqm MqM1
Quiesce request accepted. The queue manager will stop when all outstanding work is complete.

2.) Stop destination queue manager MqM2.

[root@myhost mqm]# endmqm MqM2
Quiesce request accepted. The queue manager will stop when all outstanding work is complete.

3.) Start source queue manager MqM1.
[root@myhost mqm]# strmqm MqM1
WebSphere MQ queue manager ‘MqM1’ starting.
5 log records accessed on queue manager ‘MqM1’ during the log replay phase.
Log replay for queue manager ‘MqM1’ complete.
Transaction manager state recovered for queue manager ‘MqM1’.
WebSphere MQ queue manager ‘MqM1’ started.

4.) Start destination queue manager MqM2

[root@myhost mqm]# strmqm MqM2
WebSphere MQ queue manager ‘MqM2’ starting.
5 log records accessed on queue manager ‘MqM2’ during the log replay phase.
Log replay for queue manager ‘MqM2’ complete.
Transaction manager state recovered for queue manager ‘MqM2’.
WebSphere MQ queue manager ‘MqM2’ started.

5.) Connect to source queue manager MqM1 using runmqsc command.
 

[root@myhost mqm]# runmqsc MqM1
5724-H72 (C) Copyright IBM Corp. 1994, 2009. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MqM1.

6.) Start sender channel on source queue manager.
start channel (‘MqM1.SNDR’)
1 : start channel (‘MqM1.SNDR’)
AMQ8018: Start WebSphere MQ channel accepted.

Points to be noted:- Starting sender channel will start the receiver channel automatically.
Step D contains the steps to check channel status.

NOTE:-
Make sure that listeners are started, if not started use below steps to start listeners
1.) Connect to source queue manager MqM1 using runmqsc command.
[root@myhost mqm]# runmqsc MqM1

2.) Verify Listener ‘MqM1.LSNR’  is running in source queue manager MqM1

display lsstatus (‘MqM1.LSNR’)

listener

 

2.a.) If the listener ‘MqM1.LSNR’ is not running start it by using below mqsc command 

start listener (‘MqM1.LSNR’)

1 : start listener (‘MqM1.LSNR’)
AMQ8021: Request to start WebSphere MQ Listener accepted.

3.) Quit MQSC

end

4.) Connect to destination queue manager MqM2 using runmqsc command.
[root@myhost mqm]# runmqsc MqM2
5.) Verify listener ‘MqM2.LSNR’ is running in destination queue manager MqM2

 

listener2

 

5.a.) If the listener ‘MqM2.LSNR’ is not running start it by using below mqsc command
start listener (‘MqM2.LSNR’)
1 : start listener (‘MqM2.LSNR’)
AMQ8021: Request to start WebSphere MQ Listener accepted.

D.) Checking channel status of both Qmgr
——————————————————

1.)Connect to source queue manager MqM1 using runmqsc command.
[root@myhost mqm]# runmqsc MqM1
2.) Verify the channel ‘MqM1.SNDR’ status

display chstatus (‘MqM1.SNDR’)

chstatus1

 

3.) Quit MQSC

4.) Connect to destination queue manager MqM2 using runmqsc command.
[root@myhost mqm]# runmqsc MqM2
5.) Verify the channel ‘MqM1.SNDR’ status

display chstatus (‘MqM1.SNDR’)

 

chstatus2

 

E.) Testing the setup
—————————

Note:- If not already installed, Install the samples before proceeding with below test.

1.) Put a message in remote Queue of MqM1

/opt/mqm/samp/bin/amqsput RMT.MqM1.Q1 MqM1
Type below text

This is a test message from RMT.MqM1.Q1 (remote Queue) of MqM1 to LOC.MqM2.Q1 (Local Queue) of MqM2

Press ctrl+z

Eg:-
[root@myhost bin]# /opt/mqm/samp/bin/amqsput RMT.MqM1.Q1 MqM1
Sample AMQSPUT0 start
target queue is RMT.MqM1.Q1
This is a test message from RMT.MqM1.Q1 (remote Queue) of MqM1 to LOC.MqM2.Q1 (Local Queue) of MqM2
[2]+ Stopped /opt/mqm/samp/bin/amqsput RMT.MqM1.Q1 MqM1

[root@myhost bin]#

2.) Browse/get the message from Local Queue of MqM2.

————————————————————————
/opt/mqm/samp/bin/amqsget LOC.MqM2.Q1 MqM2

[root@myhost bin]# /opt/mqm/samp/bin/amqsget LOC.MqM2.Q1 MqM2
Sample AMQSGET0 start

message <This is a test message from RMT.MqM1.Q1 (remote Queue) of MqM1 to LOC.MqM2.Q1 (Local Queue) of MqM2>

no more messages
Sample AMQSGET0 end

[root@myhost bin]#

Kindly Like/Follow the page if you like this article.
Request you to post your comments so that I can improve the content.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam