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 may have been a number of warnings relating to .msgflow files. These are database related and will not affect the running of the sample.
- Double click Datawarehouse_input_message.enqueue
in the message flow project into which the sample was imported.
- Review the values for Queue manager name and Queue name on the
General tab. When using the default queue manager and Message
Broker configuration there is no need to change the values.
- Click Write to queue to place a
WebSphere MQ message on the input queue of the WarehouseData message
flow.
- Start an instance of the Dequeue application:
- On the workbench toolbar, click the arrow on the Get a message from a Queue icon
.
- On the drop-down menu, click Get
Message to open the Dequeue Message
window.
- Enter the names for the queue manager and queue that you
want. Use values of WBRK6_DEFAULT_QUEUE_MANAGER
for the queue manager name and DATAWAREHOUSE_OUT_Q
for the queue name to work with the default configuration.
- Click Read From Queue to read a
message from the queue.
- After closing the window, the next time that you click the
arrow on the Get a message from a Queue
icon
,
you will see the dequeue configuration that you created above listed on
the drop-down menu. Click this file on the menu (or if it is number 1
on the menu, just click the icon itself) to get a message from the
queue.
- Optional: While the Dequeue
Message window is open, you can save a read message into a file
in your message flow project to keep it for later. Click Save As, and in the Save
Message As window, select the flow
project and enter a name for the file.
- 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.
- Start another instance of the Dequeue application (same process
as for step 5 above).
- Use values of WBRK6_DEFAULT_QUEUE_MANAGER
for the queue manager name and DATAWAREHOUSE_FAILURE_Q
for the queue name to work with the default configuration.
- Click Read From Queue to read a
message from the queue.
- Verify that no message was retrieved . This instance of the
Dequeue application is reading any error messages for the database
insert. There should not be any.
At this point the WarehouseData message flow has been successfully
run. The next step is to run the VerifyDatabaseContents message
flow to count the records in the
database. To do this:
- Double click Datawarehouse_verify_contents_input_message.enqueue
in the message flow project into which the sample was imported.
- Review the values for Queue manager name and Queue name on the
General tab. When using the default queue manager and Message
Broker configuration there is no need to change the values.
- 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 Write to queue to place a
WebSphere MQ message on the input queue of the VerifyDatabaseContents
message flow.
- Start another instance of the Dequeue application:
- Use values of WBRK6_DEFAULT_QUEUE_MANAGER
for the queue manager name and DATAWAREHOUSE_VERIFY_CONTENTS_OUT_Q
for the queue name to work with the default configuration.
- Click Read From Queue to read a
message from the queue.
- 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 may need
to update the value in the file
Datawarehouse_verify_contents_input_message.enqueue
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