Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Deploying a complex flow to WebSphere Business Integration Message Broker

Hamzeh Zawawy (hzawawy@ca.ibm.com), IBM Software Group, Canada
Hamzeh Zawawy is a software engineer at the IBM Toronto Lab, Ontario, Canada. He is the lead developer of the Broker Archive and RAD components of the WebSphere Business Integration Message Broker.
Ross McKegney (mckegne@ca.ibm.com), IBM Software Group, Canada
Ross McKegney is a software engineer at the IBM Toronto Lab, Ontario, Canada. He is the lead developer of the Member Management component of WebSphere Commerce.
Alek Seelemann (seeleman@ca.ibm.com), IBM Software Group, Canada
Alek Seelemann is the technical lead for the WebSphere Business Integration Message Broker V5 tools. He has been at the IBM Toronto Lab, Ontario, Canada since 1995.
Andrew Lau (akmlau@ca.ibm.com), IBM Software Group, Canada
Andrew Lau is a software developer on the WebSphere Business Integration Message Broker Toolkit team. He is also completing his BSc degree in Computing Science at the University of Alberta, Canada.

Summary:  This article describes a case study using WebSphere Business Integration Message Broker to automate the creation of a configurable broker archive (BAR) file. It starts with a set of previously defined message flows for an airline reservation system.

Date:  28 Apr 2004
Level:  Intermediate

Activity:  3581 views
Comments:  

Introduction

This article describes a case study using IBM® WebSphere® Business Integration Message Broker V5 (hereafter called WebSphere Message Broker) to automate the creation of a configurable broker archive file. It starts with a set of previously defined message flows for an airline reservation system. It then describes how to use promotion and configurability to make the flow more reusable, how to use scripts to add these flows to a broker archive file, how to deploy them in a set of execution groups. Throughout, it recommends best practices and provides reusable scripts.


Case study: Airline reservation system

The following lists the process for developing a message flow application with WebSphere Message Broker:

  1. Create a conceptual model of the system.
  2. Instantiate this model as a set of flows containing nodes and messages in the WebSphere Message Broker tool.
  3. Create a deployable broker archive (BAR) file.
  4. Configure and deploy the BAR file to a test environment.
  5. Configure and deploy the deployable artifact to a production system.

The case study is an airline reservation system. Assume that the first four steps in the process outlined above have been completed. The focus is on the configuration and deployment of a BAR file.

The airline sample is based on a scenario of an airline booking system, like those used by travel agencies. It demonstrates how to use some of the features provided by WebSphere Message Broker for Multi-platforms V5.0. You can run the airline sample to simulate the following tasks:

  • Reserve seats on a flight.
  • Request information about a passenger.
  • Request information about a specific flight and its passenger list.
  • Cancel a reservation.

Flows are designed to implement the airline reservation system features. Nodes with suitable functions are selected. Every flow contains at least one input node, whose characteristic have been defined. Other nodes, such as Compute, are chosen to determine the path that a message follows based on the content of the messages, to provide checks or examination of the message, or to update and query databases. Output nodes are also used to direct certain messages to different nodes and queue.

Flows in the airline sample

This article uses the XML version of the airline sample, which includes seven individual message flows and six self-defining XML input messages, which are supplied so that you can test the message flows. These flows handle functions such as reserving seats, updating reservation databases, and requesting information about reservations, flights, and passengers. The messages that run through these flows are generic self-defining XML in nature. The necessary queues and databases are created using scripts provided in the WebSphere Message Broker online help. For more information on flows and messages, see the WebSphere Message Broker online help.


Configuring and promoting the flow

Configurable properties provide a mechanism for system object names (such as database connections, or the name of an MQSeries queue) to be configured without recompiling a flow application. The configurability feature is empowered by another feature, the property promotion. Property promotion is an existing feature of flow programming that exists independent of the configurability feature. The promotion feature allows the flow developer to specify that several properties are set by a single promoted property. This way, a property that is identified as configurable is promoted so it is set together with other attributes. The value of a promoted configurable property is set only on the promoted instance. This is because a flow designer uses promotion to control the setting of a property value in a hierarchical composition. Setting the value of the original definition of a configurable property and bypassing the property promotion model means that configurability could undermine the flow developer€™s intent. When a configurable property is promoted, its configurability is not lost with the promotion. The promoted property is also configurable.

Promoted properties are configurable if their original definition specifies they are configurable. This means that when a configurable property is promoted, it continues to be configurable. To do this, the configurable status of a Promoted Property is computed as the inclusive OR of the configurable status of all the attributes promoted to the promoted property. If a configurable and a not-configurable property are promoted to the same promoted property, both values are configurable together. An example of a promotion of a property is shown in Figure 1.


Figure 1. Promoting data source property to upper level flow
Promoting data source property to upper level flow

The concept of configurable properties is powerful since it allows last minute modification of system objects. It means you can package a BAR file once, test it on a development machine using one set of parameter values, and then deploy it to the production environment using another, without recompiling. If you want to redeploy the same BAR file to multiple production environments, change the configurable parameters as required, without the need to go back to a development environment.

Using configurability and promotion

In the airline reservation system, the configurable properties are the dataSource property of the Compute node and the queueManagerName of the MQOutput node. The dataSource property is the system name of a database connection. In Microsoft® Windows®, it is the name of an ODBC connection. The queueManagerName represents the name of the MQSeries queue manager associated with the broker, and queues of interest. Because this property is the name of a system object, the development team and the administrators can specify the value of these properties in the deployment descriptor during a publish operation. Further, each developer can configure their workspace to provide their own overrides that are correct within their developer sandbox.

Promoting attributes

In the XML_BuildReplyMessage message flow, the dataSource property of the "Build Single Message", and "Propagate Multiple Messages" Compute nodes, and the "Multiple Or Single Message?" Filter node are promoted to the same BuildReplyMessage_dataSource node. This same dataSource property is promoted again in the XML_Reservation message flow, along with the dataSource properties of the "Update Passenger table" Compute node and "Update Flight Table" Database Node. Figure 2 shows the XML_Reservation flow using the WebSphere Message Broker message flow editor.


Figure 2. XML_Reservation flow
XML_Reservation flow

Deploying the flow application

At the XML_Reservation flow level, the dataSource attribute is set to RESERVDB, the name of the DB2 ODBC connection that is already established. Similarly, the queueManagerName properties of the "XML_RESERVATION_OUT" and "XML_RESERVATION_FAIL" MQOutput nodes are promoted to the same queueManagerName attribute at the XML_Reservation flow, and set to QM_myMachineName. The promotion process was done using the Property promotion dialog as shown in Figure 3.


Figure 3. Property promotion dialog
Property promotion dialog

Deployment

You develop a flow application using nested flows, property promotion, and configurable properties. The flow application is developed by a team that uses configurable properties to customize the application for their development sandbox. Once the flow application is fully developed, it is redeployed; first to system test, then to production.

Deploying using scripts

You can build the BAR file using the command line tool, mqsibar. You can use scripts to create this BAR file. You can use the provided sample scripts to create and deploy a BAR file. The first sample script called setProperties.bat sets environment variables used by the second sample scripts called createBar.bat. The last script, deployBar.bat, deploys the BAR file to the desired broker.

In Listing 1, the setProperties.bat file sets up the environment variables required by the createBar.bat script. In this example, you are setting the home directory for the WebSphere Message Broker tool, the installation directory, the name of the BAR file to create, and the flows to add to the BAR file.


Listing 1. setProperties.bat script file
rem Properties for Command Line WBIMB execution

set WBIMB_HOME=C:\Progra~1\IBM\WebSph~1
set WORKSPACE=%WBIMB_HOME%\eclipse\workspace
set BARNAME=C:\temp\deployable.bar
set BARFILES=airlin~1\XML_BuildReplyMessage.msgflow airlin~1\XML_CancelReservation.msgflow 
airlin~1\XML_FlightQueryIn.msgflow airlin~1\XML_FlightQueryOut.msgflow 
airlin~1\XML_FlightQueryReply.msgflow 
airlin~1\XML_PassengerQuery.msgflow airlin~1\XML_Reservation.msgflow

In Listing 2, the batch file invokes the setProperties.bat file to setup the required environment variables, then invokes the mqsicreatebar executable to create the BAR file.


Listing 2. createBar.bat script file
@ECHO OFF

rem Broker Archive (bar) file command line creation

SETLOCAL
rem Set the configurable properties for this creation
CALL  setProperties.bat

ECHO.
ECHO Broker Archive Command Line Creation
ECHO --------------------------------------------------
ECHO WBIMB home=%WBIMB_HOME%
ECHO.
ECHO WORKSPACE=%WORKSPACE%
ECHO BARNAME=%BARNAME%
ECHO FILES=%BARFILES%
ECHO ---------------------------------------------------

"%WBIMB_HOME%\eclipse\mqsicreatebar.exe" -data %WORKSPACE% -b %BARNAME% -o %BARFILES%

ENDLOCAL

Finally, you can deploy the newly created BAR file from the command line, using the mqsideploy.bat script provided by the installation in the bin directory. A sample script using mqsideploy.bat can automate the process of deploying a known set of BAR files. The script specifies which broker to deploy to, using a specific execution group and configuration manager properties file. The script calls setProperties.bat again to get the name of the BAR file to deploy, and then calls mqsideploy.bat to attempt to deploy the BAR file as shown in Listing 3.


Listing 3. deployBar.bat script file
@echo off

setlocal
rem Properties for Bar deployment

call  setProperties.bat
set BROKER=WBRK_BROKER
set EXECGRP=exec2
set CFGFILE=%WORKSPACE%\test\WBRK_QM.configmgr
set BACK=%cd%

echo --------------------------------------------------
echo Broker Archive Deployment
echo BROKER = %BROKER%
echo EXECUTION GROUP = %EXECGRP%
echo BAR FILE = %BARNAME%
echo CONFIG FILE = %CFGFILE%
echo CURRENT DIR = %cd%
echo --------------------------------------------------

cd %WBIMB_HOME%\bin
"mqsideploy.bat" -b %BROKER% -e %EXECGRP% -bar %BARNAME% -connection %CFGFILE%
cd %BACK%
 endlocal


Versioning of flows within BAR files

Passing the flows to the system administrator for deployment in the system, then having a way to define the version number for the flows included in the BAR file, and even for the BAR file itself, is useful. WebSphere Message Broker does not include direct support for versioning, since each development organization uses its own scheme, most likely tied to the version control software used internally. However, by using the scripts provided with this article, you can assign version numbers to both the flows and the BAR file.

The recommended approach is to append the source control version number to the flow name when adding it to the BAR file. You can automate this process using the -v option provided by the mqsibar utility. Every time a new version of a message flow or message set is added to the BAR file, the name of the recently added file appends with "_" (underscore) and the version number. Next time, when the newer copy of the file is compiled and added to the broker archive file, the version number is replaced by the new value.

You can do another layer of versioning by appending version numbers to the name of the BAR file. Using the option -b (to specify the BAR file name), you can modify the target BAR file name and append a version number to it. The BAR file is uniquely identified based on the version numbers of the constituent flows, but this additional layer is still useful when delivering BAR files between development and deployment teams.


Conclusion

Using scripts to configure and build BAR files is an efficient approach that you can easily implement. By using these scripts, you can build BAR files efficiently and quickly move from one configuration to another by simply changing a parameter in the command line. In addition, you can version these BAR files and avoid losing historical information. This method avoids using a slow user interface and unnecessary typos.



Download

NameSizeDownload method
sample_files.zip4 KBFTP|HTTP

Information about download methods


Resources

About the authors

Hamzeh Zawawy is a software engineer at the IBM Toronto Lab, Ontario, Canada. He is the lead developer of the Broker Archive and RAD components of the WebSphere Business Integration Message Broker.

Ross McKegney is a software engineer at the IBM Toronto Lab, Ontario, Canada. He is the lead developer of the Member Management component of WebSphere Commerce.

Alek Seelemann is the technical lead for the WebSphere Business Integration Message Broker V5 tools. He has been at the IBM Toronto Lab, Ontario, Canada since 1995.

Andrew Lau is a software developer on the WebSphere Business Integration Message Broker Toolkit team. He is also completing his BSc degree in Computing Science at the University of Alberta, Canada.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=14640
ArticleTitle=Deploying a complex flow to WebSphere Business Integration Message Broker
publish-date=04282004
author1-email=hzawawy@ca.ibm.com
author1-email-cc=
author2-email=mckegne@ca.ibm.com
author2-email-cc=
author3-email=seeleman@ca.ibm.com
author3-email-cc=
author4-email=akmlau@ca.ibm.com
author4-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers