Commit Graph

13699 Commits

Author SHA1 Message Date
ionutboangiu
5f079fbca8 Update kafka ansible role
- use kraft instead of zookeeper
- add handlers in case of cfg changes
- create a separate user for the kafka service
- bump kafka version
- make the role more configurable
2023-10-17 17:39:14 +02:00
ionutboangiu
2867942ebe Update AMQP message processing loop
Previously, msg.Ack(true) was used, which is mostly used for batch
processing. It mistakenly acknowledged all previously unacknowledged
messages, causing errors from the AMQP server. Now, messages are
acknowledged individually after each one is processed.

Messages that ERs failed to process are now rejected and requeued
for future processing attempts.

The reader is now closed immediately if the message delivery
channel closes. Therefore, it prevents an endless loop by avoiding
continuous consumption from empty or closed channels.

Addresses: #4146
2023-10-16 18:57:16 +03:00
ionutboangiu
20f1442683 Update rabbitmq role for latest debian/ubuntu compatibility 2023-10-16 18:57:16 +03:00
ionutboangiu
b09512a5c5 Implement *strip converter + tests 2023-10-09 21:08:28 +02:00
ionutboangiu
efcb32741a Run gofmt 2023-09-28 20:48:39 +02:00
ionutboangiu
d59025e75f Update integration_tests ansible playbook to use roles 2023-09-28 20:48:39 +02:00
ionutboangiu
1563947f9d Update default cgrates.json 2023-09-28 20:48:39 +02:00
ionutboangiu
c2caaba4e1 Import github workflows 2023-09-28 20:48:39 +02:00
ionutboangiu
bbf1eaf439 Import ansible roles 2023-09-28 20:48:39 +02:00
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
arberkatellari
fdadd1ab81 Improve functionality for Drone CI 2023-09-26 21:30:25 +02:00
NikolasPetriti
8ef305d64c Add coverage tests for utils and config 2023-09-12 18:10:23 +02:00
NikolasPetriti
24dde0f351 Add coverage tests for config 2023-09-11 12:20:45 +02:00
NikolasPetriti
c474c9b8af Add coverage tests for config 2023-09-06 19:12:44 +03:00
arberkatellari
1445fa3b49 Renew Drone CI 2023-09-01 18:01:43 +02:00
NikolasPetriti
61a781675c Fix comment in models 2023-08-29 17:00:14 +02:00
NikolasPetriti
039b4269e8 Add tests for msgpack encoding/decoding for all basic go types that we are using in 1.0 2023-08-29 17:00:14 +02:00
NikolasPetriti
512f0a7c2d Revise struct tags for tp models 2023-08-29 17:00:14 +02:00
arberkatellari
770454c007 Renew DlgList, DNSAgent & add SRV/A support 2023-08-28 12:27:53 +02:00
arberkatellari
6eda4303f5 Revise DNS Agent and Service 2023-08-28 12:27:53 +02:00
gezimbll
990feb0f26 fixing tests for ees 2023-08-02 16:49:33 +02:00
gezimbll
16238fb3cb Added sentrypeercfg tests 2023-08-02 16:49:33 +02:00
gezimbll
7cb144f57b Added sentrypeer filter type 2023-08-02 16:49:33 +02:00
gezimbll
5b5a159706 Added sentrypeer filter type 2023-08-02 16:49:33 +02:00
arberkatellari
fcaa3fb360 Make RandomInteger() return int64 2023-07-21 09:03:22 +02:00
ionutboangiu
f81aba7480 Add integration test for the shared client deadlock issue 2023-07-10 13:55:06 +02:00
gezimbll
fcc9fc109b Updated go-elasticsearch client 2023-07-04 13:18:54 +02:00
gezimbll
2e96f02be4 Fix message on agents logs 2023-06-22 10:38:21 +02:00
arberkatellari
d501e3d34a Add coverage tests in engine 2023-05-31 17:03:50 +02:00
arberkatellari
4cc5fa8a01 Add coverage tests for engine 2023-05-31 17:03:50 +02:00
arberkatellari
245a27acb1 Add coverage tests for engine 2023-05-31 17:03:50 +02:00
ionutboangiu
113e2a2bdf Replace interface{} with any 2023-05-31 10:22:28 +02:00
ionutboangiu
1d7bd1389b Add implementation for ordered map 2023-05-31 10:22:28 +02:00
arberkatellari
61fa86126f Add coverage tests for engine 2023-05-25 08:51:59 +02:00
gezimbll
af13805a60 Fix cloning of variables with independent copy 2023-05-25 07:55:35 +02:00
gezimbll
5837b37566 Fix cloning of variables with independent copy 2023-05-25 07:55:35 +02:00
arberkatellari
23d026a7f9 Add coverage tests for engine 2023-05-23 08:22:14 +02:00
arberkatellari
6d167af009 Add coverage tests for engine 2023-05-18 19:29:02 +02:00
arberkatellari
ad6f3be8cb Add coverage tests for engine 2023-05-18 19:29:02 +02:00
arberkatellari
cfc8bc3dfd Add coverage tests for engine 2023-05-18 19:29:02 +02:00
arberkatellari
060961c6c0 Add coverage tests for engine 2023-05-18 19:29:02 +02:00
arberkatellari
59aad8dea4 Add coverage tests to engine 2023-05-18 19:29:02 +02:00
arberkatellari
9b5f594402 Add coverage tests for engine 2023-05-10 10:40:29 +02:00
arberkatellari
29e66e0390 Add coverage tests for engine 2023-05-10 10:40:29 +02:00
arberkatellari
f57a659b7b Add coverage tests for engine 2023-05-07 19:26:16 +02:00
arberkatellari
44690a658d Add coverage tests for engine 2023-05-07 19:26:16 +02:00
arberkatellari
5561ac6f9e Add coverage tests for engine 2023-05-07 19:26:16 +02:00
ionutboangiu
3e22cef9cb Revise integration tests after StorDB addition 2023-05-03 10:05:28 +02:00
ionutboangiu
5227b4d447 Solve compilation errors in tests after CDRs service update 2023-05-03 10:05:28 +02:00
ionutboangiu
85a2e66499 Add unit tests for stordbcfg.go 2023-05-03 10:05:28 +02:00