Running the Batch Processing sample
Before you can run the sample you must have completed the set up steps,
see Setting up the Batch Processing sample,
and imported and deployed the sample, see Batch Processing sample.
Note:
- If you do not complete the set up steps first, the sample will fail to
initialize correctly and the files will not be read.
- The FileInput nodes poll the input directory every 5 seconds,
therefore, if you type quickly, the expected output might not be visible.
Refreshing the directory list 5 seconds later shows the correct result.
If you encounter any problems when you run the sample,
see Resolving problems when running samples
in the WebSphere Message Broker documentation.
To run the sample:
- Stop the message flow. Use the following instructions to stop the
FileBatchProcessingSample_HOffice message flow and the FileBatchProcessingSample_Branch message flow:
- In the WebSphere Message Broker Toolkit, switch to the Brokers view.
- Right-click the deployed message flow, FileBatchProcessingSample_HOffice, click
Stop.
The message flow indicates that the message flow has stopped.
- Repeat the previous steps for FileBatchProcessingSample_Branch message flow.
- Copy the file from the Southampton branch to the branch_out
subdirectory:
- Save the contents of the southampton_branch.txt file
as a file called southampton_branch.txt in
the branch_out subdirectory
that you created when you set up the sample.
The file contains the following data:
Southampton postage parcel 23 letter 56
- Restart the FileBatchProcessingSample_Branch message flow, the content of the
southampton_branch.txt input file is transferred to
the mqsitransit subdirectory
in c:\MQSIFileInput\hoffice_in or
/tmp/MQSIFileInput/hoffice_in.
Look at the hoffice_in directory or the mqsitransit
subdirectory and check the contents of the hoffice_in.txt file.
This file contains the Southampton postage details from
the input file.
- Look at the branch_out subdirectory.
The southampton_branch.txt file
is no longer in the directory, because in the FILE_BRANCH FileInput node
the Action on successful processing
property is set to Delete.
-
Copy the file from the Winchester branch to the branch_out subdirectory:
- Save the contents of the winchester_branch.txt
file as a file called winchester_branch.txt
in the branch_out subdirectory that
you created when you set up the sample.
Note:
Because the message flow is running, the file
is picked up and deleted almost immediately, so you might not see it in the
branch_out subdirectory.
- Look at the mqsitransit
subdirectory and look at the contents of the hoffice_in.txt file.
The contents of the winchester_branch.txt file
are appended to the hoffice_in.txt file.
- Copy the file from the Portsmouth branch
to the branch_out subdirectory:
- Save the contents of the portsmouth_branch.txt file
as a file called portsmouth_branch.txt in
the branch_out subdirectory that you
created when you set up the sample.
Note:
Because the message flow is running, the file
is picked up and deleted almost immediately, so you might not see it in the
branch_out subdirectory.
- Look at the mqsitransit subdirectory.
This directory is empty because this file was the third record received. The Compute node sends
an End of Data message to the FileOutput node. The End of Data message closes the file and
moves it to the output directory specified in the FileOutput node,
c:\MQSIFileInput\hoffice_in
or /tmp/MQSIFileInput/hoffice_in.
- Look at the hoffice_in.txt file in the
hoffice_in subdirectory.
This file contains the postage data from each branch:
Southampton postage parcel 23 letter 56
Winchester postage parcel 27 letter 30
Portsmouth postage parcel 12 letter 84
- Start the FileBatchProcessingSample_HOffice
message flow to transfer
the file from the head office input directory to the head office output
directory:
-
In the Brokers view, right-click the deployed message flow, FileBatchProcessingSample_HOffice,
click Start.
- Check that the postage details have been transferred to the head office output
directory:
- Check that the hoffice_in subdirectory is empty.
The FileBatchProcessingSample_HOffice message flow reads
the hoffice_in.txt file from the
hoffice_in subdirectory.
The message flow also creates an
archive file with a timestamp in
c:\MQSIFileInput\hoffice_in\mqsiarchive or
\tmp\MQSIFileInput\hoffice_in\mqsiarchive.
- Look in the mqsiarchive subdirectory and
look at the contents of the file with the time stamp.
This file contains the branch office postage details from the
three branches that were created by the FileOutput node in the
FileBatchProcessingSample_Branch message flow.
- Look at the hoffice_out subdirectory,
and look at the contents of hoffice_out.txt.
This file contains the following branch office postage details:
Southampton postage parcel 23 letter 56
Winchester postage parcel 27 letter 30
Portsmouth postage parcel 12 letter 84
Back to sample home