For more information about the reduce operator and lambda functions see transforming objects with DataWeave.įor simplicity we will walk through getting started with the Zip Decompressor and built-in File Read connector. Each element corresponds to a filename and content. In this case, the lambda function applies to each element of the File List output and concatenates a new object onto the accumulator acc each iteration. The reduce operator applies a lambda function to each element of the given array. The above sample uses the DataWeave reduce operator. Simply pass this to a File Write connector to write it to disk or to another connector for further processing, transmission, or storage.īelow is sample configuration XML for getting started. When the Compressor finishes processing, the output message payload contains the archive file. That is all that is required to configure the input for the Zip Compressor. The following DataWeave script will reduce the File List output down to the filename and file data for the Zip Compressor.Īcc ++ In the Value of the Set Payload connector, click the Mule expression indicator to add in DataWeave script. The easiest way to transform the File List output is to add a Set Payload connector following the File List connector. The reason for this is, the Compressor expects the filename and file data be present in the input payload as key:value pairs. The output of the File List connector must be transformed before it can be used with the Zip Compressor. Second, transform the File List output into a Map. The key to getting started is to create a mapping of filenames to file data in the message payload before it arrives at the Zip Compressor.įirst, add a File List connector to your flow and configure it to point to a particular Directory Path. Check out the Online Documentation for more information about the optional properties.įor simplicity we will walk through getting started with the Zip Compressor and built-in File List connector. Additional settings for a more granular level of control may be configured in the properties page. No configuration is required for the module itself. In most cases configuration is as simple as wiring up the input. This guide will walk you through getting started with the Zip, Bzip2 and Gzip modules. For details on installation and other connectors please see the Online Documentation. There are many different connectors currently supported: AS4 for EDI, FTPS, FTP, SFTP, SSH, Email, etc. Our Zip, Bzip2, and Gzip modules add advanced file compression and decompression functionality to your Mule application. The /n software Connectors for MuleSoft extend the functionality of MuleSoft and provide robust enterprise-ready Internet connectivity, secure messaging, and file transfer. The /n software Connectors for MuleSoft are pure java Connectors which integrate directly into AnyPoint Studio (and your Mule application). n software Connectors for MuleSoft Introduction
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |