About the File Output sample

The FileOutput Node is used to write messages to the file system of the broker. You can use the FileOutput Node to create a new file from a single message or to replace the contents of an existing file with a message. The records can be created directly from messages, and can be padded to a fixed length, or separated from other records by a delimiter character.

The FileOutput node can be used to perform the following tasks:

This sample demonstrates how a FileOutput node can be used to output a message to a file part way through a message flow. The sample is based on a scenario where item and price details from a sales invoice are sent by using a SOAP message over HTTP and are updated and written to a file, before being sent back over HTTP.

This sample uses one message flow and covers the following actions:

  1. An HTTPInput node receives a SOAP message containing a sales invoice.
  2. A JavaCompute node is used to update some of the item and price details in the sales invoice.
  3. A SOAPExtract node removes the SOAP envelope from the message, storing it in the local environment.
  4. The resulting message is written to a file by using the FileOutput node.
  5. A SOAPEnvelope node adds the stored SOAP envelope back on to the message.
  6. The message is sent back to the sender by using an HTTPReply node.

The following message flow, FileOutputNodeSampleFlow, is imported by the sample:

FileOutputNodeSampleFlow

Back to sample home