Docs / Connectors / Confluent
Confluent Connector
The ASAPIO Integration Add-on connects SAP S/4HANA and SAP ECC directly to Confluent Kafka clusters. Two connector types are available: the REST-based Kafka connector communicates through the Confluent REST Proxy, while the Native Kafka connector communicates directly using the Kafka binary protocol via a sidecar daemon running outside SAP. Both support real-time event streaming for SAP business objects.
Overview
| Component | Type |
|---|---|
| ASAPIO Integration Add-on – Framework | Base component (required) |
| ASAPIO Integration Add-on – Connector for Confluent | Additional package |
| Connector Type | Cloud Type | Handler Class | Protocol |
|---|---|---|---|
| REST Kafka | KAFKA | /ASADEV/CL_ACI_KAFKA_HANDLER | Confluent REST Proxy (HTTP) |
| Native Kafka | S4KAFKA | /ASADEV/CL_S4_KAFKA_HANDLER | Native Kafka binary protocol |
Prerequisites
For the REST connector: A Confluent Kafka cluster with the REST Proxy endpoint reachable from the SAP application server. The REST Proxy must be accessible over HTTPS.
For the Native Kafka connector: The ASAPIO Kafka daemon must be running on a host reachable from SAP. The daemon handles the native Kafka protocol so SAP can publish using standard RFC HTTP calls.
SAP Connection Setup (in SAP Gui) (REST Connector)
The connection setup in SAP GUI is a required first step for all configuration paths. This creates the RFC destination, imports the SSL certificate, activates the BC-Set, and registers the connection instance that both Event Studio and SAP GUI-based event configuration rely on.
Step 1 — Create RFC Destination (SM59)
Create an HTTP connection of type G to the Confluent REST Proxy endpoint. On the Logon & Security tab, enable SSL and enter the Basic Auth credentials (API key and secret) if required.
Step 2 — Import SSL Certificate (STRUST)
In transaction STRUST, import the Confluent TLS certificate and add it to the Certificate List used by the RFC destination.
Step 3 — Import BC-Set (SCPR20)
Import the ASAPIO Kafka framework BC-Set to activate the cloud adapter configuration, codepage definitions, and IDoc segment definitions:
- BC-Set:
/ASADEV/ACI_BCSET_FRAMEWORK_KAFK
Step 4 — Configure Cloud Adapter
In SPRO → ASAPIO Cloud Integrator → Maintain Cloud Adapter, set:
- Cloud Type:
KAFKA - ACI Handler Class:
/ASADEV/CL_ACI_KAFKA_HANDLER - Error Mapping: HTTP 207 → Success
Step 5 — Create Connection Instance
In transaction /ASADEV/ACI_SETTINGS, create a connection instance pointing to the Confluent REST Proxy RFC destination. Set the following default connection values:
| Default Attribute | Value |
|---|---|
KAFKA_ACCEPT | application/vnd.kafka.v2+json |
KAFKA_CALL_METHOD | POST |
KAFKA_CONTENT_TYPE | application/vnd.kafka.json.v2+json (or application/vnd.kafka.jsonschema.v2+json for schema registry) |
Create an outbound interface (Event Studio)
Prerequisite: The connection instance must already be set up in SAP GUI (see SAP Connection Setup above) before Event Studio can be used to configure events.
Event Studio is the recommended web-based interface for creating and managing events. To configure a Confluent/Kafka event:
- Open Event Studio and select the backend SAP system.
- Go to the Data Catalog to find the data object to stream.
- In the Available Standard Events table, click Deploy, or use Create to define a new event.
- Select the Confluent connection from the Connection dropdown — the Header Fields table auto-populates with the connection's default attributes.
- Set
KAFKA_TOPICand any additional header attributes (see below). - Save and activate the event.
After creating the interface in Event Studio, see Header Attributes for message configuration, Batch Job Method for scheduled delivery, Dead Letter Queue for error handling, or Native Kafka Connector for direct protocol integration.
Header Attributes
Configure the following header attributes on each outbound object. Header attributes apply equally when configuring via Event Studio or SAP GUI.
| Header Attribute | Value / Description | Required |
|---|---|---|
KAFKA_TOPIC | Target Kafka topic name | Yes |
KAFKA_KEY_FIELD | Semicolon-separated list of SAP fields to use as the Kafka message key | Optional |
KAFKA_SCHEMA_ID | Schema Registry schema ID for the message value (when using schema registry) | Optional |
KAFKA_KEY_SCHEMA_ID | Schema Registry schema ID for the message key | Optional |
Create an outbound interface (SAP Gui)
| Method | Extraction FM | Formatting FM | Response FM |
|---|---|---|---|
| Simple Notify | /ASADEV/ACI_GEN_NOTIFY_KAFKA | — | /ASADEV/ACI_KAFKA_RESP_HANDLER |
| Message Builder | /ASADEV/ACI_GEN_VIEW_EXTRACTOR | /ASADEV/ACI_GEN_VIEWFRM_KAFKA | /ASADEV/ACI_KAFKA_RESP_HANDLER |
| Packed Load | /ASADEV/ACI_GEN_VIEW_EXT_PACK | /ASADEV/ACI_GEN_VIEWFRM_KAFKA | — |
Create Outbound Object
In transaction /ASADEV/68000202, select the connection instance and add an entry under Outbound Objects. Set the Extraction FM, Message Type, Load Type, and Response Function as shown above. Then add the header attributes under the Header Attributes tab.
Event Linkage (SWE2)
Register the event trigger in transaction SWE2:
- Receiver Function Module:
/ASADEV/ACI_EVENTS_TRIGGER - Tick Type linkage Activated
Packed Load — Header Attributes
| Attribute | Description | Example |
|---|---|---|
ACI_PACK_TABLE | Table for key fields (typically the header table) | MARA |
ACI_PACK_SIZE | Records per delivery package | 500 |
ACI_PACK_KEY_LENGTH | Total length of key fields | 13 |
ACI_PACK_WHERE_COND | Optional WHERE condition on ACI_PACK_TABLE | — |
ACI_PACK_RETRY_TIME | Seconds before retrying server group resource acquisition | 300 |
ACI_PACK_BDCP_COMMIT | Generate change pointers per entry (~50% performance impact) | X |
Batch Job Method
The Batch Job method allows scheduling periodic full or delta loads to Kafka without relying on SAP event linkage. This is useful for initial loads or when real-time event triggers are not feasible.
- In transaction
/ASADEV/ACI, open the replication object and uncheck the Sync.On checkbox. - Create a variant for the report.
- Schedule the job in SM36 using report
/ASADEV/AMR_REPLICATORwith the saved variant.
The extraction FM for batch jobs is /ASADEV/ACI_SYNC.
Dead Letter Queue (DLQ)
The DLQ feature routes failed messages to a dedicated Kafka topic instead of discarding them. This allows downstream systems to inspect, reroute, or replay failed events without losing data.
Configure the following header attributes on the outbound object to enable DLQ:
| Attribute | Value / Description |
|---|---|
DLQ_TOPIC | Kafka topic name to route failed messages to |
DLQ_ERROR_CODES | Comma-separated HTTP error codes that trigger DLQ routing |
DLQ_RETRIES | Number of immediate retries before routing to DLQ |
Native Kafka Connector
The Native Kafka connector uses the binary Kafka protocol directly, bypassing the REST Proxy. A lightweight daemon process handles the native protocol connection outside SAP. SAP communicates with the daemon via a standard HTTP RFC destination.
Cloud Adapter Configuration
- Cloud Type:
S4KAFKA - ACI Handler Class:
/ASADEV/CL_S4_KAFKA_HANDLER
Daemon Default Parameters
Configure the following default values on the Native Kafka connection instance:
| Parameter | Default Value | Description |
|---|---|---|
DAEMON_BUSY_TICK_MS | 50 | Polling interval (ms) when the daemon is actively processing |
DAEMON_IDLE_SLEEP_MS | 300 | Sleep time (ms) when the daemon has no pending messages |
DAEMON_MAX_ITEM_BYTES | 524288 | Maximum size per message item in bytes (512 KB) |
DAEMON_QUEUE_MAX_BYTES | 209715200 | Maximum total queue size in bytes (200 MB) |
DAEMON_QUEUE_MAX_ITEMS | 10000 | Maximum number of items in the daemon queue |
DAEMON_QUEUE_TTL_SEC | 0 | Time-to-live for queued items (0 = no expiry) |
DAEMON_SEND_TIMEOUT_MS | 60000 | Kafka send timeout in milliseconds |
DAEMON_TIMEOUT_CHECK_MS | 1000 | Interval (ms) for checking message timeouts |
KAFKA_USERNAME | — | SASL username for Kafka cluster authentication |
Store the Kafka SASL password in the SAP Secure Store (transaction /ASADEV/SCI_TPW).
Inbound (Kafka to SAP)
The Confluent connector supports inbound message delivery from Kafka topics to SAP via IDoc. Configure the following attributes on the inbound object:
| Attribute | Description | Required |
|---|---|---|
KAFKA_CONTENT_TYPE | Content type of the Kafka message (e.g., application/vnd.kafka.json.v2+json) | Yes |
KAFKA_GROUPNAME | Consumer group name | Yes |
KAFKA_INSTANCE_NAME | Kafka consumer instance name (must be unique per consumer group) | Yes |
KAFKA_DOWNLOAD_TOPIC | Kafka topic to consume from | Yes |
KAFKA_DOWNLOAD_ACCEPT | Accept header value for consumer requests | Optional |
KAFKA_MAX_BYTES | Maximum bytes to fetch per poll request | Optional |
KAFKA_TIMEOUT | Consumer poll timeout in milliseconds | Optional |
KAFKA_CONSUMER_FORMAT | Message format: binary, avro, json, jsonschema, or protobuf | Optional |
KAFKA_CONSUMER_OFFSET_RESET | Offset reset policy: earliest or latest | Optional |
KAFKA_CONSUMER_AUTO_COMMIT | Enable automatic offset commit | Optional |
Inbound Function Modules
| FM | Purpose |
|---|---|
/ASADEV/ACI_SAMPLE_IDOC_JSON | Sample inbound handler — creates an IDoc from a JSON Kafka message |
/ASADEV/ACI_SAMPLE_IDOC_JSON2 | Alternative sample handler with extended JSON mapping |
/ASADEV/ACI_JSON_TO_IDOC | Generic JSON-to-IDoc converter for custom inbound mappings |