Skip to main content

Interceptor Configuration

Interceptors can be customized through configuration fields that control their behavior, data handling, and execution model. Each interceptor type (HTTP or Real-time) has its own set of fields, but some options are common across all.

Each interceptor requires a set of configuration fields that define its type, behavior, and execution model. Depending on whether you configure a real-time or HTTP interceptor, the required fields vary.

  1. Select the Interceptors option from side-menu item.
  2. Click on the Add button in top right corner.
Figure 3: Create new Interceptor

Figure 3: Create new Interceptor

  1. In the dialog, enter the Name for your interceptor.
  2. Select the Interceptor Type (realtime or http). Based on the interceptor type:
  • For HTTP Interceptors - Fill in the endpoit URL, headers and body template.
  • For Real-time Interceptors - Provide Input Parameters schema for validation.
  1. Choose whether the interceptor should run in Synchronous or Asynchronous mode.
  2. Set the Optional flag:
  • Enabled - The pipeline continues even if this interceptor fails.
  • Disabled - The pipeline stops if this interceptor fails.
  1. Configure the Load Distributor option if you want traffic to be distributed across multiple instances.
Figure 4: Add Interceptor

Figure 4: Add Interceptor

  1. Review your configuration and click Add to save the interceptor.

HTTP Interceptors

When you select HTTP as the interceptor type, you must configure the following fields. These fields define how your messages are forwarded to an external HTTP service and how that service is expected to respond.

Endpoint URL

This is the destination endpoint where intercepted messages will be forwarded. It must be a valid HTTP or HTTPS URL. The interceptor sends every message to this endpoint. If the URL is wrong or unreachable, messages will fail.

https://your-company.com/interceptor/custom-interceptor

Headers

Headers are key–value pairs added to every HTTP request. They are often used for authentication, content negotiation, or custom metadata. Without proper headers, many APIs will reject your request (e.g., missing Authorization).

{
"Authorization": "Bearer <access-token>",
"Content-Type": "application/json",
}

Body

The request body defines the payload sent to the HTTP service. It can contain placeholders that will be replaced with actual message data at runtime. The external service expects a specific data structure. If your request doesn’t match, the service won’t process it correctly. Here's an example:

{
"message_id": "{{id}}",
"from": "{{from_username}}",
"to": "{{to_username}}",
"channel": "{{channel}}",
"payload": "{{data}}"
}

Real-time Interceptors

When you select Realtime as the interceptor type, the system expects configuration that enables validation and processing of messages as they flow over live connections (e.g., WebSocket, SSE). Unlike HTTP interceptors, real-time interceptors operate within the persistent pipeline, so configuration is focused on message schema validation and execution behavior.

Input Params

You need to provide A JSON schema that defines the expected structure of incoming messages. This ensures that every message matches required fields and types before being processed further. This prevents malformed or unexpected data from entering the pipeline, which improves reliability and safety.

{
"event": { "type": "string", "required": true, "enum": ["message", "typing", "presence"] },
"sender_id": { "type": "string", "required": true },
"payload": { "type": "object", "required": false }
}

Is Async

This field determines whether the interceptor runs synchronously (blocking) or asynchronously (non-blocking).

  • Synchronous (false) - Message flow pauses until the interceptor finishes processing.
  • Asynchronous (true) - Message flow continues while interceptor processes in the background

Is Optional

This controls whether message delivery should continue if the interceptor fails. If the interceptor is checked to be optional, failures in interceptor are ignored, and the message is still delivered.

warning

You have to be careful while choosing as this makes the interceptor logic optional for pipeline

Load Distributor

Enabling load balancer helps balance traffic when interceptors are deployed in multiple containers or servers. Though ART efficiently manages the traffic to certain extent, enabling it in production helps with the high-traffic pipelines.