ProtocolBridgePropertiesExit2: Looking up protocol file server properties

If you have a large number of protocol file servers, you can implement the com.ibm.wmqfte.exitroutine.api.ProtocolBridgePropertiesExit2 interface to look up protocol file server properties that are referenced in transfers. You can implement this interface in preference to maintaining a ProtocolBridgeProperties.xml file. Managed File Transfer provides a sample user exit that looks up protocol file server properties.

Configuring user exits that look up protocol bridge properties

About this task

Any user exit that looks up protocol bridge properties must implement the interface com.ibm.wmqfte.exitroutine.api.ProtocolBridgePropertiesExit2. For more information, see ProtocolBridgePropertiesExit2.java interface.

You can chain multiple protocol server properties exits together in a similar manner to other user exits. The exits are called in the order that they are specified in using the protocolBridgePropertiesExitClasses property in the agent properties file. The initialize methods all return separately and if one or more returns a value of false, the agent does not start. The error is reported in the agent event log.

Only one overall result is returned for the getProtocolServerProperties methods of all of the exits. If the method returns a properties object as the result code, this value is the returned result and the getProtocolServerProperties methods of the subsequent exits are not called. If the method returns a value of null as the result code, the getProtocolServerProperties method of the next exit is called. If there is no subsequent exit, the null result is returned. An overall result code of null is considered as a lookup failure by the protocol bridge agent.

You are recommended to use the ProtocolBridgePropertiesExit2.java interface, but for information about the ProtocolBridgePropertiesExit.java interface, see ProtocolBridgePropertiesExit: Looking up protocol file server properties.

To run your exit, complete the following steps:

Procedure

  1. Compile the protocol server properties user exit.
  2. Create a Java archive (JAR) file containing the compiled exit and its package structure.
  3. Put the JAR file containing the exit class in the exits directory of the protocol bridge agent . This directory is found in the MQ_DATA_PATH/mqft/config/coordination_queue_manager/agents/bridge_agent_name directory.
  4. Edit the property file of the protocol bridge agent to include the property protocolBridgePropertiesExitClasses. For the value of this property, specify a comma-separated list of classes that implement a protocol bridge server properties user exit. The exit classes are called in the order that they are specified in this list. For more information, see The MFT agent.properties file.
  5. You can optionally specify the protocolBridgePropertiesConfiguration property. The value you specify for this property is passed in as a String to the initialize() method of the exit classes specified by protocolBridgePropertiesExitClasses. For more information, see The MFT agent.properties file.

Using the sample user exit

About this task

A sample user exit that looks up protocol bridge properties is provided in the MQ_INSTALLATION_PATH/mqft/samples/protocolBridge directory and in the topic Sample protocol bridge properties user exit.

The SamplePropertiesExit2.java exit reads a properties file that contains properties for protocol servers. The format of each entry in the properties file is as follows:

serverName=type://host:port
The location of the properties file is taken from the protocol bridge agent property protocolBridgePropertiesConfiguration.

To run the sample user exit, complete the following steps:

Procedure

  1. Compile the SamplePropertiesExit2.java file.
  2. Create a JAR file containing the compiled exit and its package structure.
  3. Put the JAR file in the MQ_DATA_PATH/mqft/config/coordination_queue_manager/agents/bridge_agent/exits directory.
  4. Edit the MQ_DATA_PATH/mqft/config/coordination_queue_manager/agents/bridge_agent_name/agent.properties file to contain the line:
    
    protocolBridgePropertiesExitClasses=SamplePropertiesExit2
    
  5. Create a protocol bridge properties file, for example protocol_bridge_properties.properties, in the directory MQ_DATA_PATH/mqft/config/coordination_queue_manager/agents/bridge_agent. Edit this file to include entries in the format:
    
    serverName=type://host:port
  6. Edit the MQ_DATA_PATH/mqft/config/coordination_queue_manager/agents/bridge_agent/agent.properties file to contain the line:
    
    protocolBridgePropertiesConfiguration=MQ_DATA_PATH/mqft/config/coordination_queue_manager/
    agents/bridge_agent/protocol_bridge_properties.properties
    You must use the absolute path to the protocol_bridge_properties.properties file.
  7. Start the protocol bridge agent by using the fteStartAgent command.