Responding to database updates
Implement a message flow that responds to database updates, and presents the data to another application.
Before you begin
- 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 IBM® Integration Bus runtime component to connect to the database; see Enabling ODBC connections to the databases.
If you use IBM 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.
About this task
IBM Integration Bus 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 IBM Integration Bus details
of your database event store and data table.
Procedure
- 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.
Procedure
- 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.
Results
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.
Procedure
Test the flow
Use the debugger to test the flow.
Procedure
- 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 IBM Integration Toolkit. Under Data Source Explorer, right-click the table and choose .
- Use the debugger to check that the flow is working correctly.