Parameter Name | Parameter Value |
---|---|
requiredHeaders | All |
dcNamespace |
Parameter Name | Parameter Value |
---|---|
swap.keyName | Payload-Name |
swap.keyValue | MailAttachment-1 |
Receiver File Channel Settings
Now in the Receiver File adapter we are going to use the DynamicConfigurationBean to retrieve the attachment name.
The attachment file name is available in the Dynamic configuration attribute Part[1].Content-Description, which we will write to the PI message interface name.
To the 'Module' tab add the DynamicConfigurationBean with the following parameters:
Parameter Name | Parameter Value |
---|---|
key.0 | Part[1].Content-Description |
value.0 | message.interface |
Pic 2.1
Using Variable Substitution, create a variable fname referencing the message interface name and access this variable in the file name field.
Pic 2.2
Pic 2.3
Testing
The configurations are complete. It’s time to test our scenario.
A sample mail is sent to the mail account which the sender email adapter is polling with the attachment name MyAttachment1.CSV
Pic 3.1
Integrated configuration was used in this scenario, so we can see the Dynamic Configuration message attributes in message monitoring.
Note that Part[1].Content-Description has been set to MyAttachment1.CSV at runtime.
Pic 3.2
The payload was swapped successfully and the attachment data has been set to the main payload as shown below.
Pic 3.3
We can see the output file in the output folder path with the same name as our attachment MyAttachment1.CSV.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
9 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |