You can use the Apache Kafka Producer adapter to write a message to a Kafka topic.
The Apache Kafka documentation speaks of events that contain a message, or of records in more technical parts of the documentation. This documentation summarizes all under the term "message".
Write a Message
Using the produce operation of the Apache Kafka adapter, you can write a message to a Kafka topic.
Specify headers if you want to provide additional information on the message content for e.g. routing or filtering use cases.
value
Blob
Specify the actual message content. Only payload of type Blob is supported.
The Kafka Producer returns some meta data about the processing of the message.
Attribute
Type
Mandatory
Description
Allowed Values / Examples
topic
String
Kafka topic the message has been sent to.
partition
Integer
Topic partition the message has been sent to.
offset
Integer
Offset of the message within the partition.
recordId
Integer
The message ID as provided with the call, or as generated if it has not been specified.
keySize
Integer
Actual size of the key in bytes.
valueSize
Integer
Actual size of the value in bytes.
timestamp
DateTime
A processing timestamp (UTC). See timestampType for what the timestamp refers to.
timestampType
TimestampType
Indicates what the timestamp refers to.
NotAvailable
Timestamp is unknown.
CreateTime
Timestamp relates to message creation time as set by a Kafka broker.
LogAppendTime
Timestamp relates to the time a message was appended to a Kafka log.
persistedStatus
PersistedStatus
Status of the message.
NotPersisted
Message was never transmitted to the broker, or failed with an error indicating it was not written to the log.
Persisted
Message was written to the log and acknowledged by the broker.
PossiblyPersisted
Message was transmitted to broker, but no acknowledgement was received.
Transaction Handling
The xUML Runtime handles Apache Kafka Producer calls like is specified in the Runtime transaction concept. All producer calls within a session are wrapped into a dedicated transaction with a random unique transaction ID. These transactions can be rolled back until they have been committed. You cannot set a custom transaction ID (transactional.id), therefore there will be no fencing.