Home > WebSphere Message Broker > Simple Message flow with WebSphere Message Broker

Simple Message flow with WebSphere Message Broker

1. Prerequisite

The following list of software’s are required to start of with Message Broker development,

  • IBM WebSphere MQ.
  • IBM WebSphere Message Broker.
  • IBM WebSphere Message Broker Toolkit.
  • IBM DB2 or any RDBMS.

The Message Broker Toolkit is an application development and administration IDE (Eclipse), the Message broker(Set of application processes) hosts and executes the message flows and the Configuration Manager acts as an interface between the Message Broker Toolkit and the Message Brokers. The configuration manager is responsible for deploying message flows to the brokers and also manages the configurations in an internal repository.

2. Create Configuration Manager

To create a configuration manager Run command prompt and enter the following command,

mqsicreateconfigmgr configMgrName -i serviceUserId -a servicePassword -q queueManagerName [-n db2DatabaseToMigrate  -u migrationDatabaseUserId -p migrationDatabasePassword] [-s unsQMgrName] [-w workPath]

For Example:- mqsicreateconfigmgr SRIConfigMgr -i MQSIUSER -a MQSIPASS -q CMQM

CreateConfigManager

Note:- On Windows platforms, if the Configuration Manager name is omitted ‘ConfigMgr’ will be used.

3. Create Database

From Start Menu Programs select IBM DB2 -> Command Line Tools -> Command Line Processor

create database BK1 – Each broker requires a database for its operation.

CreateDatabase

4. Create Broker

From Administrative Tools -> Data Source (ODBC) -> Create a System DSN -> BK1 (DSN Name), Select IBM DB2 ODBC Driver if you are using DB2.

SystemDSN

mqsicreatebroker brokerName -i serviceUserId -a servicePassword -q queueManager

Name -n dataSourceName [-u dataSourceUserId] [-p dataSourcePassword] [-s unsQMgr

Name [-j]] [-g configurationTimeout] [-k configurationDelayTimeout] [-w workPath

] [-l userLilPath] [-t] [-m] [-v statisticsMajorInterval] [-P httpListenerPort]

[-c icuConverterPath] [-y ldapPrincipal -z ldapCredentials] [-x userExitPath]

For Example:- mqsicreatebroker BK1 -i MQSIUSER -a MQSIPASS -q CMQM -n BK1

CreateBroker

Note:- The queue manager used by configuration manager can be shared with one broker. If the qmgr that you specify on the create command (via -q flag) doesn’t already exist, the command will create one for you. If it does exist, then it will use that qmgr.


5. Start Configuration Manager and Broker

mqsistart SRIConfigMgr -> Configmanger Name

mqsistart BK1 -> Broker Name.

StartConfigManagerAndBroker

Note:- mqsilist command can be used to list the configuration managers and the brokers.

6. Create Queues and Listener

From the Websphere MQ Explorer do the following,

  • Create IN queue[Input Queue] and OUT queue[Output Queue].
  • Create a Listener L1 on port 6667.
  • Right click and Start the Listener.

CreateINAndOUTQueue

CreateAndStartTCPListener

7. Create Message Flow Project

  • Open WebSphere Message Brokers Toolkit and switch to Broker Administration Perspective.
  • OpenBrokerAdminPerspective
  • From the Domains pane right click and select New -> Domain Connection.
  • Enter the Queue Manager Name as CMQM and port as 6667 and click on Next to connect.
  • DomainConnection
  • If connected enter the desired connection name and click on finish.
  • Right click on Broker Topology and select New -> Broker Reference.
  • BrokerTopology
  • Enter the broker name as BK1 and the queue manager name as CMQM and click on Finish.
  • For the question, which type of deploy do you want to perform? select complete. This should create a Broker reference and a default execution group.
  • TypeOfDeployment
  • Switch to Broker Application Development Perspective.
  • ApplicationDevelopment
  • From the File menu select New -> Message Flow Project.
  • MessageFlowProjectMenu
  • Enter the desired project name and click on finish.
  • MessageFlowProject
  • Right click on Flows under the newly created message flow project.
  • MessageFlowProjectMenu
  • Select New -> Message Flow and enter the name as SimpleMessageFlow and click on Finish.
  • NewMessageFlow
  • Create the flow in the designer.
  • DesignMessageFlow
  • Enter the Queue Name for MQInput Node as “IN” and Queue Name for MQOutput Node as “OUT” under properties.
  • Switch to Broker Administration Perspective.
  • BrokerAdminPerspective
  • Right click on Broker Archives and select New -> Message Broker Archive.
  • MessageBrokerArchiveMenu
  • Select the project name and enter the desired name for the archive and click on Finish.
  • MessageBrokerArchive
  • From the Archive configuration select the message flow and click on “Build broker archive” button.
  • BuildBrokerArchive
  • Save and deploy to the broker’s default execution group [Right click on the archive and select deploy File].
  • DeployMenu
  • Right click on the default execution group and select properties and enter the desired JVM Debug Port [9998] and click on Ok.
  • JVMDebugPort
  • Switch to Debug Perspective and click on the Debug icon -> Select Message Boker Debug.
  • Under New_Configuration enter the port as 9998 and click on Select Execution Group and select the execution group and click on ok.
  • Click on Apply and Click on Debug to start debugging.
  • NewConfiguration
  • Put a message in the “IN” queue and the message will flow through the message flow and delivered to the “OUT” queue.

Note:- The JVM Debug Port specified flow engines [Execution group] and the Java debug port specified in the Message Broker Debug config should be same.

mqsichangeproperties <broker-name> -e <execution-group-name>  -o ComIbmJVMManager -n jvmDebugPort -v <port-number>

mqsicreateconfigmgr configMgrName -i serviceUserId -a servicePassword -q queueM
anagerName [-n db2DatabaseToMigrate -u migrationDatabaseUserId -p migrationDatab
asePassword] [-s unsQMgrName] [-w workPath]
Categories: WebSphere Message Broker Tags:
  1. May 22nd, 2011 at 10:12 | #1

    nice post, but version 7 of the product is the current one. It is considerably simpler and has no Configuration Manager, nor does it depend on DB2 or any other database. You’ll be up and running much more quickly!

  2. admin
    May 23rd, 2011 at 11:21 | #2

    Thanks Andy, ya you are right.

  3. suman
    May 31st, 2011 at 12:26 | #3

    Nice Post Sridhar… Good to the freshers

  4. May 31st, 2011 at 16:37 | #4

    Thanks Suman

  5. SATYA DANDI
    September 19th, 2011 at 08:38 | #5

    Nice Post on Websphere Message Broker 6.1.

    Looks like MB 7.x Makes MB ADMIN Life easier By removing Data Base and Configuration Manger.

  6. swaroopa
    November 2nd, 2011 at 11:54 | #6

    thank u

  1. No trackbacks yet.