The RabbitMQ connector reads messages from an ApsaraMQ for RabbitMQ queue and writes them to an ApsaraMQ for Kafka topic. The connector runs on the Apache Kafka Connect framework, which EventBridge provisions as a Serverless App Engine (SAE) application.
Prerequisites
Before you begin, make sure you have completed the following:
Activated EventBridge and granted the required permissions to a Resource Access Management (RAM) user. For more information, see Activate EventBridge and grant permissions to a RAM user.
Created ApsaraMQ for RabbitMQ resources. For more information, see Create resources.
Activated Object Storage Service (OSS) and created a bucket. OSS stores the connector plugin ZIP file. For more information, see Get started by using the OSS console.
Activated SAE. EventBridge provisions SAE workers to run the connector. For more information, see Preparations.
Created a virtual private cloud (VPC) and a vSwitch. The VPC provides network connectivity between the connector, RabbitMQ, and Kafka instances. For more information, see Create a VPC with an IPv4 CIDR block.
Purchased and deployed an ApsaraMQ for Kafka instance. For more information, see Purchase and deploy an instance.
Step 1: Create ApsaraMQ for RabbitMQ resources
Log on to the ApsaraMQ for RabbitMQ console and create an instance. For more information, see Create an instance.
Click the instance that you created. On the Instance Details page, create the following resources:
In the left-side navigation pane, click Users and Permissions. On the page that appears, click Create Username/Password. For more information, see Create a pair of username and password. Save the username and password after you create them.

In the left-side navigation pane, click Vhosts and then click Create vhost. For more information, see Create an exchange.
In the left-side navigation pane, click Queues. On the page that appears, click Change next to vhost. Select the vhost you created from the drop-down list and click Create Queue. For more information, see Create a queue.
Step 2: Create the connector
Download the RabbitMQ Connector file and upload it to the OSS bucket you created. For more information, see Get started by using the OSS console.
Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region where your ApsaraMQ for Kafka instance resides.
In the left-side navigation pane, choose .
On the Tasks page, click Create Task.
On the Create Task page, configure the Task Name parameter and follow the on-screen instructions to configure other parameters as described below.
Configure the data source
In the Source step, set Data Provider to Apache Kafka Connect and click Next Step.
In the Connector step, configure the following parameters and click Next Step. Update the following fields in the code editor: Sample
.propertiesfile:Subsection Parameter Description Kafka Connect Plug-in Bucket The OSS bucket to which the RabbitMQ Connector file was uploaded. File The RabbitMQ Connector file you uploaded to the OSS bucket. Message Queue for Apache Kafka Resources Message Queue for Apache Kafka Parameters Select Source Connect. Message Queue for Apache Kafka Instance The ApsaraMQ for Kafka instance you created in the prerequisites. VPC Auto-populated from your Kafka instance deployment. This value cannot be changed. vSwitch Auto-populated from your Kafka instance deployment. This value cannot be changed. Security Group Select a security group. Kafka Connect Parse .properties File in ZIP Package Select Create .properties File. Then, select the .propertiesfile that contains the source connector configurations from the ZIP package. The path is/etc/source-xxx.properties.Parameter Description connector.classThe connector class name. Use the default value. tasks.maxThe maximum number of tasks. rabbitmq.hostThe VPC endpoint of the ApsaraMQ for RabbitMQ instance. Find this in the Endpoint Information section of the Instance Details page. rabbitmq.usernameThe username you created in Step 1. rabbitmq.passwordThe password you created in Step 1. rabbitmq.virtual.hostThe vhost you created in Step 1. kafka.topicThe destination ApsaraMQ for Kafka topic. Create this topic before synchronizing data. rabbitmq.queueThe queue you created in Step 1. connector.class=com.ibm.eventstreams.connect.rabbitmqsource.RabbitMQSourceConnector name=rabbitmq-source-connector # The VPC endpoint of the ApsaraMQ for RabbitMQ instance. rabbitmq.host=<your-rabbitmq-vpc-endpoint> # The static password for the ApsaraMQ for RabbitMQ instance. rabbitmq.password=<your-rabbitmq-password> # The static username for the ApsaraMQ for RabbitMQ instance. rabbitmq.username=<your-rabbitmq-username> # The vhost of the ApsaraMQ for RabbitMQ instance. rabbitmq.virtual.host=<your-rabbitmq-vhost> # The destination ApsaraMQ for Kafka topic. kafka.topic=<your-kafka-topic> # The queue of the ApsaraMQ for RabbitMQ instance. rabbitmq.queue=<your-rabbitmq-queue> tasks.max=4
Configure workers
In the Instance step, configure the following parameters and click Next Step. The following internal resources are created automatically:
Subsection Parameter Description Worker Type Worker Type Select a worker type. Min. Number of Workers The minimum number of workers. Max. Number of Workers The maximum number of workers. The value cannot exceed the tasks.maxvalue.Horizontal Scaling Threshold (%) The CPU utilization threshold that triggers auto scaling. Required only if the minimum and maximum worker counts differ. Worker Configurations Automatically Create Dependencies for Apache Kafka Connector Worker Select this option (recommended). The system creates the internal topics and consumer groups required to run Kafka Connect in the selected ApsaraMQ for Kafka instance and fills the resource information in the code editor. Resource Naming format Offset Topic connect-eb-offset-<Task name>Config Topic connect-eb-config-<Task name>Status Topic connect-eb-status-<Task name>Kafka Connect Consumer Group connect-eb-cluster-<Task name>Kafka Source Connector Consumer Group connector-eb-cluster-<task name>-<connector name>
Configure running settings and task properties
In the Running Configurations section, set the Log Delivery parameter to Deliver Data to Log Service or Deliver Data to ApsaraMQ for Kafka. In the Role Authorization subsection, select a role from the Role drop-down list, and then click Save.
ImportantSelect a role that has the AliyunSAEFullAccess permission policy attached. Otherwise, the task may fail to run.
Configure the retry policy and dead-letter queue for the task. For more information, see Retry policies and dead-letter queues.
When the task status changes to Running, the connector is working as expected.
Step 3: Test the connector
Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.
In the top navigation bar of the Instances page, select the region where your instance resides. In the instance list, click the instance name.
In the left-side navigation pane, click Queues. Find the queue and click Details in the Actions column.
On the Bound as Destination tab of the Queue Details page, click Add Binding.
In the Bound as Destination panel, select amq.direct for Source Exchange and click OK.
On the Bound as Destination tab, find the amq.direct exchange and click Send Message in the Actions column to send a message to the destination ApsaraMQ for Kafka topic. For more information, see Send messages.

Log on to the ApsaraMQ for Kafka console. On the Instances page, click your instance.
Click the topic and then click the Message Query tab to verify that the message was delivered.

Troubleshooting
All tasks fail to run
Error message:
All tasks under connector mongo-source failed, please check the error trace of the task.Solution: On the Message Inflow Task Details page, click Diagnostics in the Basic Information section to go to the Connector Monitoring page. View the task failure details there.
Kafka Connect unexpectedly exits
Error message:
Kafka connect exited! Please check the error log /opt/kafka/logs/connect.log on sae application to find out the reason why kafka connect exited and update the event streaming with valid arguments to solve it.Solution: The status update of Kafka Connect may be delayed. Refresh the page first. If Kafka Connect still fails, troubleshoot by following these steps:
In the Worker Information section of the Message Inflow Task Details page, click the instance name next to SAE Application to go to the Application Details page.
On the Basic Information page, click the Instance Deployment Information tab.
Click Webshell in the Actions column to log on to the running environment of Kafka Connect.
Run
vi /home/admin/connector-bootstrap.logto view the startup logs and check for error messages.Run
vi /opt/kafka/logs/connect.logto view the running logs and check for ERROR or WARN entries.

After troubleshooting the issue, restart the task.
Connector parameter verification fails
Error message:
Start or update connector xxx failed. Error code=400. Error message=Connector configuration is invalid and contains the following 1 error(s):
Value must be one of never, initial_only, when_needed, initial, schema_only, schema_only_recovery
You can also find the above list of errors at the endpoint `/connector-plugins/{connectorType}/config/validate`Solution: Find the parameter with the invalid value from the error message and update it. If the error message does not identify the parameter, log on to the Kafka Connect running environment (see Kafka Connect unexpectedly exits) and run the following command:
curl -i -X PUT -H "Accept:application/json" -H "Content-Type:application/json" -d @$CONNECTOR_PROPERTIES_MAPPING http://localhost:8083/connector-plugins/io.confluent.connect.jdbc.JdbcSinkConnector/config/validateThe response returns the validation result for each connector parameter. If a parameter value is invalid, its errors field is not empty.
"value":{
"name":"snapshot.mode",
"value":null,
"recommended_values":[
"never",
"initial_only",
"when_needed",
"initial",
"schema_only",
"schema_only_recovery"
],
"errors":[
"Value must be one of never, initial_only, when_needed, initial, schema_only, schema_only_recovery"
],
"visible":true
}