How the Web Gateway fits into your WebSphere MQ Managed File Transfer topology

Use the WebSphere® MQ Managed File Transfer Service Web Gateway to transfer files to WebSphere MQ Managed File Transfer (MQMFT) agents and retrieve the status of transfers using an HTTP client.

Use the Web Gateway to extend an existing WebSphere MQ Managed File Transfer network to support clients that use the HTTP protocol. The Web Gateway provides a link from clients that are using the HTTP protocol into a WebSphere MQ Managed File Transfer network that already exists. Transfers that use the Web Gateway are logged throughout the transfer. For more information about the purpose of the Web Gateway, see Scenarios for the Web Gateway.

Figure 1. Overview of Web Gateway architecture
A diagram of the parts of a Web Gateway as described on this page, together with assorted HTTP clients on one side of the Web Gateway and some MQMFT agents on the other side of the Web Gateway.
The Web Gateway application requires the following component, which is not provided with WebSphere MQ Managed File Transfer:
A Java Platform, Enterprise Edition 5-compliant application server
This application server hosts the Web Gateway application. HTTP requests from clients are directed to the application server, which passes the contents of the requests to the application.

A Web Gateway consists of several parts:
The MQMFT Web Gateway application
The Web Gateway application handles both file uploads and transfer status requests.

When a file is uploaded, the Web Gateway application writes the file data to a temporary store on the file system of the system that the application is running on. The Web Gateway application then submits a file transfer request to the MQMFT agent, which is running on the same system. For more information on this request, see File transfer request message format.

When a request for status information is received, the Web Gateway application connects to the MQMFT database logger database (using the data access facilities provided by the application server) to retrieve the required information. The application then generates the response, which is passed to the client.

An MQMFT web agent
The Web Gateway requires an MQMFT agent installed on the same system as the application. This web agent can be created using the fteCreateWebAgent command; see fteCreateWebAgent (create a WebSphere MQ Managed File Transfer web agent). This agent receives the file transfer request message described in the previous section. The request message refers to the file or files in the temporary store. The agent transfers the files to an existing agent in the MQMFT network, reading the files from the file system store. The source disposition behavior is set to delete so that the files are removed after the transfer successfully completes, see fteCreateTransfer for more information.

You do not need to specially configure this agent, because the file transfer request is an ordinary message and not specific to the Web Gateway.

The MQMFT database logger and a supported database
To provide status information about transfers, started using the web or by other means, the Web Gateway application must be able to query a database that contains audit information for MQMFT activity. This database is populated by the database logger component provided with the product. Database access is provided by the data access facilities included in each application server. The database does not need to be located on the same system as the other components.

Components needed for Web Gateway scenarios

The following diagrams show the WebSphere MQ Managed File Transfer components, and other objects, that are involved in file transfer requests. All the Java Platform, Enterprise Edition (JEE) resources used in each scenario must be defined in your application server, regardless of which scenario you are using. For details of how to configure the JEE resources, see Configuring the Web Gateway.

Figure 2. WebSphere MQ Managed File Transfer components involved in a file upload through the Web Gateway
A diagram of a source file system located on the same system as a web browser. The web browser communicates with an application server that hosts the Web Gateway JEE application. The application server communicates with an agent queue manager, using a JEE resource that is labelled A. The application server uses some temporary file space storage on a file system that is also accessible to an MQMFT web agent. The web agent is connected to the same agent queue manager that the application server communicates with. This queue manager uses a WebSphere MQ network to communicate with an MQMFT agent that is running on the destination file system.
  1. A JavaScript application running in the user's web browser uses functions defined by the RESTful API provided by the Web Gateway to upload a file.
  2. The file data is read from the file storage located on the same system as the web browser and sent using the HTTP protocol to the application server that hosts the Web Gateway application.
  3. The Web Gateway Java Platform, Enterprise Edition (JEE) application receives the file data as the body of an HTTP request and writes it to file storage that is accessible from both the application server and the web agent. If the Web Gateway application and web agent are on the same system, this can be a directory on the system's file system.
  4. The Web Gateway application sends a message to the agent queue manager to which the web agent is connected. This message contains instructions that identify both the file to move and the WebSphere MQ Managed File Transfer agent that the file data is sent to. This information is taken from the HTTP request in step 1.
  5. The Web Gateway JEE application sends an HTTP response to the web browser.
  6. The web agent receives the message that requests the transfer of the file data.
  7. The web agent reads the file data, which corresponds to the uploaded file from step 1.
  8. The web agent transfers the file data, as a sequence of messages, to the agent queue manager.
  9. The agent queue manager transfers the messages, which correspond to the uploaded file from step 1, across the IBM WebSphere MQ network. This might involve exchanging the file data between further queue managers until the data arrives at the queue manager to which the agent running on the destination system is connected.
  10. The agent on the destination system receives the messages containing the file data and converts the data back into a file.
  11. The file data is written to the file storage at the destination system.
JEE resources used in this scenario:
A - JMS Queue Connection Factory called WMQFTEWebAgentConnectionFactory with a JNDI name of jms/WMQFTEWebAgentConnectionFactory

Figure 3. IBM WebSphere MQ Managed File Transfer components involved in a file upload to a file space, and subsequent download from the file space
A diagram of various MQMFT components including an agent, a web agent, and MQMFT commands, as described on this page. The Web Gateway JEE application is hosted by an application server. The Web Gateway application communicates with an agent queue manager using JEE resources that are labelled A, B, and C. The application also communicates with a database containing file space information, using JEE resources that are labelled D and E. The diagram also includes a web browser, source and destination file systems, file space storage on a file system, and a WebSphere MQ network.
  1. The user, or a process, sends a file transfer request (in the form of an IBM WebSphere MQ message) into the IBM WebSphere MQ network. This request can be sent from the command line or through another MQMFT interface. The message is addressed to the queue manager to which the agent on the source system is connected.
  2. The agent on the source system receives the message, which instructs it to perform a file transfer to the web agent.
  3. The agent reads the file from the source file system and converts it to a sequence of IBM WebSphere MQ messages.
  4. The agent sends the sequence of messages to a queue manager in the IBM WebSphere MQ network.
  5. The IBM WebSphere MQ network routes the messages, which contain the file data, to the agent queue manager.
  6. The web agent receives the messages, which contain the file data, from the agent queue manager.
  7. The web agent writes the file data, as a file, to the file space storage on a file system that is accessible to the Web Gateway JEE application.
  8. The web agent sends a message to the agent queue manager, to inform the Web Gateway JEE application that a file has arrived.
  9. The Web Gateway JEE application receives the notification message sent from the web agent via the agent queue manager.
  10. The Web Gateway JEE application updates a database that contains information about the files that are stored in file spaces.
  11. The Web Gateway JEE application sends a response, which is destined for the web agent, to the agent queue manager.
  12. The web agent receives the response message and completes the file transfer operation.
  13. At some later time, a user or process makes a RESTful HTTP request to the Web Gateway JEE application, to retrieve a file from the user's file space. In this diagram the request is made by a web browser. The request can be made by any HTTP client.
  14. The Web Gateway JEE application receives the HTTP request, decodes it, and uses the file space information database to locate the file data.
  15. The Web Gateway JEE application reads the file data from the file space storage, which is located on a file system that is accessible from the Web Gateway JEE application.
  16. The Web Gateway JEE application sends the file data back to the web browser that requested it.
  17. The web browser writes the file data to the file system on the destination system.
JEE resources used in this scenario:
A - JMS Queue called WMQFTEWebAgentRequestQueue with a JNDI name of jms/WMQFTEWebAgentRequestQueue
B - JMS Queue Connection Factory called WMQFTEWebAgentConnectionFactory with a JNDI name of jms/WMQFTEWebAgentConnectionFactory
C - Activation Spec called WMQFTEActivationSpec with a JNDI name of jms/WMQFTEActivationSpec, which is configured with the connection details for the web agent's queue manager
D - Data source called wmqfte-filespace with a JNDI name of jdbc/wmqfte-filespace
E - JDBC Provider referenced by the data source jdbc/wmqfte-filespace

Figure 4. Requesting the status of file transfers through the Web Gateway
A diagram showing a Web Gateway application that is hosted by an application server, which communicates with a web browser. The application server also communicates with a database containing transfer history information, using JEE resources that are labelled i and ii. An MQMFT agent communicates with a coordination queue manager through the WebSphere MQ network, and this queue manager in turn communicates with the database logger. The database logger is connected to the database that contains transfer history information.
  1. A JavaScript application running in the user's web browser sends a RESTful HTTP request to the Web Gateway application, requesting information about a transfer.
  2. The Web Gateway application queries a database containing information about file transfers that have taken place in a network of WebSphere MQ Managed File Transfer agents.
  3. The Web Gateway application returns the result of the query to the JavaScript application.
Activities that occur during the previous steps:
i - WebSphere MQ Managed File Transfer agents produce messages containing information about file transfers that are taking place.
ii - The queue managers route these messages to a designated queue manager that is performing the coordination queue manager role.
iii - The coordination queue manager is connected to the database logger component. The database logger receives a copy of each message that relates to a transfer being performed by an agent.
iv - The database logger records the information about transfers in a transfer history database, so that it can be queried by other applications including the Web Gateway.
JEE resources used in this scenario:
A - Data source called wmqfte-filespace with a JNDI name of jdbc/wmqfte-database
B - JDBC provider referenced by the data source wmqfte-database