Managed File Transfer

 View Only
  • 1.  FileGateway Concurrent Sesions

    Posted Thu June 08, 2023 10:11 AM

    Hi Team,

    I have a client that send mutiples files in the same time period to a mailbox. The files are around 20 and this enter to filegateway and have a consumer that deliver files in a server SFTP. All files go to the same destination, but the remote SFTP server accept only 2 concurrent sessions, and filegateway attempt deliver 5 files at the same time, filegateway deliver 2 files success and 3 files failed. Is necessary redeliver files again manually.

    Is posible in filegateway identify if have a SFTP session open when Consumer trading partner listen and send automatically file, and it can use this session for send the file and not have a problem with concurrent sessions. Or have any option to solve this problem with concurrent sessions?



    ------------------------------
    Oscar Javier Duran Lopez
    ------------------------------


  • 2.  RE: FileGateway Concurrent Sesions

    Posted Fri June 09, 2023 09:40 AM
    Edited by System Test Sun July 23, 2023 10:38 PM
    If I am understanding you correctly, Sterling is sending each file under new connection/session, which is a default configuration. 
     
    Option 1: Ask the consumer of the files to pick up files from Sterling. 
     
    Option 2: You can do this in more than one way but the best way I know of would be to send all files to a mailbox (or the file system - depending on file sensitivity and location) that doesn't automatically deliver to the consumer (no channel).
     
    Then, on a schedule with an interval that works for everyone (15 min., 1 hour) run a process that locks the initiating starter BP (containing the variables for the process). 
     
    Therefore, here is a high level summary to give you a good idea of the framework. 
    1. Starter BP name of maybe, DeliverFiles_Starter
    2. Inline invoke the main BP. 
    3. Run Lock Service to check for locks on that starter name
      If not Locked then proceed to lock, otherwise end gracefully 
    4. Extract oldest file from mailbox, if there is a file to send then 
    5. Open Begin session to connect to partner 
    6. Change directory, if needed 
    7. Put file on remote host 
    8. Commit the mailbox extract 
    9. Release file loop until all files have been sent
    10. Close with End Session 
    11. Unlock starter BP 
    Note: If you lock the BP you will prevent another instance executing while you are in the process of sending. 
     
    Best of luck,


  • 3.  RE: FileGateway Concurrent Sesions

    Posted Tue June 13, 2023 12:31 AM
    Hi Laurie,
     
     
     
    Yes , This is a posible solution, but I have a problem because the status of the file in IBM FileGateway is Delivered because the file was send to mailbox. If later other BP search the files in mailbox and send one to one via SFTP and any file failed in the deliver , the status in IBM Filegateway not update for failed deliver because the status"delivered"  was show in the initial send. The client require see the correct status for the final deliver and have the possibility to replay the file. 
     
    Do you have other option for solve this case ?
     
    Thanks. 


    ------------------------------
    Oscar Javier Duran Lopez
    ------------------------------



  • 4.  RE: FileGateway Concurrent Sesions

    Posted Wed June 14, 2023 08:26 AM

    Hi Oscar,

    How is your trading partner viewing the status of their files delivered to them?  myFileGateway?  If they can only see their mailbox for the delivery status then you have a few options.

    1. You can send the files to a new mailbox and run the scheduled BP against this new mailbox.
    2. You can deliver to the file system and build options in your file collection process to control looping and set it to only loop once to pick up a maximum of two files at a time the trading partner's host.
    3. Set new expectations on how the new process works and educate them on how to find their files -- reminding them of their concurrent connections limit in place.

    There may be more options but these are the ones that I've built.  

    Regards,



    ------------------------------
    Laurie Sibbett
    ------------------------------



  • 5.  RE: FileGateway Concurrent Sesions

    Posted Thu June 15, 2023 09:03 AM
    Hi Oscar,
     
    If the customer you are delivering to is using myFileGateway and only has access to see their mailbox you are delivering through then they won't see the "Delivered" status when you put the file in the intermediary mailbox or file system.
     
    So, if you have a schedule that runs on an interval checking that intermediary mailbox and it finds files to send then that process becomes the Producer of the file and the customer is the Consumer of the file.  It should show delivered of a maximum of two files.
     
    If you have a completely different setup with the Consumer (Trading Partner) of the file then I don't have any new suggestions.  I haven't been able to configure SFG to deliver a limit or more than one file per route except in the way I have described.
     
    You may want to contact IBM Support and ask them how you can accomplish your goal.
     
    The simplest answer is for them to pickup the file from the mailbox.  The most complex is building a process to collect files you drop in an intermediary mailbox.  If you use the file system adapter, to collect the files you deliver to their host, then you can run a process to collect a maximum of two files and open one session and put them on the remote host, the producer mailbox in this situation can be anything you like, it will appear it came directly from the producer.
    For example:
    File comes in from PartnerA and is routed to the file system.
    A schedule executes and two files from the file system are collected.
    Once the files are collected they are added to new PartnerA1 mailbox and routed through the final mailbox, PartnerB/Inbox to their Host.
    In this scenario they can replay if it fails.
    There are many ways of going about doing the details of this so it will work best for your scenario. 
    Regards,



    ------------------------------
    Laurie Sibbett
    ------------------------------



  • 6.  RE: FileGateway Concurrent Sesions

    Posted Thu June 15, 2023 04:38 AM

    Hi Oscar,

    Take a look at the BPs for MQ FTE delivery: 

    FileGatewayDeliverWMQFTE - initiates the delivery via MQ FTE posting a "Delivering" status update

    FileGatewayProcessFTEReply - is bootstrapped from the async reply queue where MQ posts the result of the transfer. It updates the delivery info to show success or failure of the transfer

    You could do something similar e.g. have a custom delivery process that moves the files to a mailbox, maybe logs the msg id, delivery key and route metadata to a custom table, and  reports delivery pending (you can create your own custom event code to make it clear). The final thing the MQFTE delivery BP does is:

    <assign to="FG/AsyncDelivery">true</assign>

    which maybe tells SFG that delivery isn't complete (been a while since I played with this so not 100% sure).

    Your scheduled process can then loop through the mailbox or your custom tables to kick off however many threads to do the SFTP delivery, updating or deleting the rows from the custom table, and reporting back the transfer result via the FileGatewayRouteEventService.

    Regards,



    ------------------------------
    RICHARD CROSS
    ------------------------------



  • 7.  RE: FileGateway Concurrent Sesions

    Posted Thu June 15, 2023 10:08 AM

    Oscar,

    If you want to implement all this in standard normal SFG supported manner you will need to create a custom protocol for Consumer Delivery. See core documentation: https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=protocols-adding-custom

    The BP used for the delivery can create the lock file as explained above. The BP will also have to sleep until the lock is available, then deliver the data file to the Consumer system. All this will be run by the Delivery Service (https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=services-file-gateway-delivery-service) that control running the custom delivery. You can also define all your own SFG event codes and use the standard one out of the box (https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=gateway-confirming-file-delivery). Complete list here: https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=codes-about-event

    Adding custom events located here: https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=codes-adding-custom-event

    You may want to use the out of the box SFTP delivery bps as a starting point for your version. Building this to use a single thread (1 session) will be easiest to start with. The logic to use two threads will be more complex dealing with two lock files, so do that in version 2 after you have version 1 completed. Be aware that if you have 100 files all at once you will get 100 delilvery BP all at once so teh amount of time you sleep wiating for the lock needs to be appropriate or you will have to replay them if they fail.

    When you complete this custom protocol process you can even use the standard replay functionality and all other out of the box SFG features.

    Mark



    ------------------------------
    Mark Murnighan
    Solution Architect
    ------------------------------