We have a scenario in our project where a sender system sends a mail attachment. This attachment contains either an EDI message or a print file (binary data which needs to be printed later on).
There is a indicator in the message body to identify the type of message (EDI or print file).
We have decided to use an Adapter Module where we will perform following steps
1. Read the indicator to identify the message type
2. If print file , save it into some local/remote directory (path could be provided as a module parameter) and end the processing (or create some dummy message for monitoring purpose).
3. If it is an EDI message , we need to call some service to convert it into the XML format and pass on to the Integration engine for further processing.
My problem lies in step 2 , for writing the file I have two options :
a. Use Java APIs (this could have reliability issue like how to handle connection failure in this case?)
b. Configure a receiver File adapter and somehow call it from inside the adapter module (is it possible?)
If anyone of you have come across similar situation, please guide me how to handle it in the best possible way.
Thanks & Regards,