CHF CDR Kafka CDR Consumer

The CHF CDR Kafka CDR Consumer is an out-of-box extension that consumes plain Mtx5GMsg compact MDCs (CMDCs) and maps them to Mtx5GMsg charging messages for MATRIXX Engine rating.

Note: If different mapping rules are required than what are provided, you must create a custom extension to support the custom mapping rules. For example, custom Mtx5GMsg records might have extra fields added. A new extension is required for each custom Mtx5GMsg record. For more information about creating a custom extension, see the discussion about creating a custom Kafka CDR Consumer extension.

The following is an example of the Helm values file for configuring CHF CDR Kafka CDR Consumer:

global:
  image:
    registry:
      name: harbor.matrixx-services.com
 
image:
  name: "matrixx-kcc/chf-cdr-consumer"
  version: "5250"  
 
replicaCount: 1
  
# Kafka CDR Consumer App configurations
configuration:
  engine:
    host: "engine.host"
    port: 4060
  consumer:
    rate:
      targetTps: 1000
    kafka:
      topic: rerater_topic
      config:
        bootstrap.servers: kafka1:9092,kafka2:9092,kafka3:9092
        group.id: "cg1"
        max.poll.records: 10
  producer:
    kafka:
      topic: reject_topic
      config:
        bootstrap.servers: kafka1:9092,kafka2:9092,kafka3:9092

In this example, image.name points to the CHF CDR Kafka CDR Consumer image. Update the other values as needed to configure the CHF CDR Kafka CDR Consumer. For information about the properties, see the information about Kafka CDR Consumer properties.

Inputs and Mappings

The supported input message is the CMDCs of Mtx5GMsg. The CMDC message is consumed from a Kafka topic, mapped to Mtx5GMsg, and sent to MATRIXX Engine for rating.

Note: If rating sequences are important, for example, if there are session-based events for which the ACR start event must be rated before interim events, make sure:
  • When producing to the Kafka topic, the same session events are written to the same Kafka topic partition. To do this, set the same Kafka message key value for events from the same session.
  • In Kafka CDR Consumer Helm chart configurations, set the value of configuration.consumer.kafka.config.max.poll.records to 1. For more information about this property, see the discussion about Kafka CDR Consumer properties.
The following actions are performed on each Mtx5GMsg message to mark the request as an offline charging request:
  • RequestedUnit in Mtx5GMsg.Request.MultiUnitUsageArray is removed.
  • All values of QuotaManagementIndicator are set to 2 (OFFLINE_CHARGING) if the source value is 1 (ONLINE_CHARGING). The fields are located under the Mtx5GMsg.Request.MultiUnitUsageArray.UsedUnitContainerArray list.

Error Processing

If an error occurs when a Kafka input message is deserialized or rated, a Kafka message in the following format is produced to reject the Kafka topic:
{
  "rejectCode": code,
  "rejectReason": "rejection_reason_or_exception_message",
   src: "incoming_JSON/raw_Kafka_message_causing_the_failure"
}
where the following are the possible error codes and their meanings:
  • -1 — An exception (for example, a connection timeout) occurred when trying to rate the request.
  • -2 — The incoming Kafka message could not be deserialized.
  • Others — A result code was returned by MATRIXX Engine.