diff --git a/config/config_defaults.go b/config/config_defaults.go index 17d0c365c..571122576 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -377,8 +377,8 @@ const CGRATES_CFG_JSON = ` // AMQP // "consumerTag": "cgrates", // the ID of the consumer - // "sqlExchange": "", - // "sqlExchangeType": "", + // "amqpExchange": "", + // "amqpExchangeType": "", // "amqpRoutingKey": "", // "exchangeProcessed": "", @@ -487,8 +487,8 @@ const CGRATES_CFG_JSON = ` // AMQP // "amqpQueueID": "cgrates_cdrs", // the queue id for AMQP exporters from were the events are exported // "amqpRoutingKey": "", // RoutingKey - // "sqlExchange": "", // Exchange - // "sqlExchangeType": "", // ExchangeType + // "amqpExchange": "", // Exchange + // "amqpExchangeType": "", // ExchangeType // SQS and S3 diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index dbd845cd2..9ed164621 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -356,8 +356,8 @@ // // AMQP // // "consumerTag": "cgrates", // the ID of the consumer -// // "sqlExchange": "", -// // "sqlExchangeType": "", +// // "amqpExchange": "", +// // "amqpExchangeType": "", // // "amqpRoutingKey": "", // // "exchangeProcessed": "", diff --git a/data/conf/samples/cdrsexport_internal/cgrates.json b/data/conf/samples/cdrsexport_internal/cgrates.json index cd56ee3da..036dea293 100644 --- a/data/conf/samples/cdrsexport_internal/cgrates.json +++ b/data/conf/samples/cdrsexport_internal/cgrates.json @@ -65,8 +65,8 @@ "export_path": "amqp://guest:guest@localhost:5672/", "opts": { "amqpQueueID": "cgrates_cdrs", - "sqlExchange": "exchangename", - "sqlExchangeType": "fanout", + "amqpExchange": "exchangename", + "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs" }, "tenant": "cgrates.org", diff --git a/data/conf/samples/cdrsexport_mongo/cgrates.json b/data/conf/samples/cdrsexport_mongo/cgrates.json index dd48d11ab..ec701b492 100644 --- a/data/conf/samples/cdrsexport_mongo/cgrates.json +++ b/data/conf/samples/cdrsexport_mongo/cgrates.json @@ -70,8 +70,8 @@ "export_path": "amqp://guest:guest@localhost:5672/", "opts": { "amqpQueueID": "cgrates_cdrs", - "sqlExchange": "exchangename", - "sqlExchangeType": "fanout", + "amqpExchange": "exchangename", + "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, "tenant": "cgrates.org", diff --git a/data/conf/samples/cdrsexport_mysql/cgrates.json b/data/conf/samples/cdrsexport_mysql/cgrates.json index 2ca4d0156..42a13c251 100644 --- a/data/conf/samples/cdrsexport_mysql/cgrates.json +++ b/data/conf/samples/cdrsexport_mysql/cgrates.json @@ -67,8 +67,8 @@ "export_path": "amqp://guest:guest@localhost:5672/", "opts": { "amqpQueueID": "cgrates_cdrs", - "sqlExchange": "exchangename", - "sqlExchangeType": "fanout", + "amqpExchange": "exchangename", + "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, "tenant": "cgrates.org", diff --git a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json index 856cffdc1..594b3bbdd 100644 --- a/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mongo/cdrsreplicationmaster.json @@ -79,8 +79,8 @@ "export_path": "amqp://guest:guest@localhost:5672/", "opts": { "amqpQueueID": "cgrates_cdrs", - "sqlExchange": "exchangename", - "sqlExchangeType": "fanout", + "amqpExchange": "exchangename", + "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, "tenant": "cgrates.org", diff --git a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json index 3083cfc1f..4481bce3b 100644 --- a/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json +++ b/data/conf/samples/cdrsonexpmaster_mysql/cdrsreplicationmaster.json @@ -77,8 +77,8 @@ "export_path": "amqp://guest:guest@localhost:5672/", "opts": { "amqpQueueID": "cgrates_cdrs", - "sqlExchange": "exchangename", - "sqlExchangeType": "fanout", + "amqpExchange": "exchangename", + "amqpExchangeType": "fanout", "amqpRoutingKey": "cgr_cdrs", }, "tenant": "cgrates.org", diff --git a/ees/filecsv.go b/ees/filecsv.go index 0e1bd5205..f25182314 100644 --- a/ees/filecsv.go +++ b/ees/filecsv.go @@ -68,6 +68,9 @@ func (fCsv *FileCSVee) init() (err error) { if len(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].FieldSep) > 0 { fCsv.csvWriter.Comma = rune(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].FieldSep[0]) } + if fieldSep, has := fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Opts[utils.CSV+utils.FieldSepOpt]; has { + fCsv.csvWriter.Comma = rune(utils.IfaceAsString(fieldSep)[0]) + } return fCsv.composeHeader() } diff --git a/engine/poster_test.go b/engine/poster_test.go index 687e669b0..d52cfb428 100644 --- a/engine/poster_test.go +++ b/engine/poster_test.go @@ -37,10 +37,10 @@ func TestAMQPPosterParseURL(t *testing.T) { routingKey: "CGRCDR", } opts := map[string]interface{}{ - "amqpQueueID": "q1", - "sqlExchange": "E1", - "amqpRoutingKey": "CGRCDR", - "sqlExchangeType": "fanout", + "amqpQueueID": "q1", + "amqpExchange": "E1", + "amqpRoutingKey": "CGRCDR", + "amqpExchangeType": "fanout", } amqp.parseOpts(opts) if !reflect.DeepEqual(expected, amqp) { diff --git a/ers/amqp_it_test.go b/ers/amqp_it_test.go index 43c09db47..210e58689 100644 --- a/ers/amqp_it_test.go +++ b/ers/amqp_it_test.go @@ -46,8 +46,8 @@ func TestAMQPER(t *testing.T) { "opts": { "amqpQueueID": "cdrs3", "consumerTag": "test-key", - "sqlExchange": "test-exchange", - "sqlExchangeType": "direct", + "amqpExchange": "test-exchange", + "amqpExchangeType": "direct", "amqpRoutingKey": "test-key", }, "processed_path": "", // move processed data here diff --git a/utils/consts.go b/utils/consts.go index e081f6829..7dc3204fa 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -2543,8 +2543,8 @@ const ( // General constants for posters DefaultQueueID = "cgrates_cdrs" DefaultExchangeType = "direct" - Exchange = "sqlExchange" - ExchangeType = "sqlExchangeType" + Exchange = "amqpExchange" + ExchangeType = "amqpExchangeType" RoutingKey = "amqpRoutingKey" // for ers: @@ -2567,6 +2567,9 @@ const ( S3Bucket = "s3BucketID" SQSQueueID = "SQSQueueID" + + //CSV + FieldSepOpt = "FieldSeparator" ) // Analyzers constants