Commit Graph

314 Commits

Author SHA1 Message Date
ionutboangiu
d0a435aa6d Migrate to new jetstream API
Upgraded go.mod nats version due to an issue caused by version mismatch
between driver and server (uncertain).

Renamed function from getProcessOptions to getProcessedOptions.

## *NatsER.Serve

- Replaced ChanQueueSubscribe with QueueSubscribe for Core NATS consumer
to handle the message processing directly.

- Since QueueSubscribe is now used regardless of jetstream status, the
message handler has been assigned to a separate variable that can be
reused.

-  The message handler is now dealing with the message processing
directly, therefore the select case listening for the channel which is
feeding NATS messages can be removed together with the channel itself
and the select. Currently, the goroutine within Serve only has to block
until the rdrExit chan is closed.

- Moved the resource check inside the handler right before starting the
message processing goroutine.

## *NatsEE.parseOpts

- Renamed function from parseOpt to parseOpts.

- Handled the error coming from GetNatsOpts function.

## *NatsEE.Connect

- Updated function to return early in case of non-nil nats.Conn value
to reduce nesting.

## *NatsEE.ExportEvent

- Use defer to release resources and RUnlock.

## *NatsEE.Close

- Use defer to Unlock.

- Update function to return early in case of nil nats.Conn value to
reduce nesting.

## ees.GetNatsOpts

- Chose switch over if else when parsing client certificate and keys
opts.

- Updated function to return the errors directly instead of assigning
them to a separate variable right before returning.

## ers.GetNatsOpts

- Chose switch over if else when parsing client certificate and keys
opts.

- Updated function to return the errors directly instead of assigning
them to a separate variable right before returning.

Removed tab from commented natsJetStreamMaxWaitProcessed option
value in config_defaults.go under ers section.

Added integration test for ERs NATS.

Updated ees/ers implementation to use the jetstream package which
separates the jetstream context from Core NATS.

Removed the jsOpts fields from the NatsEE struct. We are now using the
jetStreamMaxWait option directly through a timeout context.

Added streamName option for NATS reader since it is now required to be
specified when creating a consumer (it is not inferred based on subject
anymore).

Updated nats ers integration tests.

Updated tests to also use the new jetstream package.

Updated tests to start the nats-server using their official driver
instead of using the std go exec package. time.Sleeps are now not
required anymore to wait for the server.

In test configurations for nats readers, made sure that natsStreamName
option is populated. It is now required for consumers to know where to
subscribe.
2023-09-28 20:48:39 +02:00
ionutboangiu
113e2a2bdf Replace interface{} with any 2023-05-31 10:22:28 +02:00
ionutboangiu
8620b23231 Implement EventExporterCfg constructor and get rid of boilerplate code 2023-03-08 19:12:48 +01:00
ionutboangiu
db3ff231c6 Add options for SASL PLAIN auth (amqp 1.0) 2023-02-22 18:21:10 +01:00
ionutboangiu
73dd31a8ca Update to latest amqp 1.0 package version and fix compilation errors 2023-02-22 18:21:10 +01:00
arberkatellari
8518419a32 Move from streadway/amqp to rabbitmq/amqp091-go 2023-02-08 11:23:59 +01:00
adi
5d23b6433f Chanegd FileName consts into ers 2022-11-20 18:46:55 +01:00
adi
fe3d34639a Fixed tests of cache 2022-09-19 16:39:47 +02:00
ionutboangiu
f3bd4b63c0 Add support for kafka reader ssl encryption 2022-08-24 09:32:23 +03:00
ionutboangiu
0653e9b5d7 Apply go fmt 2022-08-24 09:32:23 +03:00
ionutboangiu
270d6cc3fb Update fwv reader 2022-08-05 14:30:45 +02:00
adi
0eb61c965a Efs tests + improves 2022-07-30 08:19:08 +02:00
adi
a448fb2c7a INtegrated efs in logger/ees + ers changes 2022-07-30 08:19:08 +02:00
adi
86d2f1476a Attemtps config change 2022-07-30 08:19:08 +02:00
ionutboangiu
6bcb9b0008 Switch from redis keys to scan for GetKeys driver + tests and fixes 2022-07-19 17:17:33 +02:00
adi
341f33873b Improved attempts and faield posts dir cfg in action/ers 2022-07-19 17:15:42 +02:00
ionutboangiu
4857245aa5 Use copy instead of loop + other staticcheck fixes 2022-07-15 09:28:57 +02:00
adi
8b14619fce Integrated efs 2022-07-13 19:24:50 +02:00
ionutboangiu
924a91c749 Change SSLMode to PgSSLMode 2022-07-03 13:08:52 +02:00
ionutboangiu
5437b3a8a2 Repair compilation errors after library updates 2022-07-03 13:08:52 +02:00
porosnicuadrian
1e202feb5b TPExporter 2022-03-11 11:21:56 +01:00
andronache98
ecdf5e54ea Changed headers 2022-03-09 14:14:30 +01:00
andronache98
9ec56f5155 Changed headers 2022-03-09 14:14:30 +01:00
andronache98
74d8a61c15 Repaired most integration tests using storDB 2022-03-09 14:14:30 +01:00
andronache98
7e80fe008f Removed cdr struct 2022-02-20 10:38:07 +01:00
andronache98
24a1531c5b Modified tests using *originID in Event 2022-02-06 09:52:26 +01:00
andronache98
bb30b65ef5 Fixed tests using originID in event instead of opts 2022-02-06 09:52:26 +01:00
andronache98
2e4b77e4df Commented CGRID where it is not needed 2022-02-06 09:52:26 +01:00
andronache98
ebfd371bb7 Removed CGRID from Session struct 2022-02-06 09:52:26 +01:00
andronache98
ca839daa29 Changed CGRID to *originID and removed it in most places 2022-02-06 09:52:26 +01:00
ionutboangiu
6d478ec75c Acknowledge AMQP message after processing it 2021-12-23 17:43:23 +01:00
ionutboangiu
b55dc3d3a8 Fix tests after updating loggers 2021-12-19 17:12:47 +01:00
ionutboangiu
8ce6982324 Remove <populated> return parameter from GetProcessOptions 2021-11-01 13:51:02 +02:00
ionutboangiu
79abfa5d8b Add GetNatsOpts function for ers 2021-11-01 13:51:02 +02:00
ionutboangiu
316e9d6f32 Change type of ExportEvent opts to *EventExporterOpts and fix compilation errors 2021-11-01 13:51:02 +02:00
ionutboangiu
ea01cb3582 Revisit getProcessedOptions function after changing ers and ees opts into structs 2021-11-01 13:51:02 +02:00
ionutboangiu
aa46b1eefd Fix compilation errors after making ers opts into structs 2021-11-01 13:51:02 +02:00
ionutboangiu
cd034b6f65 Fix compilation errors after making ees opts into structs (incomplete) 2021-11-01 13:51:02 +02:00
andronache
7ab4167613 Corrected header in multiple files 2021-11-01 13:50:00 +02:00
Trial97
cb809f976e Updated internal datadb 2021-10-28 18:03:43 +03:00
nickolasdaniel
5eeba9277e Finished testing onEvicted cases 2021-10-27 19:49:29 +03:00
nickolasdaniel
6b36f9302f Testing onEvicted DumpToJSON case 2021-10-27 19:49:29 +03:00
nickolasdaniel
89b4f70413 Testing output of onEvicted function in ers without CacheDumpFields 2021-10-27 19:49:29 +03:00
Trial97
7cb1ca95bc Added *dump_to_json as partial cache action 2021-10-22 11:58:12 +03:00
Trial97
5d540bc179 Updated Sessions Auth API 2021-10-05 21:01:26 +02:00
Trial97
6a3f8ddc57 Updated config 2021-09-20 10:45:14 +02:00
Trial97
0ed0b0e7a6 Updated more services 2021-09-13 16:08:39 +02:00
ionutboangiu
141d293217 Make DefaultOpts a struct and move IgnoreErrors, MaxCost and Paginator fields to APIOpts final 2021-09-10 11:25:57 +02:00
Trial97
a3ebbe38ec Added EeSV1 APIs back 2021-09-07 07:44:10 +02:00
Trial97
76bc9f0cd8 Updated nats ERs 2021-08-30 17:53:42 +03:00