Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Component or Bean ID

Description

filePoller

This component periodically checks the "inbox" directory looking for files. If there is a file or directory present, it adds the file to the "workingSet", which is a collection of files to be processed. The workManger is invoked to schedule the work of processing the file from the workingSet. Another thread is created and the processing of the file begins. Processing consists of marshalling the file (streaming it from disk into a normalized message). The normalized message is sent over the Normalized Message Router (NMR) to the fileSender component per the specified "destinationService" which is specified in the servicmix.xml file in the filePoller component. In this case the "destinationService" is the fileSender component. Finally, after it has been processed, the filePoller deletes the file from the source directory.

fileSender

This component is the "destinationService" for the filePoller. It receives normalized messages from filePoller. The messages it receives are the files that filePoller has transferred to it via the NMR. It converts the normalized message to its original file format and sends it to the destination directory, in this case the outbox directory. This component creates the filename to copy the file to by concatenating the string "sample_" with the process id following by ".xml". The concatenated string is passed to the org.servicemix.expression.JaxenStringXPathExpression bean as an argument to the constructor, as can be seen by the constructor-arg value tag in the XML file. Therefore, the source file name from the inbox directory is not the destination file name in the outbox directory.

workManager

This bean is used by the filePoller to increase the throughput of the application. The workManager is a thread pool whose size can be adjusted declaratively in the servicemix.xml file. Threads are used by this application to do the work of processing files.

Related Documentation

For more information on the following topics please see:

...