{
  "PORT": 3001,
  "HOSTNAME": "http://central-ledger",
  "DATABASE": {
    "DIALECT": "mysql2",
    "HOST": "localhost",
    "PORT": 3306,
    "USER": "central_ledger",
    "PASSWORD": "password",
    "SCHEMA": "central_ledger",
    "POOL_MIN_SIZE": 10,
    "POOL_MAX_SIZE": 10,
    "ACQUIRE_TIMEOUT_MILLIS": 30000,
    "CREATE_TIMEOUT_MILLIS": 30000,
    "DESTROY_TIMEOUT_MILLIS": 5000,
    "IDLE_TIMEOUT_MILLIS": 30000,
    "REAP_INTERVAL_MILLIS": 1000,
    "CREATE_RETRY_INTERVAL_MILLIS": 200,
    "DEBUG": false,
    "ADDITIONAL_CONNECTION_OPTIONS": {}
  },
  "MAX_FULFIL_TIMEOUT_DURATION_SECONDS": 300,
  "MIGRATIONS": {
    "DISABLED": false,
    "RUN_DATA_MIGRATIONS": true
  },
  "AMOUNT": {
    "PRECISION": 18,
    "SCALE": 4
  },
  "MONGODB": {
    "DISABLED": true,
    "DEBUG": false,
    "HOST": "objstore",
    "PORT": 27017,
    "USER": "",
    "PASSWORD": "",
    "DATABASE": "mlos"
  },
  "ERROR_HANDLING": {
    "includeCauseExtension": true,
    "truncateExtensions": false
  },
  "HANDLERS": {
    "DISABLED": false,
    "API": {
      "DISABLED": false
    },
    "TIMEOUT": {
      "DISABLED": false,
      "TIMEXP": "*/15 * * * * *",
      "TIMEZONE": "UTC",
      "DIST_LOCK": {
        "enabled": false,
        "lockTimeout": 10000,
        "acquireTimeout": 5000,
        "driftFactor": 0.01,
        "retryCount": 3,
        "retryDelay": 200,
        "retryJitter": 100,
        "redisConfigs": [{ "type": "redis-cluster", "cluster": [{ "host": "localhost", "port": 6379 }] }]
      }
    },
    "SETTINGS": {
      "RULES": {
        "SCRIPTS_FOLDER": "./scripts/transferSettlementTemp",
        "SCRIPT_TIMEOUT": 100,
        "CONSUMER_COMMIT": true,
        "FROM_SWITCH": true
      }
    }
  },
  "INSTRUMENTATION": {
    "METRICS": {
      "DISABLED": false,
      "labels": {
        "fspId": "*"
      },
      "config": {
        "timeout": 5000,
        "prefix": "moja_cl_",
        "defaultLabels": {
          "serviceName": "central-service"
        }
      }
    }
  },
  "PARTICIPANT_INITIAL_POSITION": 0,
  "HUB_PARTICIPANT": {
    "ID": 1,
    "NAME": "Hub",
    "ACCOUNTS": [
      "HUB_RECONCILIATION",
      "HUB_MULTILATERAL_SETTLEMENT",
      "HUB_FEE"
    ]
  },
  "INTERNAL_TRANSFER_VALIDITY_SECONDS": "432000",
  "ENABLE_ON_US_TRANSFERS": false,
  "PAYEE_PARTICIPANT_CURRENCY_VALIDATION_ENABLED": false,
  "CACHE": {
    "CACHE_ENABLED": false,
    "MAX_BYTE_SIZE": 10000000,
    "EXPIRES_IN_MS": 1000
  },
  "PROXY_CACHE": {
    "enabled": true,
    "type": "redis-cluster",
    "proxyConfig": {
      "cluster": [
        { "host": "localhost", "port": 6379 }
      ]
    }
  },
  "API_DOC_ENDPOINTS_ENABLED": true,
  "WINDOW_AGGREGATION": {
    "RETRY_COUNT": 3,
    "RETRY_INTERVAL": 3000,
    "CLOSE_DELAY_MS": 30000
  },
  "DEADLOCK": {
    "RETRIES": 3,
    "RETRY_DELAY_MS": 50
  },
  "KAFKA": {
    "EVENT_TYPE_ACTION_TOPIC_MAP" : {
      "POSITION":{
        "PREPARE": null,
        "FX_PREPARE": "topic-transfer-position-batch",
        "BULK_PREPARE": null,
        "COMMIT": null,
        "BULK_COMMIT": null,
        "RESERVE": null,
        "FX_RESERVE": "topic-transfer-position-batch",
        "TIMEOUT_RESERVED": null,
        "FX_TIMEOUT_RESERVED": "topic-transfer-position-batch",
        "ABORT": null,
        "FX_ABORT": "topic-transfer-position-batch"
      }
    },
    "TOPIC_TEMPLATES": {
      "PARTICIPANT_TOPIC_TEMPLATE": {
        "TEMPLATE": "topic-{{participantName}}-{{functionality}}-{{action}}",
        "REGEX": "topic-(.*)-(.*)-(.*)"
      },
      "GENERAL_TOPIC_TEMPLATE": {
        "TEMPLATE": "topic-{{functionality}}-{{action}}",
        "REGEX": "topic-(.*)-(.*)"
      }
    },
    "CONSUMER": {
      "BULK": {
        "PREPARE": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-bulk-prepare",
              "group.id": "cl-group-bulk-prepare",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "PROCESSING": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-bulk-processing",
              "group.id": "cl-group-bulk-processing",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "FULFIL": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-bulk-fulfil",
              "group.id": "cl-group-bulk-fulfil",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "GET": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-bulk-get",
              "group.id": "cl-group-bulk-get",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        }
      },
      "TRANSFER": {
        "PREPARE": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-prepare",
              "group.id": "cl-group-transfer-prepare",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "GET": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-get",
              "group.id": "cl-group-transfer-get",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "FULFIL": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-fulfil",
              "group.id": "cl-group-transfer-fulfil",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "POSITION": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-position",
              "group.id": "cl-group-transfer-position",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true,
              "enable.auto.commit": false
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        },
        "POSITION_BATCH": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 10,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 10
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-position-batch",
              "group.id": "cl-group-transfer-position-batch",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true,
              "enable.auto.commit": false
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        }
      },
      "ADMIN": {
        "TRANSFER": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cl-con-transfer-admin",
              "group.id": "cl-group-transfer-admin",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        }
      },
      "NOTIFICATION": {
        "EVENT": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "TESTONLY",
              "group.id": "TESTONLY",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        }
      },
      "DEFERREDSETTLEMENT": {
        "CLOSE": {
          "config": {
            "options": {
              "mode": 2,
              "batchSize": 1,
              "pollFrequency": 10,
              "recursiveTimeout": 100,
              "messageCharset": "utf8",
              "messageAsJSON": true,
              "sync": true,
              "consumeTimeout": 1000
            },
            "rdkafkaConf": {
              "client.id": "cs-con-deferredsettlement-close",
              "group.id": "cs-group-deferredsettlement-close",
              "metadata.broker.list": "localhost:9092",
              "socket.keepalive.enable": true,
              "allow.auto.create.topics": true
            },
            "topicConf": {
              "auto.offset.reset": "earliest"
            }
          }
        }
      }
    },
    "PRODUCER": {
      "BULK": {
        "PROCESSING": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-bulk-processing",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        }
      },
      "TRANSFER": {
        "PREPARE": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-transfer-prepare",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        },
        "FULFIL": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-transfer-fulfil",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        },
        "POSITION": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-transfer-position",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        }
      },
      "NOTIFICATION": {
        "EVENT": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-notification-event",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000,
              "log.connection.close": false
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        }
      },
      "ADMIN": {
        "TRANSFER": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cl-prod-transfer-admin",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all",
              "partitioner": "murmur2_random"
            }
          }
        }
      },
      "DEFERREDSETTLEMENT": {
        "CLOSE": {
          "config": {
            "options": {
              "messageCharset": "utf8"
            },
            "rdkafkaConf": {
              "metadata.broker.list": "localhost:9092",
              "client.id": "cs-prod-deferredsettlement-close",
              "event_cb": true,
              "dr_cb": true,
              "socket.keepalive.enable": true,
              "queue.buffering.max.messages": 10000000
            },
            "topicConf": {
              "request.required.acks": "all"
            }
          }
        }
      }
    }
  }
}
