Saturday, March 12, 2011

Getting Started with WebSphere MQ 7 Broker 7 on Linux

I was interested in evaluating what it was like working with MQ7 and Broker 7, so I setup a Linux VM (CentOS 5, x64). My goal was to run MQ, Broker, and the Toolkit all locally.

Note: Not all of this is perfect or maybe even ideal, its just what I did. CentOS is not a supported distribution for these products. I know more about MQ6 and Broker 6.1 than 7.

Before I Started


  • Installed DB2 Express
  • yum install compat-libstdc++-33 (MQ needs this)


Installing MQ7


  • Download MQ7 Trial and extract it

  • ./mqlicense.sh -accept (after reading it of course)

  • rpm -ivh MQSeriesRuntime-7.0.1-3.x86_64.rpm MQSeriesServer-7.0.1-3.x86_64.rpm

  • rpm -ivh MQSeriesClient-7.0.1-3.x86_64.rpm

  • rpm -ivh MQSeriesSDK-7.0.1-3.x86_64.rpm

  • rpm -ivh MQSeriesJava-7.0.1-3.x86_64.rpm

  • rpm -ivh MQSeriesEclipseSDK33-7.0.1-3.x86_64.rpm

  • Update /opt/mqm/eclipseSDK33/eclipse/eclipse.ini add -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/firefox-3.6

  • rpm -ivh MQSeriesConfig-7.0.1-3.x86_64.rpm

  • usermod -a -G mqm craig (replace craig with your username)

  • usermod -a -G mqm root

  • usermod -a -G mqm mqm (for some reason the mqm user didn't have the group)



Installing Message Broker


  • Download and extract the WMB Trial

  • groupadd mqbrkrs

  • usermod -a -G mqbrkrs craig

  • usermod -a -G mqbrkrs root

  • ./setuplinuxx64 -console

  • Mostly just enter 1s or 0s until complete



Installing WMB Toolkit


  • Download and extract the WMB Toolkit Trial

  • In the IBMInstallationManager directory...

  • ./install -nosplash --launcher.suppressErrors -input mbtoolkit-silent.xml -silent


Create Broker


  • Since I'm going to do things the easy way instead of the right way (I'm doing everything as root instead of running under mqm), need to reboot here

  • . /opt/ibm/mqsi/7.0/bin/mqsiprofile (notice the ". " at start)

  • cd /opt/mqm/bin

  • ./crtmqm -u DLQ ESBBKL

  • ./strmqm ESBBKL

  • ./runmqlsr -m ESBBKL -t TCP &

  • mqsicreatebroker ESBBKLBKR -i craig -a <password> -q ESBBKL

  • mqsichangebroker ESBBKLBKR -i craig -a <password> -P 1414

  • mqsistart ESBBKLBKR

  • mqsichangeproperties ESBBKLBKR -b httplistener -o HTTPListener -n startListener -v true

  • mqsistop ESBBKLBKR

  • mqsistart ESBBKLBKR

  • mqsicreateexecutiongroup ESBBKLBKR -e default



Working in the Toolkit


  • In the Brokers view, connect to remote queue ESBBKL at localhost.localdomain port 1414

I know that ideally I could right click Brokers and create a new local broker instead of doing a lot of the above, but obviously something up there threw it off. Furthermore, you can't use localhost because it tells you to use a local broker.

NOTE: When I went through and did this again to verify I didn't miss any steps, the toolkit already had my local broker in it. You probably won't need to add it, however if it is not in the list, do the above.

Create Local Queues


  • Create file with the following contents

DEFINE QLOCAL ('REQ.MB.TEST_FLOW') +
REPLACE

DEFINE QLOCAL ('RESP.MB.TEST_FLOW') +
REPLACE

DEFINE QLOCAL ('DLQ') +
REPLACE


  • runmqsc ESBBKL < queuedefs.conf


Create flows, more queues, have fun!

Tuesday, March 8, 2011

Local WebSphere Message Broker Install on Windows Domain

After having a lot of difficulty setting up a local WMQ and WMB install on my domain account, here is what I did:

  • Install MQ and its fixpacks

  • Install WMB runtime and its fixpacks

  • Install the Broker Toolkit

  • Created a local Windows user with the same username/password as my domain user

  • Add user to mqbrkrs and mqm groups

  • Install latest DB2 Express

  • Start the broker command console


MQSI 6.1.0.5
C:\IBM\MQSI\6.1
Start broker Command Console

C:\IBM\MQSI\6.1>cd c:\IBM\WMQ\bin

c:\IBM\WMQ\bin>crtmqm.exe -u DLQ ESBBKL
WebSphere MQ queue manager created.
Creating or replacing default objects for ESBBKL.
Default objects statistics : 43 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.

c:\IBM\WMQ\bin>strmqm ESBBKL
WebSphere MQ queue manager 'ESBBKL' starting.
5 log records accessed on queue manager 'ESBBKL' during the log replay phase.
Log replay for queue manager 'ESBBKL' complete.
Transaction manager state recovered for queue manager 'ESBBKL'.
WebSphere MQ queue manager 'ESBBKL' started.

c:\IBM\WMQ\bin>call mqsicreatedb ESBBKLDB -e DB2
BIP9809I: Creating DB2 Database 'ESBBKLDB', this may take a while.
BIP9825I: Creating the ODBC Data Source name 'ESBBKLDB'.
BIP9817I: The DB2 database engine was used to create the 'ESBBKLDB' database.

BIP8071I: Successful command completion.

c:\IBM\WMQ\bin>call mqsicreateconfigmgr ESBBKL_CFGMGR -i <USERNAME> -a <PASSWORD> -q ESBBKL
AMQ8110: WebSphere MQ queue manager already exists.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
BIP8071I: Successful command completion.

c:\IBM\WMQ\bin>call mqsicreatebroker ESBBKLBKR -i <USERNAME> -a <PASSWORD> -q ESBBKL -n ESBBKLDB
AMQ8110: WebSphere MQ queue manager already exis
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
The setmqaut command completed successfully.
BIP8071I: Successful command completion.

c:\IBM\WMQ\bin>call mqsistart ESBBKL_CFGMGR
BIP8096I: Successful command initiation, check the system log to ensure that the component started without problem and that it continues to run without problem.

c:\IBM\WMQ\bin>call mqsistart ESBBKLBKR
BIP8096I: Successful command initiation, check the system log to ensure that the component started without problem and that it continues to run without problem.


  • Open MQ Explorer

  • Create new queue named DLQ in ESBBKL

  • Create new TCP Listener (I used port 1414, the default)

  • In the toolkit, add new Domain Connection to ESBBKL port 1414 on localhost

  • Connect to the new Domain

  • Add new broker reference to the topology, ESBBKLBKR on ESBBKL

  • Enjoy!



Note: if you want to delete and start over, do NOT delete the database first. If you do, call mqsicreatedb again, then use mqsichangebroker and set your username and password again.

The steps I follow to delete are:
  • Start broker command console and cd c:\IBM\WMQ\bin

  • call mqsistop ESBBKLBKR

  • call mqsideletebroker ESBBKLBKR

  • call mqsistop ESBBKL_CFGMGR

  • call mqsideleteconfigmgr -w -q ESBBKL_CFGMGR

  • call mqsideletedb -d DeleteAllDatabases