Looking up protocol file server properties by using exit classes

If you have a large number of protocol file servers and you have enabled the V7.0.4.1 function, you can implement the com.ibm.wmqfte.exitroutine.api.ProtocolBridgePropertiesExit 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. WebSphere® MQ File Transfer Edition 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.ProtocolBridgePropertiesExit. For more information, see ProtocolBridgePropertiesExit.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.

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 configuration_directory/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 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 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 installation_directory/samples/protocolBridge directory and in the topic Sample protocol bridge properties user exit.

The SamplePropertiesExit.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 SamplePropertiesExit.java file.
  2. Create a JAR file containing the compiled exit and its package structure.
  3. Put the JAR file in the configuration_directory/coordination_queue_manager/agents/bridge_agent_name/exits directory.
  4. Edit the configuration_directory/coordination_queue_manager/agents/bridge_agent_name/agent.properties file to contain the line:
    protocolBridgePropertiesExitClasses=SamplePropertiesExit
  5. Create a protocol bridge properties file, for example protocol_bridge_properties.properties, in the directory configuration_directory/coordination_queue_manager/agents/bridge_agent. Edit this file to include entries in the format:
    serverName=type://host:port
  6. Edit the configuration_directory/coordination_queue_manager/agents/bridge_agent/agent.properties file to contain the line:
    protocolBridgePropertiesConfiguration=configuration_directory/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.

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/using_protocol_bridge_props_exits.htm