This connector publishes a message to a Kafka topic when invoked.

See the reference documentation for Custom Actions for guidance on how to use this configuration definition.

The general structure of a Kafka transformation is: 

{
    "$class": "io.clause.outbound.physical.KafkaPublish",
    "brokerString": "BROKER_STRING",
    "message": "MESSAGE",
    "topic": "TOPIC_NAME",
    "username": "USERNAME",
    "password": "PASSWORD"
}

Currently, this connector supports SASL/PLAINTEXT credentials.

Below is an example transformation for connecting to a Kaleido Connect Kafka broker. See the Kaleido guide for more detail.

{
    "$class": "io.clause.outbound.physical.KafkaPublish",
    "brokerString": "kafka.us-east-2.kaleido.io:9093,kafka.us-east-2.kaleido.io:9094,kafka.us-east-2.kaleido.io:9095,kafka.us-east-2.kaleido.io:9096,kafka.us-east-2.kaleido.io:9097",
    "message": $string({
        "headers": {
            "type": "SendTransaction"
        },
        "from": "NODE_CONSENSUS_ID",
        "to": "AUDIT_TRAIL_CONTRACT_ADDRESS",
        "params": [{
            "value": "AUDIT_TRAIL_CONTRACT_ADDRESS",
            "type": "address"
        }, {
            "type": "string",
            "value": $string(event)
        }],
        "gas": 1000000,
        "methodName": "push"
    }),
    "topic": "KAFKA_REQUEST_TOPIC",
    "username": "USERNAME",
    "password": "PASSWORD"
}