Running the Data Warehouse sample
You can run the
Data Warehouse sample to perform the following processes:
- Read a WebSphere MQ message with a payload in XML format
- Convert all of the incoming message payload into a BLOB and insert it into
a database
- Format a confirmation message
- Write a WebSphere MQ message confirming insertion of the message
into the database
- Verify the number of records that have been inserted into the
database
How you view the sample database contents depends on which database product is installed.
For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center.
If you encounter any problems when you run the sample,
see Resolving problems when running samples
in the WebSphere Message Broker documentation.
Note. If an error arises during the database processing, a message is formatted in the
Create_Error_Message Compute node and written out in the Data_Warehouse_Failure_Q MQOutput
node as a WebSphere MQ message.
To run the WarehouseData message flow:
- Ensure that the sample message flows and message set are
deployed.
When you import the sample, a number of warnings might be issued relating to
.msgflow files.
These warnings are database related and do not affect the running of the sample.
- In the Broker Development view, expand the
Data Warehouse message flow project and, under
Flow Tests, double-click Datawarehouse_input_message.mbtest
to open it in the Test Client.
- In the Test Client, click Enqueue.
- Click Send Message to place a
WebSphere MQ message on the input queue of the WarehouseData message
flow.
-
In the Test Client, click Dequeue.
- Click the first Get Message to read a
message from the DATAWAREHOUSE_OUT_Q queue.
- View the contents of the message that is retrieved and
verify that a message was stored in the DATAWAREHOUSE table in the USERDB database.
Take a note of the time at which the message was stored in the database. You must use
this time when you are running the VerifyDatabaseContents message flow.
Run the VerifyDatabaseContents message
flow to count the records in the
database by completing the following steps:
- In the Broker Development view, expand the Data Warehouse message flow
project and, under Flow Tests, double-click
Datawarehouse_verify_contents_input_message.mbtest
to open it in the Test Client.
- In the Test Client, click Enqueue.
- In the Message Data portion of the screen, specify values for the
start date, end date, and time of the query.
You must select appropriate values to enter.
These values must be either side of the time at which the
database insert took place when you ran the WarehouseData message flow.
The time of the insert is reported in the message, which is written to DATAWAREHOUSE_OUT_Q.
- Click Send Message to place a
WebSphere MQ message on the input queue of the VerifyDatabaseContents
message flow.
- In the Test Client, click the first Dequeue.
- Click Get Message to read a
message from the DATAWAREHOUSE_VERIFY_CONTENTS_OUT_Q
- Verify that the count of records in the database is 1.
- Perform several more archive requests by using the WarehouseData
message flow, and verify that the
record count in the database continues to increase at the same rate by
using the VerifyDatabaseContents message flow to obtain the
count of the number of records in the database. Dependent on the
value of the end time that you initially specified, you might have
to update the value in
Datawarehouse_verify_contents_input_message.mbtest.
After you have observed that the archive request has completed
successfully, and that the count of records in the database corresponds
with the number of archives issued, you have successfully run the Data
Warehouse sample.
Back to sample home