Version: 17.07
Supported Since: 17.01
The File Egress Connector can be used to send messages with a file payload to a specified directory of local file system and same as the inject connectors, UltraESB-X has tested on Linux, Windows and OS-X environments and it is supposed to be able to operate in almost all the existing file systems.
When you are sending a message to a local directory, UltraESB-X server expects the file content as the message payload and file name to be specified at the connector’s or configuration or as a variable.
In order to use the File Egress Connector, you must first select the Local File Connector dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the Local File Connector dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the Local File Connector dependency. |
On Exception |
The message will be emitted from this out port, if an error occurs while performing File sending operation. |
Connector Operation |
This port is used to connect operational elements to the Egress Connector. By-default, user does not have to connect any operational element and the default connector operation will be used. |
* marked fields are mandatory
File Path * |
Basic |
Destination directory where the payload file should be saved. |
File Name |
Basic |
File name for the payload to be saved (if there is an original name to the file, it will be preserved if this property
is not provided). In-order to construct the file name, you can use message headers, message properties, additional
variables set, message ID, message context ID, and message context properties in following formats respectively.
Further, if the file name is not set and the message contains a transport header with key |
Append Mode |
Basic |
If this is enabled, the framework will append the current message payload if there is a file with same name in the given location. If this is disabled, existing file will be replaced by the new file at the file system destination path. |
Weight |
Advanced |
Weight for the Egress Connector if this Egress Connector is under a weighted Egress Load Balancer |
In this use case scenario, the requirement is to receive messages with a file payload through a NIO HTTP Ingress Connector and saving the payload file to a local directory. For statistics and monitoring purposes it’s required to extract out the client ID’s from a receiving message transport header and create a log specifying the extracted client ID value and the same client ID value should be prepended to the saving file name.
To implement above use case first it is required to create a new integration flow and add a HTTP NIO
Ingress Connector and then it is required to provide the parameters to the HTTP NIO IngressConnector and
configure it. The incoming messages will contain a transport header denoting the sending client’s Id (clientId
).
For monitoring purposes that client Id will be logged using a Logger
processing element. Below is the configuration
of Logger processing element
As it is required to prepend the same client id to the saving payload file name, it will be a part of destination
file name. Finally it will be forwarded to a File Egress Connector
element that has been configured in-order to
save the payload to the configured location in the local file system. Below is the configuration of the File Egress
Connector.
Now after running the Integration flow, if you send a message with the transport header clientId
, a file will be
created in /tmp/files
directory with the content of the message and file name being the value of clientId
transport
header.