Apache Kafka
Keda based Message Queue Trigger for Apache Kafka
A message queue trigger invokes a function for each message published to a queue or stream. The KEDA-based message queue trigger is the recommended way to consume from message queues in Fission — it autoscales the connector that reads from your event source, scaling all the way down to zero when there are no messages and back up as load grows.
KEDA is the default and recommended kind for message queue triggers.--mqtkinddefaults tokeda, so you only need to set it explicitly when you want the legacy Fission-managed connector (--mqtkind=fission). The Fission kind is being phased out — prefer KEDA for all new triggers.
Each connector is documented on its own page:
flowchart TB
source["Event Source"]:::user
subgraph k8s["Kubernetes Cluster"]
keda["KEDA"]:::user
scaledobject["ScaledObject"]:::store
connector["Connector Deployment"]:::fission
router["Router"]:::fission
fnPod["Function Pod"]:::pod
end
source -->|"<b>1.</b> messages"| keda
keda -->|"<b>2.</b> scales 0..N"| connector
scaledobject -.->|"defines scaling"| connector
source -->|"<b>3.</b> consume"| connector
connector -->|"<b>4.</b> POST message"| router
router -->|"<b>5.</b> forwards request"| fnPod
fnPod -->|"<b>6.</b> response"| connector
classDef user fill:#ffffff,stroke:#94a3b8,color:#1f2a43
classDef fission fill:#e8f0fe,stroke:#2d70de,color:#1f2a43
classDef pod fill:#e6f7f1,stroke:#11a37f,color:#1f2a43,stroke-dasharray:5 3
classDef store fill:#fff7e0,stroke:#dba514,color:#1f2a43,stroke-dasharray:5 3ScaledObject and a connector deployment that the ScaledObject references.
The ScaledObject is KEDA’s way of encapsulating the connector deployment and the information needed to connect to an event source.
If authentication is required, the trigger also creates a TriggerAuthentication referencing your secret.mqt_keda.enabled to true when installing or upgrading the Fission Helm chart.Create a message queue trigger with fission mqtrigger create (alias fission mqt create).
The connection details for each event source go in repeatable --metadata key=value flags, and credentials are referenced by --secret.
fission mqt create --name <name> --function <function> \
--mqtype <source-type> --mqtkind keda \
--topic <input-topic> --resptopic <response-topic> --errortopic <error-topic> \
--maxretries 3 \
--metadata key1=value1 --metadata key2=value2 \
--secret <secret-name>
Key flags:
| Flag | Purpose |
|---|---|
--mqtype | Event source type. For KEDA: kafka, aws-sqs-queue, aws-kinesis-stream, gcp-pubsub, stan, nats-jetstream, rabbitmq, redis. |
--mqtkind | Trigger kind; defaults to keda. |
--topic | Topic, queue, or subject the connector reads from. |
--resptopic | Topic to publish successful function responses to (discarded if unset). |
--errortopic | Topic to publish errors to (discarded if unset). |
--maxretries | Maximum retries before a failed message is sent to the error topic. |
--metadata | Connection metadata for the source, in key=value form (repeatable). |
--secret | Name of the Kubernetes Secret holding source credentials. |
--pollinginterval | Seconds between checks of the source for scaling decisions (default 30). |
--cooldownperiod | Seconds to wait after the last active trigger before scaling back to 0 (default 300). |
--minreplicacount | Minimum number of connector replicas to scale down to. |
--maxreplicacount | Maximum number of connector replicas to scale up to (default 100). |
The exact --metadata keys depend on the event source — see the connector page for each source.
Keda based Message Queue Trigger for Apache Kafka
Keda based Message Queue Trigger for AWS SQS
Keda based Message Queue Trigger for AWS Kinesis
Keda based Message Queue Trigger for GCP Pub Sub
Keda based Message Queue Trigger for NATS Jetstream
Keda based Message Queue Trigger for NATS Streaming
Keda based Message Queue Trigger for RabbitMQ
Keda based Message Queue Trigger for Redis