on 01-16-2019 4:35 AM
Hi Experts,
We have a scenario where a CSV file is picked up and sent to target SFTP server (pass through). Now the customer is requested to generate the notification once the file is sent. We had thought for below options
1. Add one more receiver component and trigger the email channel - Issue (The data is sent as an email attachment which is not required)
2. call email channel from receiver SFTP channel modules (Module process bean etc.) - It is also passing the message data (file data) which is not required
3. Pick the file from source and move to some temp folder, then create another scenario to move the to complete folder and trigger the notification.
Can you please suggest which is the best way among this or any other option to send the notification.
Thanks
Hi Harish,
I understand that you want to send email only once the SFTP system receives the file.
I would suggest for below configuration.
1> Check "Maintain Order at Runtime", will make sure that email is only send once the SFTP channel is successful.
2> Email interface should be the second interface in the "Receiver Determination".
3> For email body or subject of the email, you may create small mapping in ESR with your desired email body and subject of the email (You may also include the name of the file for better understanding)
Hope this helps!!
Thanks& Regards,
Binod Kumar Mondal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harish,
I would prefer multi-mapping with two receivers as overall this simplifies a complex scenario. This will be easy to understand in future and easier to troubleshoot. Receiver1 will be SFTP adapter . Receiver 2 will be mail adapter. The message to mail adapter will be of below format
Set the following mail adapter attributes from,to and subject using a java mapping. You do not need to provide any attachment or body of the email. The subject will contain the name of the file and target SFTP server is up and running. In the java mapping you need to verify if the SFTP server used for receiver1 is up and running. You can check this code reference.
This ensures not only file has been sent but also sftp server is up and running to the business.
This multi-mapping will be through java mapping. You can follow this blog for reference.
The java mapping will write the payload to receiver1 (SFTP) and set attributes (from,to and subject) for receiver2 (mail).
If you do not want java mapping then you need custom adapter module doing the same purpose but it will be a complex code to do as you need to call the mail commuication channel or write entire code of mailing in java.
Point 3 (mentioned by you) is not a good option because it does not guarantee SFTP server is up and running or not , secondly troubleshooting of two phase scenario will be difficult.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harish,
With all the above options, I see the potential of sFTP site being down and a false positive email notification being sent.
2 options come to mind:
Best Regards,
Sanjeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harish,
On the contrary, sFTP will let you save the file on the local directory instead of the 3rd party directory. Here is a screenshot from one of my interfaces:
Regarding multimapping, never tried it and didn't even know to be frank that it will pass the file as attachment. Have you tried playing around with the payloadSwapBean at all?
Best Regards,
Sanjeev
Hi Sanjeev,
Thanks for your response. I tried playing around swap bean but unable to remove the attachment.
regarding SFTP local file directory, I do not have local SFTP server, so not sure how this option will work. How the adapter login to the location which we specify in this?
regards,
Harish
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.