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
- 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.
Discover the database model
- 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
- 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.
Create the message flow
- Create an integration project that references both the data design project, and the message set project, that you created earlier.
- Create a message flow, and drag a DatabaseInput node onto the canvas.
- Configure the node as follows:
- Set the Data source to the ODBC connection that you created earlier.
- Follow the instructions in Configuring a DatabaseInput node to configure the ESQL procedures to provide details of the event store and application data.
- To enable graphical mapping from the database data to the output message format, in addition to Creating the new message model for the database input as above, you also require a message model for the target message. This can be a DFDL or XML schema message model as appropriate to your scenario.
- Drag a Mapping node
onto the flow, and configure it.
You can use other methods to transform the message; see Transforming and enriching messages.
- Set the map source to the message that you defined in Create a new message model for the database input.
- Set the map target to the TARGET message that you just defined.
- Drag an MQOutput node onto the canvas, and set the queue manager name and queue name.
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 IBM Integration Toolkit. Under Data Source Explorer, right-click the table and choose .
- Use the debugger to check that the flow is working correctly.