Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

Learn more
Sign up
Implement B2B using File transfer

Implement B2B using File transfer

(0 reviews)

This example application is a follow up to How To Series - Part 1 of the developer blog. It illustrates how to poll for a CSV file, transform the data in the file into a different format as needed by the target, encrypt the data (secure), and transfer the file to a remote SFTP server.


This example polls for a folder, at an interval, and for a CSV file. The file contains fields such as SKU, Product Name, Description, and Type. The example transforms this input to a format as required by the B2B partner. Once the payload is transformed, it encrypts this payload using PGP encryption, and transfers this file to a SFTP server.

Set Up and Run the Example

  1. Open the Example project in Anypoint Studio from AnypointExchange.

  2. Install the Anypoint security module.

  3. Create a Public key ring file and Secret key ring file along with a secret passphrase to be used for PGP encryption. Copy the two .gpg files into the src/main/resources folder.Details on how these files can be created can be found here.

  4. Get the details for the target SFTP server to be used as the destination for the file.

  5. Put all the details gathered in the above steps inside src/main/app/

  6. Run the example application in Anypoint Studio or Standalone.

  7. Transfer the sample.csv file inside the src/main/resources/archive folder into src/main/resources/input.

  8. The file is picked up and transferred to the configured SFTP endpoint.


Read full documentation in GitHub


Log into Anypoint Platform to download this asset


Created By
MuleSoft Organization
Published On
Jun 22, 2017


VersionRuntime version