Configuring the gateway to produce JSON data

To configure the gateway to produce JSON data, use the following steps:

  1. Edit the gateway configuration in the following gateway properties file:

    $OMNIHOME/gates/<arch>/G_XML.props

    Where <arch> is the architecture directory, for example linux2x86.

  2. Set Gate.XMLGateway.TransformerInputType to json:
    Gate.XMLGateway.TransformerFile      : '$OMNIHOME/java/conf/transformers.xml'
    Gate.XMLGateway.TransformerInputType : 'json'
    
  3. Make the following configuration settings in the transformer file:

    Configure the host and port to be consistent with the host and port in the httpTransport.properties file.

    <tns:transformer name="netcoolEvents" type="northbound" endpoint="http://host:port/" className="com.ibm.tivoli.netcool.integrations.transformer.EmptyTransformer">
    </tns:transformer>
    

    If Message Bus Probe is run as the consumer for JSON formatted events sent from this gateway, the probe's transformer file requires the following configuration:

    <tns:transformer name="netcool2nvpairs" type="southbound" endpoint="http://host:port/" className="com.ibm.tivoli.netcool.integrations.transformer.XSLTTransformer"> 
    	<tns:property name="xsltFilename" type="java.lang.String" value="${OMNIHOME}/java/conf/netcool2nvpairs.xsl" description="XSLT file for converting Netcool events to name/value pairs"/> 
    </tns:transformer>
    
  4. Configure the transport properties.
    1. For the HTTP transport, edit the following transport properties file:

      $OMNIHOME/java/conf/httpTransport.properties

      The following configuration is the minimum requirement when batch mode is ON with the JSON payload. By default, batch mode is ON with bufferSize=10. To disable batch mode, set bufferSize=1. All other property values in the default httptransport.properties file already include the minimum requirement for single JSON event functionality:

      bufferSize=15
      bufferFlushTime=30
      batchHeader=[
      batchFooter=]
      batchSeparator=,
    2. For the File transport, edit the following transport properties file:

      $OMNIHOME/java/conf/filetransport.properties

      In this file, the client should also be set to read from the JSON file:
      jsonFilename=${OMNIHOME}/var/jsonAlarm.txt
    Note: The configuration in all other transports remains unchanged.