The kafka source receives inputs from Kafka.
The kafka source consumes kafka topics and turns messages into inputs for fns. It will make a message as consumed only if the fn returns an output successfully.
The following table describes the keys on the configuration object for the kafka source. Configuration data is required because the source will not know how to connect to Kafka without at least the brokers and topics.
|String||A comma-delimited list of broker addresses|
|String||The consumer group name|
|String||The kafka version|
|String||A comma-delimited list of topics to consume|
|String||The rebalance strategy; one of |
|Bool||Indicates whether the source should start with the oldest available message for a partition|
|Bool||Indicates whether messages are marked as consumed when the fn returns an error|
Inputs generated by the http source are objects with the following keys.
|String||The message key|
|String||The message value|
|Integer||The message offset|
|Integer||The partition from which the message was received|
|String||The topic from which the message was received|
|Timestamp||The inner message timestamp|
The following example shows a system that consumes messages from a topic called
test-topic and processes the event value with a bash script. Note that the
message will be marked as received only if the script returns successfully.
source: fnrun.source/kafka: brokers: 127.0.0.1:9092 group: fnrun-example topics: test-topic middleware: - fnrun.middleware/key: value fn: fnrun.fn/cli: command: ./fn.sh script: true