Starting an agent as a Windows service

In Version 7.0.3 or later of WebSphere® MQ File Transfer Edition, you can start an agent as a Windows service. When you log off Windows, your agent continues running and can receive file transfers.

About this task

A WebSphere MQ File Transfer Edition agent is a Java™ process. On Windows, when you start an agent from the command line, the agent process runs using the user name you used to log on to Windows. When you log off the system, the agent process stops. To prevent the agent stopping, you can configure an agent to run as a Windows service. Running as a Windows service also allows you to configure agents to be started automatically when the Windows environment starts or is restarted.

Complete the steps below to start an agent that runs as a Windows service. You must be running WebSphere MQ File Transfer Edition V7.0.3 on one of the supported Windows versions to run the agent as a Windows service. For the list of supported environments, refer to the System Requirements at http://www.ibm.com/software/integration/wmq/filetransfer/requirements/.

The exact steps depend on whether you have already created an agent or you are creating an agent. You can configure existing agents to run as a Windows service, or you can configure this when you create an agent. Both options are described in the following steps.

Procedure

  1. If you are creating a WMQFTE agent, use the fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, or fteCreateBridgeAgent command. Specify the -s parameter to run the agent as a Windows service. In the following example, the agent AGENT1 is created, which has an agent queue manager QMGR1. The Windows service runs using a user name of fteuser, which has an associated password ftepassword.
    fteCreateAgent -agentName AGENT1 -agentQMgr QMGR1 -s -su fteuser -sp ftepassword

    You can optionally specify a name for the service after the -s parameter. If you do not specify a name, the service is named fteAgentAGENTQMGR, where AGENT is the agent name you specified and QMGR is your agent queue manager name. In this example, the default name for the service is fteAgentAGENT1QMGR1.

    Note: The Windows user account that you specify using the -su parameter must have the Log on as a service right. For information about how to configure this, see Guidance for running an agent or database logger as a Windows service.

    For more information, see fteCreateAgent (create a WebSphere MQ File Transfer Edition agent).

  2. If you followed the previous step to create an agent, run the MQSC commands that are generated by the fteCreateAgent, fteCreateWebAgent, fteCreateCDAgent, or fteCreateBridgeAgent command. These commands create the WebSphere MQ queues that are needed by the agent. For example, for an agent named AGENT1, an agent queue manager named QMGR1 and a coordination queue manager named COORDQMGR1, run the following command:
    runmqsc QMGR1 < install_directory\config\COORDQMGR1\agents\AGENT1\AGENT1_create.mqsc
  3. If you did not follow the previous steps to create an agent and instead want to configure an existing agent to run as a Windows service, first stop your agent if it is running, and then modify its configuration.
    1. The following example uses an agent named AGENT1. Run the following command:
      fteStopAgent AGENT1
    2. Use the fteModifyAgent command to configure the agent to run as a Windows service:
      fteModifyAgent -agentName AGENT1 -s -su fteuser -sp ftepassword
      For more information, see fteModifyAgent (modify a WebSphere MQ File Transfer Edition agent).
  4. Start your agent using the fteStartAgent command. Alternatively, you can use the Windows Services tool, which is available from Administrative Tools in the Control Panel, to start the service.
    fteStartAgent AGENT1

    The service continues to run even if you log off Windows. To ensure that the service also restarts when Windows restarts after a shutdown, the Startup Type field in the Windows Services tool is set to Automatic by default. Change this to Manual if you do not want the service to restart when Windows restarts.

  5. Optional: To stop the agent, either use the fteStopAgent command or use the Windows Services tool. For example, from the command line, run the following command:
    fteStopAgent AGENT1
    • If you use the Windows Services tool to stop the service, Windows might produce an error that starts Windows could not stop the IBM WMQFTE agent service. Despite this error, the agent has stopped successfully. This is a known limitation with the Java runtime environment that is used by WebSphere MQ File Transfer Edition.
    • When you run the fteStopAgent command as a service, the command always runs using the -i parameter regardless of whether you specified this parameter. The -i parameter stops the agent immediately without completing any transfers that are in progress. This is caused by a limitation of the Windows service.

What to do next

If you have problems starting your Windows service, see Guidance for running an agent or database logger as a Windows service. This topic also describes the location of the Windows service log files.

Task Task

Feedback

Timestamp icon Last updated: Tuesday, 30 January 2018
http://www.ibm.com/support/knowledgecenter/SSEP7X_7.0.4/com.ibm.wmqfte.doc/windows_service.htm