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
-
Make sure you have created an Apache Kafka connection in Connection Management and that it is available in your space. For more information, see Apache Kafka Connections
-
You must ensure that you connect to a supported Kafka version. See the SAP Note 3806340
. -
You can only use a non-SAP target for a replication flow if your admin has assigned capacity units to Premium Outbound Integration. For more information, see Premium Outbound Integration and Configure the Size of Your SAP Datasphere Tenant.
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.
and Confluent as Replication Target
. -
-
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 ) 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
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
|
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 |