Defining the ingress

The ingress definition specifies the Kafka topic from which inbound events are read. The ingress within the processing application can also apply operations, such as filtering and transforming the events.

The Processing Configuration must define only one ingress instance.

The ingress definition includes the following properties:

  • uid: [required] A unique identifier within the Processing Configuration. See unique ID section at Processing configuration

  • type: [required] The only supported value is kafka.

  • topic: [required] Name of the Kafka topic to consume inbound events from.

  • timestampPath: [optional] JSLT expression that indicates the path to a field containing the timestamp in an inbound event (by default a 'timestamp' field is expected at the root level).

  • selector: [optional] JSLT expression that selects the events to be processed by the current ingress. See Filtering events.

  • transformer: [optional] JSLT expression used to transform the event. See Transforming events.

  • egressRefs: [optional] an array of egress names. If specified this property must contain at least one egress name. Allows you to sink events directly to specified egresses when the processing application uses stateful processing.

JSLT expression can be inline or provided in a separate file. See the jstl section at Processing configuration.

Example of an ingress definition:
{
    "ingresses": [
        {
            "uid": "I0001",
            "type": "kafka",
            "topic": "icp4ba-bai-ingress",
            "timestampPath": {
                "type": "jslt-inline",
                "expression": ".meta.timestamp"
            },
            "selector": {
                "type": "jslt-inline",
                "expression": "test(.type, \"COMPLETED\")"
            },
            "transformer": {
                "type": "jslt-file",
                "filename": "transform-ingress.jslt"
            }
        }
    ],
    "egresses": [
        {
            "uid": "E0001",
            "type": "kafka",
            "name": "kafka-bai-egress",
            "topic": "icp4ba-bai-egress",
            "enabled": true
        }
    ]
}