Running the Data Warehouse sample
You can run the
Data Warehouse sample to perform the following processing:
- 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 contents of the sample's database depends on which database product is installed. For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center. If you have not installed a database product, the samples use the Apache Derby database. For instructions on how to view the data in a Derby database see Viewing the contents of a Derby database.
To run the WarehouseData message flow:
- Ensure that the sample message flows and message set have been
deployed.
When you imported the sample there might have been a number of warnings relating to .msgflow files. These are database related and will not affect the running of the sample.
- In the Message Brokers Toolkit, switch to the Broker
Application Development perspective.
- In the Broker Development view, expand the Data Warehouse message flow project, then
double-click Datawarehouse_input_message.mbtest
to open it in the Test Client.
- 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 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 database. Note the time at which the message was stored in the database. You will need to use
this time when running the VerifyDatabaseContents message flow.
Next, run the VerifyDatabaseContents message
flow to count the records in the
database. To do this:
- In the Broker Development view, expand the Data
Warehouse message flow project, then
double-click Datawarehouse_verify_contents_input_message.mbtest to open it in the Test Client.
- In the Message Data portion of the screen specify values for the
start and end date and time of the query. These values should 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 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 one.
- Perform several more archive requests using the WarehouseData
message flow and verify that the
record count in the database continues to increase at the same rate
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 need
to update the value in Datawarehouse_verify_contents_input_message.mbtest.
After you have observed that the archive request was 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