You might be familiar with graphical data maps. WebSphere Message Broker Version 8.0 introduces graphical data maps. These message maps replace the previous message map format, and are created as .map files. Message maps offer the ability to transform a message without the need to write code, providing a visual image of the transformation, and simplifying its implementation and ongoing maintenance. WebSphere Message Broker Version 8.0 also introduces the Select transform that allows you to enrich a message by accessing data located in an external database system. This new feature simplifies the programming model. It eliminates the requirement to use a Database node, a JavaCompute node, a .NETCompute node, or a Compute node to access data located in a database. You can design simpler message flows by using a single Mapping node to complete graphically a message transformation that requires data from an external database system.
Note: If you migrate from an earlier version of WebSphere Message Broker Version 8.0, you can continue using your legacy maps. However, if you need to modify any of your legacy maps, or if you want to use the Select transform, you must convert these legacy message maps into .map message maps.
You can use a message map to enhance an existing message with data from one or more database tables. Data from the database can then be used to enrich, route,and transform messages within WebSphere Message Broker.
In WebSphere Message Broker, to connect to a database, you must configure the development environment and the WebSphere Message Broker runtime environment:
1. To have visibility of the database resources during the development phase, you must connect the WebSphere Message Broker Toolkit to the development database.
2. To enable the deployed map to execute in the run time, you must create a JDBC provider configurable service that defines the connection to the runtime database. This database is normally a different database server from the one you use for development, and the artifacts could be in a different database schema.
To configure the WebSphere Message Broker Toolkit to connect to a database, you must create a database definition file in a data design project, and configure a database connection.
Data design project: A specialized type of project where you store your database resources.
Database definition file: A configuration file where you specify the database physical details such as database type and version, and a connection.
Database connection: Configuration that details the database resources, that is,the schema, the tables, the store procedures, the indexes, and other resources, that you need access to from within your WebSphere Message Broker project resources.
To access information stored in a database from resources in a WebSphere Message Broker project, you must include a reference to the data design project in your application, service, or Message Broker project.
In WebSphere Message Broker, you can use a message map to access information in a database, and then use this information to perform transformations on the message or to enrich a message.
During the design phase, you must complete the following steps in the WebSphere Message Broker Toolkit to access graphically database information in a message map:
1. Add a reference to each database table from where you must retrieve data.
2. Use a Select transform to define how to use the database information in the message map. The Select transform has embedded a nested map. You must define the transforms in this nested map.
3. Use a Failure transform to handle database failures. The Failure transform has embedded a nested map. You can define the transforms in this nested map if you wish to provide specialized handling of any database exceptions that are hit running the generated SQL statements when the map executes. If you take the default of not adding a Failure transform, WebSphere Message Broker will handle the error, reporting it to the system log, and then rolling back the current message transaction.
To configure the WebSphere Message Broker run time to connect to a database, you must establish a connection with the database to fulfill the operations that are performed by the Mapping node. You must define a JDBC provider configurable service.
Use the scenario Using a message map to enrich a message with data from a database to learn how to use a Mapping node to connect to a database, retrieve data from multiple tables, and graphically populate elements in a SOAP message with this information in the WebSphere Message Broker/IBM Integration Bus Toolkit. Learn how to handle an SQL exception and learn how to configure the JDBC provider configurable service of the database.