Running multiple wire listeners

You can run multiple wire listeners.

About this task

By running multiple wire listeners, you can use a combination of the APIs that are supported by the wire listener: MongoDB, REST, and MQTT. Create a configuration file for each listener type that you want to run. For example, you can create a configuration file for the MongoDB API and a configuration file for the REST API or the MQTT protocol. You can start all wire listeners with the same start command by providing multiple -config arguments.

Procedure

  1. Create the individual configuration files in the $INFORMIXDIR/etc directory. You can use the $INFORMIXDIR/etc/jsonListener-example.properties file as a template.
  2. Customize each configuration file and assign a unique name.
    Important: The url parameter must be specified, either in each individual configuration file or in the file that is referenced by the include parameter.
    1. Specify the include parameter to reference an additional configuration file. The path can be relative or absolute. If you have multiple configuration files, you can avoid duplicating parameter settings in the multiple configuration files by specifying a subset of shared parameters in a single configuration file, and the unique parameters in the individual configuration files.
  3. Start the wire listeners.

Example: Running multiple wire listeners that share parameter settings

In this example, the same url, authentication.enable, and security.sql.passthrough parameters are used to run two wire listeners:
  1. Create a configuration file named shared.properties that includes the following parameters:
    url=jdbc:informix-sqli://localhost:9090/sysmaster:INFORMIXSERVER=ol_informix1210;
    authentication.enable=true
    security.sql.passthrough=true
  2. Create a configuration file for use with the MongoDB API that is named mongo.properties, with the parameter include=shared.properties set:
    include=shared.properties
    listener.type=mongo
    listener.port=27017
  3. Create a configuration file for use with the REST API that is named rest.properties, with the parameter include=shared.properties set:
    include=shared.properties
    listener.type=rest
    listener.port=8080
  4. From the command line, run the start command. Include separate -config arguments for each wire listener API type.
    java -jar $INFORMIXDIR/bin/jsonListener.jar
    -config json.properties
    -config rest.properties -start