Apache Kafka Targets for Replication Flows

If you use Apache Kafka as the target for your replication flow, you need to consider the following additional specifics and conditions.

Prerequisites

Additional Considerations

  • Each record from the source system is transferred into a single message in the target topic. The key of the messages is the combination of all primary key values of the record concatenated by "_".

  • Schema registries are not supported. If you choose AVRO as the serialization format, the schema is contained in every message. For the JSON serialization format, no schema information is provided.

  • The target container is automatically set to "/" because Kafka does not have a superordinate container layer.
  • The following decimal floating point and fixed point decimal values may be clamped according to the data type used in the target serialization:
    • decfloat16 and decfloat34 are clamped to DECIMAL(28,6) and DECIMAL(38,6), respectively, for AVRO and to double range (set to +-inf) for JSON.

    • DECIMAL(p,s) is clamped to double range (set to +-inf) for JSON.

    • You can rename target objects (Kafka topics). The following conditions apply:
      • The new name may consist of the following characters: small latin letters (a-z), capital latin letters (A-Z), numbers (0-9), period (.), underscore (_), hyphen (-).

      • The maximum length for the new name is 249 characters.

      For more information and examples, see also SAP Datasphere Replication Flows Blog Series Part 3 – Integration with Kafka.Information published on SAP site and Confluent as Replication TargetInformation published on SAP site.

Additional Properties

In addition to the properties that apply to all targets (see the list in Creating a Replication Flow), there are the following properties that are only relevant for Apache Kafka. You can review and change these properties for the replication flow itself (by choosing (Browse target settings)) or for individual replication objects (by selecting an object so that its properties get displayed in the side panel).

Property

Description

Number of Partitions

Enter the number of Kafka partitions to be used for the Kafka topic.

Replication Factor

Enter the Kafka replication factor to be used for the Kafka topic.

Message Encoder

Select the message format for the Kafka topic.

You can choose between AVRO and JSON [default]. If you select AVRO, the column name must consist of only alphanumeric and underscore characters, and it must start with a letter or an underscore.

Message Compression

Select the message compression type. You can choose between No Compression [default], Gzip, Snappy, LZ4, and ZStandard.

Additional Message Headers

Each topic contains the source columns as defined in the mapping for the replication object in the replication flow. The system appends the following columns:

  • kafkaSerializationType: AVRO or JSON

  • OpType: Identifies the type of target row:

  • __operation_type: Identifies the type of target row:

    __operation_type

    Description

    From Source System Connection Types

    Comments

    L

    Written as operation type for all records during the initial load phase.

    All

     

    I

    New source row added during delta load phase.

    All except SAP S/4HANA on-prem/cloud and ABAP.

     

    U

    Update (after image) to a source row during delta load phase.

    All except SAP S/4HANA on-prem/cloud and ABAP.

     

    U or A

    New source row or update to a source row during delta load phase.

    SAP S/4HANA on-prem/cloud and ABAP and Datasphere delta enabled local table.

    SAP S/4HANA and other ABAP sources do not distinguish between Insert and Update, and both operations are identified as U (Upserts). If you apply SAP Note 3044005 Information published on SAP site the system identifies all Upserts as A (Autocorrect). The APE_KEEP_UPDATE_OPERATION parameter is described in the SAP Note.

    B

    Update (before image) of an update to a source row during delta load phase.

    SAP HANA cloud/on-prem, Azure SQL, MSSQL.

    These records are only sent by some sources and only when the after-image of the update does not pass the filters specified in the replication task.

    X

    The Source row is deleted (with primary key values only) during the delta load phase.

    All except Datasphere delta enabled local table and Confluent depending on opcode specification.

    The only target columns to contain data for this operation code are codes that reflect the source key columns. All other target columns are empty.

    D

    The Source row is deleted with before image values during delta load phase.

    Datasphere Delta enabled local table, and Confluent - depending on opcode specification.

    Delete record contains the before image values.

    M

    Archiving operations after the initial load is complete.

    SAP S/4HANA on-prem/cloud and ABAP Datasphere Delta enabled local table.

     
  • Seq: Sequence number, an integer value that reflects the sequential order of the delta row in relation to other deltas. This column is empty for initial load rows and is not populated for all source systems (for example, ABAP).

Data Types

The following table shows how internal data types are mapped to Apache Kafka target data types for both AVRO and JSON formats.

SAP Datasphere

AVRO Data Type

JSON Data Type

binary

bytes

String (base64-encoded)

boolean

boolean

Boolean

date

int (date)

String (YYYY-MM-DD)

decimal(p,s)

bytes (DECIMAL p,s)

Number

decfloat16

bytes (DECIMAL 28,6)

Number

decfloat34

bytes (DECIMAL 38,6)

Number

float32

float

Number

float64

double

Number

int8

int

Number

int16

int

Number

int32

int

Number

int64

long

Number

string

string

String

time

long (timestamp-micros)

String (HH:MM:SS.NNNNNNNNNN)

timestamp

long (timestamp-micros)

String (YYYY-MM-DD HH:MM:SS.NNNNNNNNNN)

uint8

int

Number

uint64

bytes (DECIMAL 20,0)

Number