Bridge data to RabbitMQ

    Create a rule:

    Go to EMQX Dashboard (opens new window), select the “rule” tab on the menu to the left.

    Select “message.publish”, then type in the following SQL:

    image

    Bind an action:

    Fill in the parameters required by the action:

    Two parameters is required by action “Data bridge to RabbitMQ”:

    2). RabbitMQ Exchange Type. Here set it to “topic”

    3). RabbitMQ Routing Key. Here set it to “test”

    image

    4). Bind a resource to the action. Since the dropdown list “Resource” is empty for now, we create a new resource by clicking on the “New Resource” to the top right, and then select “RabbitMQ”:

    Configure the resource:

    Set “RabbitMQ Server” to “127.0.0.1:5672”, and keep all other configs as default, and click on the “Testing Connection” button to make sure the connection can be created successfully, and then click on the “Create” button.

    image

    Back to the creating rule page, then click on “Create” button. The rule we created will be show in the rule list:

    image

    We have finished, testing the rule by sending an MQTT message to emqx:

    Write an AMQP Client to consume the messages, following is the one written in python:

    And from the rule list, verify that the “Matched” column has increased to 1:

    image