Routing Properties

You can configure the routes that define the URLs that CHF Proxy exposes and the rules for selecting the URL endpoints.

General Routing Properties describes the general routing properties:

Table 1. General Routing Properties
Name Description
routes.routename.urls A list of the URLs that the route listens on, for example:
routes:
  chargingData:
    urls:
      - /nchf-convergedcharging/v2/chargingdata 
      - /nchf-convergedcharging/v2/chargingdata/:ref/update
      - /nchf-convergedcharging/v2/chargingdata/:ref/release
      - /nchf-convergedcharging/v2/chargingdata/:endpoint/:ref/update
      - /nchf-convergedcharging/v2/chargingdata/:endpoint/:ref/release
routes.routename.extractedFields A map of the fields to be extracted to determine the endpoint to which the request is forwarded, for example:
extractedFields:
      imsi:
        fromMessage:
          jsonPath: $.subscriberIdentifier
          regex: "^imsi\\-(?<value>[0-9]{1,15})$"
routes.routename.routingRules A list of the rules to compare with the extracted fields to determine the endpoint to which the request is forwarded, for example:
routingRules:
      - targetEndpoint: chf-one
        fieldValueMatchingRules:
          - between:
              fieldName: imsi
              lower: 1
              upper: 10
      - targetEndpoint: chf-one
        fieldValueMatchingRules:
          - between:
              fieldName: nai
              lower: 1
              upper: 10
routes.routename.defaultEndpoint The name of the endpoint, for example, chf-two, to which to send the incoming request if none of the rules match. If this property is not specified, a 404 error is returned in the event of no match.
routes.routename.locationHeader.pattern The pattern to use to create the location HTTP header in the response, for example: "%s/nchf-convergedcharging/v2/chargingdata/%s/%s". The pattern must contain three %s placeholders:
  • The first placeholder is replaced with the baseUrl value. For more information, see the discussion about base URL properties.
  • The second placeholder is replaced with the name of the target endpoint selected by the routing rules.
  • The third placeholder is replaced with an identifier.

Specify this property only if the downstream Charging Function (CHF) provides a location header.

routes.routename.locationHeader.strategy The strategy to use to create a location header. The options are:
  • EMBED_PROXIED — The location header returned by the proxied CHF is encoded as base64 and is used as the identifier.
  • PROPAGATE — The identifier from the endpoint of the location header returned by the proxied CHF is extracted and used as the identifier (in effect, the base URL is changed).
  • GENERATE_UI — A new location header is provided with a newly generated UUID.
The default value is PROPAGATE.
routes.routename.callbackUrlJsonPaths A list of JSON paths that identify callback URLs. These values are rewritten in the message that is sent downstream. The original value is encoded into a URL that points to the callback checkpoint of the CHF Proxy. The default value is notifyUri.

A route can define fields to extract from the incoming request to be used in routing rules. These values can be extracted from the message body, URL, or header. Extracted Fields Properties describes the extracted fields properties:

Table 2. Extracted Fields Properties
Name Description
From URL
routes.routename.extractedFields.fieldname.fromUrl.regex The regular expression to use to extract the value from the URL to extract the specified value from IMSI messages, for example, regex: "^imsi\\-(?<value>[0-9]{1,15})$".
routes.routename.extractedFields.fieldname.fromUrl.groupName The name of the group to take the field from if you are using a regular expression that defines named groups. The default value is the value of the fromUrl.defaultValue property.
routes.routename.extractedFields.fieldname.fromUrl.defaultValue The default value to use if the regular expression does not find a match.
From Header
routes.routename.extractedFields.fieldname.fromHeader.headerName The name of the HTTP header to take the value from, for example:
routes:
  chargingData:
    extractedFields:
      myHeader:
        fromHeader:
          headerName: MyHeader
routes.routename.extractedFields.fieldname.fromHeader.regex A regular expression to use to extract the value from the header (if needed).
routes.routename.extractedFields.fieldname.fromHeader.groupName The name of the group from which to take the value if you are using a regular expression that defines named groups. The default value is the value of the fromHeader.defaultValue property.
routes.routename.extractedFields.fieldname.fromHeader.defaultValue The default value to use if the header does not exist or the regular expression does not find a match.
From Message
routes.routename.extractedFields.fieldname.fromMessage.jsonPath A JSON path expression that selects a field from the message body, for example, jsonPath: $.subscriberIdentifier.
routes.routename.extractedFields.fieldname.fromMessage.regex A regular expression to use to extract the value from the path value (if needed) to extract the specified values from NAI messages, for example, regex: "^nai\\-(?<value>.*)$".
routes.routename.extractedFields.fieldname.fromMessage.groupName The name of the group to take the field value from if you are using a regular expression that defines named groups. The default value is the value of the fromMessage.defaultValue property.
routes.routename.extractedFields.fieldname.fromMessage.defaultValue The default value to use if the path does not exist or the regular expression does not find a match.

Each route can have one or more routing rules that compare extracted fields with some conditions. The first rule that matches defines the endpoint to which the message is forwarded.

Routing Rule Properties describes the extracted fields properties:

Table 3. Routing Rule Properties
Name Description
routes.routename.routingRulesx.fieldValueMatchingRules A list of rules that causes the message to be routed to the endpoint if they all match, for example:
routingRules:
      - targetEndpoint: chf-one
        fieldValueMatchingRules:
          - between:
              fieldName: imsi
              lower: 1
              upper: 100
      - targetEndpoint: chf-one
        fieldValueMatchingRules:
          - between:
              fieldName: nai
              lower: 1
              upper: 100
      - targetEndpoint: chf-two
        fieldValueMatchingRules:
          - between:
              fieldName: imsi
              lower: 101
              upper: 200
      - targetEndpoint: chf-two
        fieldValueMatchingRules:
          - between:
              fieldName: nai
              lower: 101
              upper: 200
routes.routename.routingRulesx.targetEndpoint The endpoint to which the incoming message is forwarded if the rule matches, for example, - targetEndpoint: chf-one.
routes.routename.routingRulesx.fieldValueMatchingRulesn.mathes.regex The regular expression that the field value must match.
routes.routename.routingRulesx.fieldValueMatchingRulesn.lower The field value must be greater than or equal to this value. The default value is 0. This property is used with the upper property to define a between rule for matching and routing messages, for example:
- targetEndpoint: chf-one
        fieldValueMatchingRules:
          - between:
              fieldName: nai
              lower: 1
              upper: 100
routes.routename.routingRulesx.fieldValueMatchingRulesn.upper The field value must be less than or equal to this value. The default value is 231-1 (the Java maximum integer). This property is used with the lower property to define a between for matching and routing messages.