IBM Support

How to configure a listening producer partner in Sterling FileGateway

Technical Blog Post


Abstract

How to configure a listening producer partner in Sterling FileGateway

Body

Introduction

Up until IBM Sterling Filegateway (SFG) version 2.2.6.0, there was no possibility to configure a Listening Producer; 
the producer was by default an initiating producer, meaning that it was up to the producer partner to connect to SFG 
and upload the file to be routed.    
Starting with SFG 2.2.6.1 and higher, you have the option to configure a Listening producer, this will allow SFG to connect 
to the remote producer partner and retrieve the files to be routed.    
This blogs aims to help you configure a Listening Producer in SFG.    

Note: There is no SFG UI available to configure a Listening Producer, you will need to configure it using The Rest API 
feature introduced in SFG 2.2.6.1 and higher.   
The REST API is not installed by default with SFG, you will need to install it manually in order to be able to configure 
a Listening Producer.      

Installing REST API
  
See below link to a blog that explains the installation of the REST API 
as well as a link to the official SFG documentation on the subject. 
   
Installing Rest API blog.  
Installing Rest API documentation      

Configuring the Listening Producer Partner:    

1. Login to the REST API interactive console with a user that has the rights to use REST API.    
2. We will use the create functionality of the Trading partner services API, in the filter field type in "Trading Partner" 
   and choose Create (Post) URL.
  
  image  
3. In the Create Trading Partner API interface you will find an entry for every parameter configuration you would need 
to fill in when using the SFG admin UI in order to configure a producer. We will go through the steps to list those parameters
side by side to match them on both interfaces. The first step is to choose the SFG community the partner will belong to.  

Note: Similarly to the SFG UI, the API interface also marks the mandatory fields with an asterisk.  Note as well that the 
SFG admin UI parameters are just for comparison, you should not make any configuration for a listening producer via the SFG UI.          

Rest API UI parameters

SFG admin UI parameters

image

image

    4. Fill in the Partner Information.  

Rest API UI parameters

SFG admin UI parameters

imageimageimageimageimageimage

image

5. The User account parameters to be filled in:

Rest API UI parameters

SFG admin UI parameters

imageimageimageimageimageimageimage

image

6. The next step is to choose the partner role. Since this is a new functionality that cannot be set via the SFG UI; The SFG UI does not differentiate the producer type, it will simply list the partner as a producer.

We will choose the new Listening Producer partner role from the Rest API UI:

Rest API UI parameters

SFG admin UI parameters

image

image

7. Mark whether or not SSH usage will be needed.

Rest API UI parameters

SFG admin UI parameters

image

image

8. Since we have chosen to configure a Listening Producer and we are retrieving files from the remote producer server, we need to provide the details for that connection.

In this example I am assuming the connection will be done via FTP, click on the Add button for the parameter “Producer FTP Configuration”.

image

Note: The protocols supported out of the box for Listening producer are: FTP, FTPs, C:D and sFTP.

9. Fill in the connection details.

image

 

10. Once you filled in all the details, you can click on the submit button to create your Listening producer partner.

image

Verifying the configuration in the SFG admin UI

Login to the SFG admin UI and look for your new Listening producer partner, note that the SFG UI does not differentiate between Initiating producer and Listening Producer, it will be listed simply as a producer of data.

image

image

How to identify which partners are Listening producers.

The easiest way is to create a group in SFG and add all the Listening producers to that group after they are configured.

This way you can see who is a listening partner simply by selecting the group in the UI.

image

Another way to check which partners are listening producers is to query the appropriate database table; there are four database tables listing the listening producers, one for each supported protocol:

FG_LIST_PROD_CD

FG_LIST_PROD_FTP

FG_LIST_PROD_FTPS

FG_LIST_PROD_SFTP

You can use the SQL manager in the dashboard UI under:

Operations => System => Support Tools => SQL Manager

And run a query like the one below to obtain, for example, a list of all your FTP Listening Producers:

select * from FG_LIST_PROD_FTP

Enabling the file Transfer

There are four BPs out of the box provided for enabling the Listening producer functionality:

image

The FileGatewayListeningProducer BP needs to be scheduled to run periodically to check if there are any Listening Producers to be polled.

The schedule should run at an interval lower than the lowest polling interval assigned to any of your Listening producers.

Assuming that the Listening partner with the lowest polling interval is set to 10 minutes, we can create a schedule and set it to run, for example, every 5 minutes or lower.

When the schedule runs, the FileGatewayListeningProducer BP will check if there are any Listening Producers that reached their polling time and if so will start the corresponding protocol BP for that Listening Partner, either FileGatewayListeningProducerCD, FileGatewayListeningProducerFTP or FileGatewayListeningProducerSFTP depending on the protocol used and it will send to the protocol BP the connection details provided during configuration, see below an extract from ProcessData showing the connection details.

  <?xml version="1.0" encoding="UTF-8"?>  
<ProcessData>   
<RemotePasswd>AAAANgAAADUAAAAjAAAABgAAAAQAAAAKAAAAAAAAACI=</RemotePasswd>    
<tpName>TestLP_api</tpName>    
<RemoteUserId>FTPuser</RemoteUserId>    
<RemoteHost>FTPServer</RemoteHost>    
<MailboxPath>/TestLP_api</MailboxPath>    
<ConnectionType>PASSIVE</ConnectionType>    
<RetryDelay>30</RetryDelay>    
<ConnectionRetries>3</ConnectionRetries>    
<Directory>/</Directory>    
<RemotePort>21</RemotePort>    
<RemoteFileName>*</RemoteFileName>    
<dbRowKey>201607191174375814174   </dbRowKey>    
<protocol>FTP</protocol>    
<TRACKINGID>WIN-33OJ71JEER3:node1:155ee3676ac:4065810</TRACKINGID>  
</ProcessData>

The Protocol BP will then execute the following steps:

  1. Connect to the remote Listening Producer partner server.

  2. Get a list of the files existing on the provided directory. Using the pattern specified.

  3. Do a loop for every file listed, retrieve them and add them to the Listening Producer mailbox in SFG to be routed like it would normally happen.

  4. Once the file is added to the mailbox successfully, it is deleted from the remote server.

Hope this blog helped you with your configuration of a Listening Producer and don't hesitate to leave a comment.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11121421