You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Trigger management
Creating Kafka triggers
Copy page
Download PDF
Creating Kafka triggers
veFaaS can be integrated with Message Queue for Kafka of Volcano Engine. You can create a Kafka trigger. In this way, veFaaS will consume messages from Kafka as a consumer and pass the messages to the user function. This triggers function code execution. You only need to write the function that processes the messages without the need to worry about the details of how veFaaS consumes messages. This topic describes how to create Kafka triggers.​
Prerequisites​
  • The VPC access feature has been enabled for the target function, which needs to be deployed in the same VPC as the Kafka instance to be consumed. For detailed operations, see Configuring functions.​
  • After enabling or modifying the VPC access configuration of the function, you need to perform a full release again. For detailed operations, see Releasing functions.​
  • A Kafka instance and Topic have been created, and a SASL user has been created for the current Kafka instance. The SASL user needs to have at least read permissions on the target Topic. For detailed operations, see Getting started with Message Queue for Kafka.​
Limits​
  • You can create up to 20 triggers for each function.​
  • The Kafka instance and function must be deployed in the same VPC.​
  • To modify the VPC or subnet of a function, you must first disable or delete all MQ triggers.​
  • After a Kafka trigger is created, you cannot change its Kafka instance, Topic, or consumption location.​
Procedure​
  1. Log in to the veFaaS console.​
  1. In the top navigation bar, select the target region.​
  1. In the function list, find the function for which you want to create a trigger and click its name.​
  1. On the function details page, click Create trigger on the Trigger tab.​
  1. In the Create trigger panel, specify the parameters as required.​
  • ​
    Parameter​
    Description​
    Trigger type​
    In this scenario, select Message queue of Kafka.​
    Trigger name​
    Specify a custom name for the trigger. Trigger names cannot be repeated under the same function. The trigger name cannot be modified after being created.​
    Instance​
    The Kafka instance. veFaaS will consume messages from the specified Topic of the specified Kafka instance as a consumer. Select the Kafka instance and Topic described in the prerequisites.​
    • Topic: A message topic is a collection of messages of the same type and is the basic unit for message subscription in Message Queue for Kafka.​
    tip​
    You can only select a Kafka instance that is deployed in the same VPC as the function.​
    Number of retries​
    The maximum number of retries when a function has run errors, including user code errors and runtime errors.​
    Consumer offset​
    Specifies where to start consuming messages in the Topic. You can select Consume from the beginning or Consume from the latest offset. Select an appropriate position based on your business requirements. After the consumption position is specified, it cannot be changed.​
    • Consume from the beginning: Start consuming from the first message produced in the Topic.​
    • Consume from the latest offset: Only consume messages produced after the Topic is subscribed.​
    Activate now​
    Whether to enable the Trigger while creating it. Only Trigger enabled will work properly.​
    Authentication​
    Enter the SASL username and password described in the prerequisites for accessing the Kafka instance. veFaaS uses the ACL permission policies of Kafka to authenticate message consumption for SASL users of both PLAIN and SCRAM types.​
    warning​
    • Enter a valid SASL username and password. Otherwise, the function cannot consume Kafka messages.​
    • Make sure that the configured SASL user has at least read permissions on the target Topic.​
    Description​
    Enter remarks as needed.​
    ​
  1. Click Confirm to create the Kafka trigger.​
What to do next​
  • For the method of modifying the configurations of the Kafka trigger, see Managing triggers.​
Last updated: 2026.08.19 14:06:06