People who have not worked much on Websphere MQ v7.1 find it tricky to setup queues and security (channels, authorization etc). I too being novice on Websphere MQ took me good time to configure and connect it from Java. Based on my experience mentioning here the steps that I followed to setup the things right on MQ and I found it easy as well.
If everything is set correctly you will see a java program able to produce and consume a message to MQ. Please contact me in case you need document/java program.
- Install Websphere MQ v7.1 on linux. This will create a new linux user and group named 'mqm'.
- Since MQ does not allow the users belonging to admin (mqm) group to connect to queues so lets also create linux user say 'mquser' and assign it to mqm group.
- MQ requires you to first create a queue manager before queue. MQExplorer is eclipse based client program to administer MQ and a good UI based option for novice. So first create a queue manager say - "DefaultQM" with default parameters like port etc.
- Next create one local queue say "FirstQ" that will be your first queue using explorer.
- A server connection channel is required to establish connection to server and access queues. This also can be created by explorer under IBM Websphere MQ > Queue Managers > [DefaultQM] > Channels.
- Create a new channel authentication records as shown in the document MQChlAuthCreation.doc.
- You will see a default channel authentication record that blocks all the MQADMIN users. Override this by executing the following command
SET CHLAUTH('<server connection channel>') TYPE(BLOCKUSER) USERLIST('nobody') - more details can be found here. This command actually set unlock all users to establish connection to MQ. Though its not a recommended setting but it works for learning and r&d purpose.
- Next write a java program to send and receive messages to/from MQ. This is easily available on many developer portal like this one - java program.
If everything is set correctly you will see a java program able to produce and consume a message to MQ. Please contact me in case you need document/java program.
No comments:
Post a Comment