| Join wMUsers | Blog at wMUsers | User Control Panel | Site Map | webMethods Jobs |For Employers |
![]() |
![]() |
Keeping CountBecause the technical requirement stated that sub-documents must be processed in parallel (that is, not one-at-a-time and in top-down fashion), the task of corraling the counts was a daunting challenge. An atomic unit of work is one the run independent of other processes and this project's architecture had three -- each requiring its own running count:
These three counts are then applied as follows:
To maintain the various counts required in this project, I employed the internal storage provisions of Integration Server: the repository. Using the pub.storage Built-In Services, I managed the various counts using a primary key unique to each batch file -- its filename. Intelligent naming conventions made this possible and will be covered in a future zine article. The batch XML document file naming convention for this project was: MessageType_LocationID_DateTimeStamp Finding the Proper Course of ActionThus far, this article has described the mission requirements. The next section will detail how the data was collected. When I first attacked this problem. I created a repository store that mirrored the acknowledgement message (the previously discussed IData ProcessRecord). With the iteration of the three atomic work units -- parse, validate, and send to the exchange -- I invoked If each Flow had a lock, why the inaccuracies? Because I didn’t use the input variable waitLength. This is the time in milliseconds that service should wait for the repository entry to become available. The single data store I first created was the sole maintainer of counts. The uneven counts arose because in 7,500 individual sub-document processes, this store was accessed approximately 22,500 times. Because of the nature of "lock", each Flow that called the get/put service exclusively held the entire repository until the data was incremented and the lock was released. As a potential solution, I decided that implementing the waitLength input variable and setting a reasonable value wouldn’t necessarily guarantee results in the alloted timeframe. It may work, I thought, but we didn’t have time to test fully. Instead, I chose to create separate repository stores for each of the four counts. The creation of separate repository stores for each count provided a definitive and separate process for incrementing the counts. In addition to the main data store, we added separate stores for validCount, inValidCount, SentToExchange, and ErrorRecords. The unique ID (filename) used as a primary key in the main data store was used to maintain the relationship between each of the four new stores and the original process. Since each process accesses the data stores serially, the possibilty of collisions, misreads, over-writes or any other similar issues is erased. This solution has tested out with over 250,000 files satisfactorily. Tying Off the Loose EndsIn designing this solution, one other consideration was how to recover from a potential Production problem. To support this endeavor, DSP pages were built that provide a list of all processed data contained in the Processes data store. The DSPs can be viewed in a browser to show the original file name (repository key) along with all associated counts and date time stamps. Remember, to obtain all keys for a data store, invoke Also, another issue to be handled up front is the potential proliferation of data stores. Even though the stores are persisted to the hard drive (WmRepository2 in the server root folder), it makes good sense to develop a system to purge the data. In this project, I decided to keep only the main process store and to delete the other stores upon wrap up of the XML document processing. The main data stores can be emptied manually, but prior to removing key/value pairs from the core data store, save the data to disk in a custom XML file in case performance statistics are needed in the future. Go Deeper on the Subject: The wMUsers Discussion Forums Ray Moser is a a Principal Consultant with Zettaworks LLC, Houston, Texas and is working in Sydney, Australia on various webMethods projects. He has over 10 years experience in application architecture and development. He has architected and built several successful integration projects using the webMethods Integration server, Trading Networks and Enterprise Broker.
Ray can be reached at |
| © All Rights Reserved, 2001-2008. |