Thursday, May 13, 2010

WMB - Detailed steps - Deploy application using external(MS SQL server 2005 express) database


Prerequisites - the following software must be installed on the windows XP

Websphere MQ V6
Websphere Message Broker Toolkit V6.1
Microsoft SQL Server 2005 Express


Let us deploy a message flow application in the Websphere Message Broker toolkit with the database Microsoft SQL Server Express 2005 on Windows XP. To achieve this purpose, we need to have

1. A Database named "ROHINIDB" to store the Broker configuration (repository).
2. A Database user "rohini" for the database
3. Datasource named "ROHINIDBDS" for the database ROHINIDB.
4. Queue Manager "ROHINIBKR_QMGR" for the Broker
5. Queue Manager "ROHINICFGMGR_QMGR" for the configuration Manager
6. Broker "ROHINIBKR"
7. Configuration Manager "ROHINICFGMGR"


1. Creating "ROHINIDB"

Programs -> Microsoft SQL Server 2005 -> SQL Server Management Studio Express
Login with the userid/password authorised to create the database

Creating a database by name ROHINIDB
If you observe there are no tables that are populated under this database.

2. Creating user "rohini"

Create a user(rohini) for the ROHINIDB
right click on Login -> new login and provide the name(rohini) for the database(ROHINIDB).

Now it's time to configure the most important part, the driver for using the database ROHINIDB on Microsoft SQL Server 2005 Express. The supported driver in this case is "SQL Native Client"

3. Creating Data source "ROHINIDS"

Goto Administrative Tools -> Data sources -> System DSN -> click "add" and select the driver to setup a data source for.
Provide the data source name
SQL Server you want to connect(In this case "hostname\SQLEXPRESS")
select the default database you want to use (In this case "ROHINIDB")
the authenticity of the database is checked
the connection to the database can be tested from the same wizard


4. Create Queue managers for Broker

crtmqm ROHINIBKR_QMGR

WebSphere MQ queue manager created.
Creating or replacing default objects for ROHINIBKR_QMGR.
Default objects statistics : 43 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.


C:\Documents and Settings\skamani>dspmq

QMNAME(ROHINIBKR_QMGR) STATUS(Ended immediate
ly)
QMNAME(WBRK61_DEFAULT_QUEUE_MANAGER) STATUS(Quiescing)
QMNAME(WMB61_QUEUE_MANAGER) STATUS(Quiescing)

C:\Documents and Settings\skamani>strmqm ROHINIBKR_QMGR

WebSphere MQ queue manager 'ROHINIBKR_QMGR' starting.
5 log records accessed on queue manager 'ROHINIBKR_QMGR' during the log replay p
hase.
Log replay for queue manager 'ROHINIBKR_QMGR' complete.
Transaction manager state recovered for queue manager 'ROHINIBKR_QMGR'.
WebSphere MQ queue manager 'ROHINIBKR_QMGR' started.



5. Create Queue managers for Configuration Manager

C:\Documents and Settings\skamani>crtmqm ROHINICFGMGR_QMGR

WebSphere MQ queue manager created.
Creating or replacing default objects for ROHINICFGMGR_QMGR.
Default objects statistics : 43 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.

C:\Documents and Settings\skamani>strmqm ROHINICFGMGR_QMGR

WebSphere MQ queue manager 'ROHINICFGMGR_QMGR' starting.
5 log records accessed on queue manager 'ROHINICFGMGR_QMGR' during the log repla
y phase.
Log replay for queue manager 'ROHINICFGMGR_QMGR' complete.
Transaction manager state recovered for queue manager 'ROHINICFGMGR_QMGR'.
WebSphere MQ queue manager 'ROHINICFGMGR_QMGR' started.


The queue managers have been created and started. However, the queues for communication need to be created for testing the message flow application(firstFlow.msgflow) given as an example for setting up the default configuration.


Create the following objects under the ROHINIBKR_QMGR

Queues
  • BKRTQ - Transmit queue
  • VIC_INPUT
  • VIC_OUTPUT

Channels
  • BKR_TO_CFG - SENDER (SDR)
  • CFG_TO_BKR - RECEIVER(RCVR)

Listener
  • create your own listener or use the SYSTEM.DEFAULT.LISTENER.TCP. For this example change the control parameter to QMGR and port at 2222.

Create the following objects under the ROHINICFGMGR_QMGR

Queues
  • CFGTQ - Transmit queue

Channels
  • BKR_TO_CFG - RECEIVER(RCVR)
  • CFG_TO_BKR - SENDER(SDR)

Listener

  • create your own listener or use the SYSTEM.DEFAULT.LISTENER.TCP. For this example change the control parameter to QMGR and port at 3333.

6. Creating the Broker


Now start the WMB Command console.
start -> programs -> Message Broker 6.1 -> command console

Create the Queue Managers for Configuration Manager, Broker and Database through the MQ explorer or through MQSC commands. The queue managers used in these commands, if not created before executing these commands, it creates the queue managers with the names specified in the command to create the Broker and config Mgr.

ROHINICFGMGR_QMGR - Queue manager for Configuration Manager
ROHINIBRK_QMGR - Queue manager for Broker

7. Create a Configuration Manager

Configuration manager(ROHINICFGMGR)

C:\IBMWMQ\WMB\bin>mqsicreateconfigmgr.exe ROHINICFGMGR -i mqadmin -a pass1234 -q ROHINICFGMGR_QMGR

AMQ8110: WebSphere MQ queue manager already exists.
WebSphere MQ queue manager running.
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:\IBMWMQ\WMB\bin>mqsicreatebroker.exe ROHINIBKR -i mqadmin -a pass1234 -q ROHINIBKR_QMGR -n ROHINIDBDS -u rohini -p pass1234

AMQ8110: WebSphere MQ queue manager already exists.
WebSphere MQ queue manager running.
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.
The setmqaut command completed successfully.
BIP8071I: Successful command completion.

C:\IBMWMQ\WMB\bin>mqsistart ROHINICFGMGR

WebSphere MQ queue manager running.
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:\IBMWMQ\WMB\bin>mqsistart ROHINIBKR

WebSphere MQ queue manager running.
BIP8096I: Successful command initiation, check the system log to ensure that the
component started without problem and that it continues to run without problem.


=========================================================
Now that the environment is ready, we can start deploying applications or message flows on to the broker. Open the Websphere Message broker toolkit v6.1 and perform the following steps
=========================================================

1. select the workspace and go to the Broker administration perspective
2. Create a new domain connection by right clik on the DOMAIN CONNECTION.
3. Provide the cfg manager queue name and port number and click next
4. Provide the project name(RohiniProject) and connection name(Domain connection name --- RohiniDomain)
5. You can develop a sample application through the broker development perspective
6.
5.

No comments:

Post a Comment