Additional changes:
- removed unnecessary locking when initializing the exporter
cache map, as the service itself is responsible for locking.
- separated setupCache method into ClearExporterCache and
SetupExporterCache methods.
- removed idle ListenAndServe function that was only waiting for the
stopChan to close. The reload case was unreachable due to the reload
channel being created in Start instead of being passed down.
- removed Shutdown method on EventExporterS and replaced it with the
exported ClearExporterCache method as it provided the same
functionality.
Git 2.45+ introduced a backward incompatible change in the iso-strict
date format, showing time in the Zulu timezone with Z suffix instead
of +00:00. This commit adds parsing for the new date format before
falling back to the old format.
Ignore errors for old git versions where %cI is not defined.
Revise GetCGRVersion error messages.
Revise GetCGRVersion unit test.
Changed initial *topup action to *topup_reset and increase its weight
to ensure it runs first.
Changed ExpiryTime (inside the *topup_reset action definition) from
*unlimited to +150ms.
Added an extra action trigger to the account to execute ACT_TOPUP_INITIAL
when the balance expires.
Added the following test cases:
- Execute triggers before balance expiry and verify nothing happens.
- Wait for the balance to expire (helper now returns balance expiry
time).
- Execute triggers again and verify if ACT_TOPUP_INITIAL was executed.
Updated connections from *localhost to *internal.
- ERs sometimes took too long to receive a message.
Setting kafkaGroupID to "" prevents this.
- Kafka reader took 10s to close (default MaxWait).
Set MaxWait to 1ms.
- Exporters took 1s each to export due to BatchSize
not being hit. Set BatchSize to 1 to prevent it.
Avoids the default 1 second delay when the batch doesn't
reach 100 messages within that time.
Useful when the Kafka exporter is not cached, as it would
otherwise encounter that delay. Setting BatchSize to 1
prevents this.
- added extra error return parameter to constructor
- failing to parse PEM certificates returns an error (previously nil
return)
- moved Connect logic inside the constructor*
- removed unnecessary fields from poster structure. Use the
configuration fields directly instead.
- removed mutex from poster structure (kafka writer is thread-safe)
- removed nil writer check. Message is exported directly.
- shortened receiver name
(https://google.github.io/styleguide/go/decisions#receiver-names)
*The Kafka Transport is not a connection but a configuration for the
connection created during the first export. The connection and its
related goroutines stay running until manually closed.
- Updated to use the test suite
- Deleted kafka_ssl sample configuration (moved to test file)
- Replaced 'logger' section with 'general' in configuration
- Revised Kafka server SSL setup comment
- Ensured exporters are synchronous to avoid missing errors
- Implemented helper function to create and clean up kafka topics
The *transfer_balance action can now use a reference value to ensure
the destination balance reaches a specified amount. If the destination
balance exceeds the reference value, the excess is transferred back
to the source balance. If the destination balance is below the
reference value, the required amount is transferred from the source
balance to the destination balance to reach the specified reference
value. An error is returned if the transfer cannot achieve the
specified reference value.
Used by specifying DestinationReferenceValue inside ExtraParameters.
Other *transfer_balance changes:
- used json tags when unmarshaling ExtraParameters in order to be
able to shorten the names of the fields
- lock the destination account only if it's different from the
source account. It is still passed to the Guard function but
without a lock key and with 0 timeout.
- if the transfer happens within the same account, update the
account and execute its ActionTriggers only once.
- moved transfer units validation after retrieving/creating the
destination balance
*cdrlog action has been updated to create cdrs for reference
*transfer_balance actions, although improvements are needed and
the functionality is not completely tested.
APIerSv1.TransferBalance has been updated to take into account the
ReferenceValue parameter.
Added new *transfer_balance action unit tests to account for the
new changes.
Added integration tests (incomplete for now, but functionality
has been tested manually).