Integrating the gateway with Apache Pulsar

The Message Bus Gateway can be configured as a Pulsar producer to send messages to the Pulsar broker.

The Message Bus Gateway connects to Apache Pulsar using the Pulsar transport.

Configuring the Message Bus Gateway to exchange messages with Apache Pulsar

The following configuration files are supplied with the gateway for the integration with Apache Pulsar:
  • G_XML.props
  • pulsarTransport.properties
  • pulsarConnectionProperties.json
  • pulsarClient.properties
  • pulsarProducer.properties

To configure the Message Bus Gateway to publish Apache Pulsar events, use the following steps:

  1. Install/update the Message Bus Gateway. See Installing the gateway.
  2. 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

  3. Update the following property values with the appropriate path:
    Gate.XMLGateway.TransportFile		: '$OMNIHOME/java/conf/pulsarTransport.properties'
    Gate.XMLGateway.TransportType		: 'PULSAR'
  4. Configure the Pulsar transport properties.
    1. Edit the Pulsar transport configuration in the following transport properties file:

      $OMNIHOME/java/conf/pulsarTransport.properties

    2. Update the following property value with the appropriate path:
      PulsarClientMode=PRODUCER
      connectionPropertiesFile=$OMNIHOME/java/conf/pulsarConnectionProperties.json
  5. For descriptions of the Pulsar transport properties, see the The pulsarTransport.properties file.
  6. Update the paths of the pulsarClient.properties, pulsarConsumer.properties, and pulsarProducer.properties files. The paths of these properties files are specified in the following JSON file:

    $OMNIHOME/java/conf/pulsarConnectionProperties.json

    Note: The location of pulsarConnectionProperties.json is specified in pulsarTransport.properties.
  7. Uncomment and populate the following fields in the pulsarClient.properties file to connect to the Pulsar client.
    # Service URL provider for Pulsar service
    # serviceUrl=pulsar://localhost:6650
    
    # Name of the authentication plugin
    # authPluginClassName=
    
    # String represents parameters for the authentication plugin. Example key1:val1,key2:val2
    # authParams=
    
    # Path to the trusted TLS certificate file
    # tlsTrustCertsFilePath=
    
    # Whether the Pulsar client accepts untrusted TLS certificate from broker
    # tlsAllowInsecureConnection=false
    
    # Whether to enable TLS hostname verification
    # tlsHostnameVerificationEnable=false
  8. Uncomment and populate the following fields in the pulsarProducer.properties file to send messages to the Pulsar broker.
    # Topic name
    # topicName=
    
    # Producer name
    # producerName=
    
    # Message send timeout in ms
    # sendTimeoutMs=
    
    # If true, when the outgoing message queue is full, producer will be blocked, rather than failing and throwing errors
    # If false, when the outgoing message queue is full, producer will throw ProducerQueueIsFullError exceptions
    # blockIfQueueFull=
    
    # The maximum size of a queue holding pending messages
    # maxPendingMessages=
    
    # Enable batching of messages
    # batchingEnabled=
    
    # Batching time period of sending messages
    # batchingMaxPublishDelayMicros=
    
    # The maximum number of messages permitted in a batch
    # batchingMaxMessages=
    
    
    # Message data compression type used by a producer
    # compressionType=
    
    CAUTION:
    There is currently a known security issue about Pulsar compression. To mitigate the risk, do not use compression until the next release of the gateway. For now, leave compressionType commented.
  9. Run the gateway using the following command:

    $OMNIHOME/bin/nco_g_xml -propsfile $OMNIHOME/etc/G_XML.props

    .
    Note: The gateway property file must be copied over from $OMNIHOME/gates/xml to $OMNIHOME/etc if it is going to be run from that directory.