Skip to content

Trigger functions from Kafka

Trigger function invocations from messages received on Kafka topics.

Note: This feature is included for OpenFaaS Pro customers.


You can install the Kafka connector using its helm chart, or by using arkade.

Are you an Aiven customer? See also: Event-driven OpenFaaS with Managed Kafka from Aiven

Installation with arkade

export TOPICS="payment.created"
arkade install kafka-connector \
 --broker-host kafka-broker \
 --topics $TOPICS \
 --license-file $HOME/.openfaas/LICENSE

Installation with Helm

See helm chart


Once you have configured a number of topics, you can then annotate your functions so that they get triggered by any incoming messages on those topics.

Create a new function:

faas-cli new --lang go provision-customer

Now add an annotation for the payment.created topic, so that the provision-customer function is invoked for any message received:

version: 1.0
  name: openfaas

      topic: payment.created
    lang: go
    handler: ./provision-customer

Now deploy your function, and publish an event to your Kafka broker on the payment.created topic.

See also

Would you like a demo?

Feel free to reach out to us for a demo or to ask any questions you may have.