Connectors

Apache Kafka / Confluent Connector

Connect SAP S/4HANA and ECC to Apache Kafka clusters – self-hosted or Confluent Cloud – for high-throughput event streaming. Supports Avro and JSON Schema via Confluent Schema Registry, exactly-once producer semantics, and consumer group management.

Overview

The ASAPIO Kafka connector supports:

Prerequisites

Configuration Parameters

ParameterRequiredDefaultDescription
Bootstrap ServersrequiredComma-separated broker list, e.g. broker1:9093,broker2:9093
Topic NamerequiredKafka topic to produce to (outbound) or consume from (inbound)
Security ProtocolrequiredSASL_SSLPLAINTEXT, SASL_PLAINTEXT, SASL_SSL, or SSL
SASL MechanismconditionalSCRAM-SHA-256PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512. Required if Security Protocol includes SASL.
SASL UsernameconditionalSASL username. For Confluent Cloud: API key.
SASL PasswordconditionalSASL password. For Confluent Cloud: API secret. Stored in SAP Secure Storage.
SSL Truststore (PEM)conditionalCA certificate in PEM format for TLS verification. For Confluent Cloud: not needed (public CA).
SSL Keystore (PEM)conditionalClient certificate (PEM) for mTLS (Security Protocol = SSL). Managed via SAP STRUST.
Schema Registry URLoptionalConfluent Schema Registry URL, e.g. https://psrc-xxxxx.us-east-2.aws.confluent.cloud
Schema Registry API KeyoptionalConfluent Cloud Schema Registry API key. Not needed for self-hosted SR without auth.
Schema Registry API SecretoptionalConfluent Cloud Schema Registry API secret. Stored in SAP Secure Storage.
Consumer Group IDconditionalRequired for inbound. Consumer group ID for this SAP system, e.g. sap-s4h-prd.
Auto Offset Resetoptionallatestearliest (read from beginning) or latest (read only new messages)
Batch Size (inbound)optional1Number of messages to consume per polling cycle (1–500)
Compression TypeoptionalnoneOutbound compression: none, gzip, snappy, lz4
Message Key FieldoptionalSource data field to use as the Kafka message key (for partition ordering)

Confluent Cloud Setup

Create a Confluent Cloud cluster

In the Confluent Cloud console, create a cluster (Basic, Standard, or Dedicated). Note the cluster ID and select the cloud provider and region closest to your SAP system.

Create an API key for the cluster

Go to Data Integration → API Keys → Create Key. Select the cluster scope. Note the Key and Secret – the secret is shown only once. The key is your SASL username; the secret is your SASL password.

Get the bootstrap server URL

In the cluster settings, copy the bootstrap server endpoint. Format: pkc-xxxxx.region.provider.confluent.cloud:9092

Configure Schema Registry (optional)

If using Avro: In the Confluent Cloud console, go to Schema Registry. Create a Schema Registry API key. Note the SR endpoint URL (format: https://psrc-xxxxx.region.provider.confluent.cloud).

In ASAPIO Event Studio, configure the Kafka connector with:

Self-Hosted Kafka Setup

For self-hosted Apache Kafka, SASL/SCRAM-SHA-256 provides a good balance of security and simplicity. For highest security, use mTLS (Security Protocol = SSL) with client certificates managed in SAP's STRUST certificate store.

SASL/SCRAM-SHA-256 broker configuration

# server.properties (relevant settings)
listeners=SASL_SSL://:9093
advertised.listeners=SASL_SSL://broker.example.com:9093
ssl.keystore.location=/etc/kafka/certs/broker.keystore.jks
ssl.truststore.location=/etc/kafka/certs/broker.truststore.jks
sasl.enabled.mechanisms=SCRAM-SHA-256
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256
security.inter.broker.protocol=SASL_SSL

Schema Registry Integration

When Schema Registry is configured, ASAPIO uses Avro serialization instead of JSON. The schema ID is embedded in the first 5 bytes of the Kafka message value (Confluent wire format). ASAPIO resolves the schema from the Schema Registry automatically at runtime.

Example Avro Schema – SAP Material Goods Movement

{
  "type": "record",
  "name": "GoodsMovement",
  "namespace": "com.asapio.sap.s4hana.mm",
  "doc": "SAP S/4HANA goods movement event",
  "fields": [
    {"name": "materialDocument",  "type": "string",  "doc": "SAP material document number"},
    {"name": "postingDate",       "type": "string",  "doc": "ISO 8601 date"},
    {"name": "plant",             "type": "string"},
    {"name": "storageLocation",   "type": "string"},
    {"name": "items", "type": {
      "type": "array",
      "items": {
        "type": "record",
        "name": "GoodsMovementItem",
        "fields": [
          {"name": "material",     "type": "string"},
          {"name": "quantity",     "type": "double"},
          {"name": "unit",         "type": "string"},
          {"name": "movementType", "type": "string"}
        ]
      }
    }}
  ]
}

Schema evolution is supported with BACKWARD compatibility (default). New optional fields with defaults can be added to the schema without breaking existing consumers.

Outbound Example

Scenario: SAP S/4HANA inventory update → Kafka topic sap.mm.goods-movements → downstream data platform (Apache Flink, Databricks, etc.)

Producer configuration applied automatically by ASAPIO:

Inbound Example

Scenario: External order management system publishes purchase orders to Kafka topic external.orders.new → ASAPIO consumer group reads messages → creates SAP Purchase Order via BAPI_PO_CREATE1.

Key inbound configuration:

Performance Tuning

Recommended settings for high-throughput scenarios:

SettingDev / TestProduction (high volume)Notes
Batch Size (outbound)1100–500Higher batch size = higher throughput, slightly higher latency
Compressionnonesnappy or lz4lz4 recommended for best CPU/compression ratio
bgRFC processes210–20Configured in ZASAPIO_CONFIG.MAX_BGRFC_PROCS
Inbound Batch Size150–200Higher batch = fewer SAP dialog interactions per cycle

Expected throughput: 10,000+ events/minute per connector instance with default settings. With batch mode and lz4 compression: 100,000+ events/minute. Actual throughput depends on SAP server capacity, Kafka broker capacity, and message payload size.