WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Responding to database updates
Implement a message flow that responds to database updates, and presents the data to another application.
Before you start:
- Create an event table (a database table that serves as a transient store for event data).
- Create a trigger on the application data table. The trigger inserts a row into the event store whenever the application data is changed.
- Configure the broker runtime to connect to the database; see Enabling ODBC connections to the databases.
For information about event tables and triggers, see the DatabaseInput Node sample. You can view information about samples only when you use the information center that is integrated with the WebSphere® Message Broker Toolkit or the online information center. You can run samples only when you use the information center that is integrated with the WebSphere Message Broker Toolkit.
If you use DB2® on z/OS®, your user ID (or your user
group) requires permission to perform a SELECT on SYSIBM.SYSJAROBJECTS.
You do not need experience of ESQL to complete this task.
Scenario: A retail company uses a relational database
to manage its stock inventory. Since a recent acquisition, a new set
of applications based on XML and WebSphere MQ are
added to the environment. The applications notify interested parties
of any changes to the stock levels. The applications have a predefined
XSD schema model that describes the input message.

WebSphere Message
Broker is used to respond to database
updates, and to notify the WebSphere MQ application
of these changes.
- A DatabaseInput node retrieves the data.
- A transformation node, such as a Compute node or a Mapping node, transforms the data to the target format.
- An output or request node, such as an MQOutput node, sends the transformed message to the target system.
You will complete the following actions:
Discover the database model
Create a .dbm file that you will use
to create the message model. You create a data design project, and
use a wizard to give WebSphere Message
Broker details
of your database event store and data table.
- Click .
- Click New to create a new data design project, or select an existing data design project from the drop down list.
- Select the appropriate database type and version, and then click Next.
- Select an existing JDBC connection, or create a connection to your database. If you create a connection, test the connection.
- Select the database schema that you will use to create the message definition.
- Select the database elements that you need for the model. You require Tables and Triggers. The data model is created, and you can see details of the database tables that are described in the chosen schema.
Create a new message model for the database input
Create a new message schema model file from the
discovered data definition if you require a model of the data structure
that the database input will present. You need a model if you want
to graphically map this input. The model also enables content assistance
auto-completion of paths in the ESQL editor if you are transforming
the data in ESQL.
- Click
- In the Other section, select Database record, and then click Next.
- Select Create an XML schema file from a database definition, and then click Next.
- Navigate to and select the Database definition .dbm file that you created during discovery, and then click Next.
- Ensure that the database tables that will be used are selected.
- Click Next and then Finish.
The New Message model wizard creates an XML schema message
model file in your selected location.
Create the message flow
Create and configure a flow that consists of
a DatabaseInput node, a Mapping node, and an MQOutput node.
You
will use the schema file that describes the input message to create
a message definition file.
Test the flow
Use the debugger to test the flow.
- Start the debugger, and then add breakpoints to the flow.
- Deploy the flow.
- Change the data source, for example by adding a new row. You can change data from within the WebSphere Message Broker Toolkit. Under Data Source Explorer, right-click the table and choose .
- Use the debugger, and WebSphere Message Broker Explorer, to check that the flow is working correctly.