Connect RS Gateway to the Event Repository

Perform this task to configure the RS Gateway to connect to the Event Repository. The Event Repository is separate from MATRIXX Engine and is implemented in MongoDB. For information about configuring user credentials for general ledger (GL) utilities to connect to a MongoDB system, see the discussion about configuring general ledger information processing in

About this task

The Event Repository REST APIs return Event Detail Record (EDRs) and notifications in the Event Repository and in-memory event database for subscribers and groups. The connection credentials are configured in the /opt/mtx/conf/rsgateway.yaml file.

Perform this procedure on the RS Gateway host pod as user MTX. This procedure assumes that the RS Gateway is installed locally.

Procedure

  1. Log in to the MongoDB hosting the Event Repository.
    For example:
     /var/lib/mongo/bin/mongo -u MtxAdmin -p password admin 
  2. Create the MtxApp user. Replace the value of the pwd field with the MtxApp password.
    For example:
    use admin
    
    db.createUser(
        {
            user: "MtxApp",
            pwd: "your_password",
            roles: [{role: "read", db: "MtxEventDatabase"}]
        }
    )
    exit
    
    Important: If special characters, such as a colon (:) or an at-sign (@), are used in the password when creating this MongoDB user, you must encode each special character to URL encoded format (percent encoding) when you set the password in the RS Gateway YAML file. To avoid URL encoding, use only alpha-numeric characters in MongoDB user names and passwords.
    For more information, see the discussion about URL encoding for special characters in MongoDB user names and passwords in MATRIXX Integration.
  3. Access the rsgateway.yaml file located at /opt/mtx/conf/ in the files for your configuration source or ConfigMap. See the discussions about configuring MATRIXX web apps and the provided example for more information.
  4. Configure the MongoDB server that hosts the Event Repository as follows:
    • serverAddress – This is the URL to the server.
    • userName – This is the user credential to access MongoDB.
    • password – This is the user password to access to MongoDB.
    • isDNSSeedList – Whether the serverAddress is a seed list or not for DNS SRV records, the value of the dbServerAddress key corresponds to a DNS SRV record. The default value of the isDNSSeedList key is no. When isDNSSeedList is no, the connection string has the mongodb:// prefix. When isDNSSeedList is yes, the connection string has the mongodb+srv:// prefix.
    • tenants — A list of tenants in a multi-tenant environment.
    • databaseName — In multi-tenant environments, this is the name of the MongoDB database to store the tenant's events. When a new tenant is added to MATRIXX, a MongoDB database is created to store the new tenant's events.
    mongodb:
      serverAddress:     localhost:27017
      userName:          MtxApp
      password:          xxxxxxxx
      isDNSSeedList:     "no"
      tenants:
          - id: foo
            serverAddress:     localhost:27017
            userName:          MtxAppFoo
            password:          xxxxxxxx
            isDNSSeedList:     "no"
            databaseName:      MtxEventDatabaseFoo
          - id: bar
            serverAddress:     localhost:27017
            userName:          MtxAppBar
            password:          xxxxxxxx
            isDNSSeedList:     "no"
            databaseName:      MtxEventDatabaseBar
  5. Set the ServerAddress using the following format:
    host1[: port1][, host2[: port2],...[, hostN[: portX]]][/?replicaSet= name]
    • host1
      • Non-sharded MongoDB deployment — host1 is the IP address or hostname of the server where your MongoDB instances (mongod) are running.
        • One server — host1 is the address of the server where the mongod instance is running.
        • More than one server — host1 is the address of a server where one of the mongod instances in a replica is running.
      • Sharded cluster — host1 is the IP address or hostname of the server where your mongos instance (MongoDB routing process) runs.
    • portX — The port number. If a port is not provided, the default is 27017.
      • Non-sharded MongoDB deployment — portX is the port number on the server where a mongod instance runs.
      • Sharded cluster — portX is the port number on the server where your mongos instance runs.
    • name — The replica set to which to connect.

    See the discussion about administering the Event Repository in MATRIXX Integration for information about Event Repository configuration and password configuration.

  6. Save the file.
  7. Rebuild the configuration image and host it in your image repository.
  8. Update your Helm values file with the new tag for the image, if necessary. See the discussions about configuring MATRIXX web apps and the provided example for more information.
  9. Restart RS Gateway.

MongoDB Address Examples

  • Connect to the local primary mongod running on port 27017:
    serverAddress: localhost:27017
  • Connect to the primary mongod on a remote server:
    serverAddress: 10.10.106.57:27017
  • Connect to a replica set by passing a list of server addresses:
    serverAddress: 10.10.106.57:27017,10.10.106.54:27017,10.10.106.55:27017
  • Connect to a replica set by passing a seed list and the name of the replica set:
    serverAddress: 10.10.106.57:27017,10.10.106.54:27017,10.10.106.55:27017/?replicaSet=MtxEventReplSet
  • Connect to a sharded cluster (connects to the host and port of the server where the mongos instance runs):
    serverAddress: 10.10.176.61:27017