Versions Compared

Key

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

...

The file binding example shows how components of ServiceMix can interact with the file system. This is important because many there are applications that write files out to a directory on disk and other applications that may need access to those files. This application gives is a simple example of how a ServiceMix component can read a file from the disk, process it into a normalized message, then send it via the NMR , to another ServiceMix component. The receiving component can then look at process the message (which contains the file) and process it and write it out to another location on disk.

A hypothetical business scenario: An online wholesale distributor of books, CDs and books on tape, receives a nightly order from a retail store. The nightly order is transmitted to the distributor as a file and placed in a particular directory on disk. There is a ServiceMix component (getOrders) that continually scans that directory looking for order files. When it sees a file, it reads it in and processes it. It from the disk, then transforms it into a normalized message. It sends the message over the bus (NMR) to another component called "placeOrders." The placeOrders program divides the order into separate orders for its suppliers, e.g., one order will be placed with the distributor's book supplier, one order will go to the CD supplier, etc. At some later point, the suppliers will log in and retrieve their order files. This step is not shown in this examplehere.

The following diagram illustrates this:

...