Write To Disk

When Kafka is unavailable, the producer continues attempting to send to the Kafka broker until a timeout is reached. On timeout, the records are written to a separate log file on disk.

When gateway.external.kafka.enabled is set to true:

  • SBA Gateway attempts to send to Kafka. If it is unsuccessful, SBA Gateway increments the metric: com.matrixx.cdr.producer.failed.total.
  • A warning of the failure cause is logged. The charging data record (CDR) itself is not added to the logs.

To write records to logs, set gateway.external.kafka.enabled and gateway.external.kafka.logger.enabled to true. When those are set:

  • SBA Gateway attempts to send to Kafka. If it is unsuccessful, SBA Gateway increments metric: com.matrixx.cdr.producer.failed.total.
  • A warning of the failure cause is logged.
  • The CDR itself is added to the logs.
Note: When the Write to Disk feature is enabled, MATRIXX Support strongly recommends that gateway.external.kafka.writeQueueMaxSize be set to an appropriate nonzero value. The Write to Disk feature and a nonzero setting for this property ensure that CDRs which cannot be written to Kafka are written to disk instead, with a threshold set to prevent out-of-memory issues if Kafka is unavailable.

The com_matrixx_cdr_producer_pending metric shows the number of outstanding network CDRs that have not yet been written to Kafka or to disk. The gateway.external.kafka.writeQueueMaxSize property sets a threshold on this value. Because the pending queue is a metric, it requires metrics to be enabled (they are enabled by default). If gateway.external.kafka.writeQueueMaxSize is enabled, do not disable metrics (do not set gateway.external.kafka.metrics.emabled or gateway.monitoring.prometheus.enabled to false).