From ccf014451cfa4a44caa765acc21b0e6e0824306b Mon Sep 17 00:00:00 2001 From: andronache Date: Mon, 10 May 2021 12:34:03 +0300 Subject: [PATCH] Finished renaming opts for Event Exporter --- config/config_defaults.go | 12 ++++++------ data/conf/cgrates/cgrates.json | 12 ++++++------ .../cdrsonexpmaster_mongo/cdrsreplicationmaster.json | 2 +- .../cdrsonexpmaster_mysql/cdrsreplicationmaster.json | 2 +- data/conf/samples/ees/cgrates.json | 2 +- ers/sql.go | 1 - 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index 55d20d591..f4a38736d 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -456,19 +456,19 @@ const CGRATES_CFG_JSON = ` // "sqlMaxConnLifetime": 0, // SQLMaxConnLifetime - // "sqlTableName":"cdrs", // the name of the table from where the events are exported - // "dbName": "cgrates", // the name of the database from where the events are exported + // "sqlTableName":"cdrs", // the name of the table from where the events are exported + // "sqlDBName": "cgrates", // the name of the database from where the events are exported // "sslmode": "disable", // the postgresSSLMode for postgres // Kafka - // "topic": "cgrates", // the topic from where the events are exported + // "kafkaTopic": "cgrates", // the topic from where the events are exported // AMQP - // "routingKey": "", // RoutingKey - // "exchange": "", // Exchange - // "exchangeType": "", // ExchangeType + // "amqpRoutingKey": "", // RoutingKey + // "sqlExchange": "", // Exchange + // "sqlExchangeType": "", // ExchangeType // SQS and S3 diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index d42dad635..e97fde0ad 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -356,16 +356,16 @@ // // AMQP // // "consumerTag": "cgrates", // the ID of the consumer -// // "exchange": "", -// // "exchangeType": "", -// // "routingKey": "", +// // "sqlExchange": "", +// // "sqlExchangeType": "", +// // "amqpRoutingKey": "", // // "exchangeProcessed": "", // // "exchangeTypeProcessed": "", // // "routingKeyProcessed": "", // // Kafka -// // "topic": "cgrates", // the topic from were the events are read +// // "kafkaTopic": "cgrates", // the topic from were the events are read // // "groupID": "cgrates", // the group that reads the events // // "maxWait": "1ms", // the maximum amount of time to wait for new data to come @@ -373,11 +373,11 @@ // // SQL -// // "dbName": "cgrates", // the name of the database from were the events are read +// // "sqlDBName": "cgrates", // the name of the database from were the events are read // // "sqlTableName": "cdrs", // the name of the table from were the events are read // // "sslMode": "disable", // the ssl mode for postgres db -// // "dbNameProcessed": "", // the name of the database were the events are sent after they are processed +// // "sqlDBNameProcessed": "", // the name of the database were the events are sent after they are processed // // "sqlTableNameProcessed": "", // the name of the table were the events are sent after they are processed // // "sslModeProcessed": "", // the ssl mode for postgres db diff --git a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json index a05339cd0..6e08411d1 100644 --- a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json @@ -151,4 +151,4 @@ }, -} \ No newline at end of file +} diff --git a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json index f6d0c3c17..6bc469fed 100644 --- a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json @@ -149,4 +149,4 @@ }, -} \ No newline at end of file +} diff --git a/data/conf/samples/ees/cgrates.json b/data/conf/samples/ees/cgrates.json index 55cb64e82..433376128 100644 --- a/data/conf/samples/ees/cgrates.json +++ b/data/conf/samples/ees/cgrates.json @@ -394,7 +394,7 @@ "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { - "dbName": "exportedDatabase", // if dbName is not present "cgrates" will be used as default + "sqlDBName": "exportedDatabase", // if dbName is not present "cgrates" will be used as default "sqlTableName": "expTable", // tableName is mandatory in opts for sql exporter "sslMode": "disable", "sqlMaxIdleConns": "10", diff --git a/ers/sql.go b/ers/sql.go index 1a00dddf7..2bfdbc4ce 100644 --- a/ers/sql.go +++ b/ers/sql.go @@ -327,7 +327,6 @@ func (rdr *SQLEventReader) setURL(inURL, outURL string, opts map[string]interfac rdr.expTableName = utils.CDRsTBL if vals, has := processedOpt[utils.SQLTableNameOpt]; has { rdr.expTableName = utils.IfaceAsString(vals) - } switch rdr.expConnType {