Updated on 2025-08-19 GMT+08:00

DMS (for HC.RabbitMQ) Trigger

This section describes how to create a DMS (for HC.RabbitMQ) trigger on the FunctionGraph console to trigger function execution using RabbitMQ.

For details about the EG event source, see Supported Event Sources.

Notes and Constraints

EG triggers are available only inLA-Mexico City2 and LA-Santiago. You can check whether the trigger type is supported on the console.

Prerequisites

  • Function and configuration:
    • You have created a function.
    • You have enabled the VPC access for the function and configured the subnet permissions for the RabbitMQ security group. For details, see Configuring Networks.
  • EG:

    You have created an EG event channel. For details, see Creating an EG Event Channel.

  • RabbitMQ instance:
    • You have created a RabbitMQ instance. For details, see Buying an Instance.
    • A virtual host, exchange, and queue have been created.
      1. To create a virtual host, see Creating a RabbitMQ Virtual Host.
      2. To create an exchange, see Creating a RabbitMQ Exchange.
      3. To create a queue, see Creating a RabbitMQ Queue.
      4. An exchange-queue binding has been configured. For details, see Binding a RabbitMQ Exchange and Binding a RabbitMQ Queue.

        Virtual hosts (vhost) serve as independent RabbitMQ servers to manage exchanges and queues. A RabbitMQ instance can have multiple virtual hosts, and a virtual host can have multiple exchanges and queues. For details, see Process of Using RabbitMQ.

    • The rules of the security group of the instance have been correctly configured.
      1. In the Network section on the Basic Information tab page, click the name of the security group.
      2. Click the Inbound Rules tab to view the inbound rules of the security group.
        1. SSL disabled

          For intra-VPC access, inbound access through port 5672 must be allowed.

          For public access, inbound access through port 15672 must be allowed.

        2. SSL enabled

          For intra-VPC access, inbound access through port 5671 must be allowed.

          For public access, inbound access through port 15671 must be allowed.

DMS (for HC.RabbitMQ) Trigger

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Triggers and click Create Trigger.

    Figure 1 Creating a trigger

  4. Configure the following parameters.

    Table 1 Parameters for creating a DMS (for HC.RabbitMQ) trigger

    Parameter

    Description

    Example Value

    Trigger Type

    Mandatory.

    Select DMS (for HC.RabbitMQ).

    DMS (for HC.RabbitMQ)

    Trigger Name

    Mandatory.

    Name of a trigger. Only letters, digits, underscores (_), and hyphens (-) are allowed. The value cannot start with a digit or hyphen (-). Maximum length: 128 characters.

    EG-RabbitMQ

    Event Channel

    Mandatory.

    Select an existing EG event channel. If no event channel is available, click Create Event Channel.

    EGtest

    Instance

    Mandatory.

    Select a created RabbitMQ instance. If no instance is available, click Create Instance.

    rabbitmq-fg

    Username

    Mandatory.

    Enter the username used for accessing the instance.

    fgtest

    Password

    Mandatory.

    Enter the password used for accessing the instance.

    testrabbitmq

    Virtual Host

    Mandatory.

    Enter the virtual host name of the RabbitMQ instance.

    rabbitmqEX

    Queue

    Mandatory.

    Enter the queue of the RabbitMQ instance.

    rabbitmqQueue

  5. Click OK.

Configuring an EventGrid Event to Trigger the Function

  1. Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. On the function details page, select a version.
  4. On the Code tab page, click Test. The Configure Test Event dialog box is displayed.
  5. Set the parameters described in Table 2 and click Save.

    Table 2 Test parameters

    Parameter

    Description

    Configure Test Event

    You can choose to create a test event or edit an existing one.

    Use the default option Create new test event.

    Event Templates

    Select DMS (for HC.RabbitMQ) to use the built-in RabbitMQ event template.

    Event Name

    The event name can contain 1 to 25 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. For example, rabbitmq-123test.

    Event data

    The system automatically loads the built-in eg-RabbitMQ event template, which is used in this example without modifications.

  6. Click Test. The function test result is displayed.

Helpful Links

Manage function triggers through APIs. For details, see Function Trigger APIs.