Save to File

Overview

The Save to File filter enables you to write the current message contents to a file. For example, you can save the message contents to a file in a directory where it can be accessed by an external application. This can be used to quarantine messages to the file system for offline examination. This filter can also be useful when integrating legacy systems. Instead of making drastic changes to the legacy system by adding an HTTP engine, the API Gateway can save the message contents to the file system, and route them on over HTTP to another back-end system.

Configuration

To configure the Save to File filter, specify the following fields:

Name Name of the filter to be displayed in a policy. Defaults to Save to File.
File name Enter the name of the file that the content is saved to. You can specify this using a selector, which is expanded to the specified value at runtime. Defaults to ${id}.out. For more details on selectors, see Selecting configuration values at runtime.
Directory Enter the directory that the file is saved to. You can specify this using a selector, which is expanded to the specified value at runtime. Defaults to ${environment.VINSTDIR}/message-archive, where VINSTDIR is the location of a running API Gateway instance.
Maximum number of files in directory Enter the maximum number of files that can be saved in the directory. Defaults to 500.
Maximum file size Enter the maximum file size in MB. Defaults to 1000.
Include HTTP Headers Select whether to include HTTP headers in the file. HTTP headers are not included by default.