RabbitMQ Source Connector for Confluent Cloud

The fully managed RabbitMQ Source connector uses the AMQP protocol to communicate with RabbitMQ servers. The RabbitMQ Source connector reads data from a RabbitMQ queue (or queues) and persists the data in an Apache Kafka® topic.

Features

The RabbitMQ Source connector provides the following features:

  • At least once delivery: The connector guarantees that records are delivered at least once to the Kafka topic.
  • Supports multiple tasks: The connector supports running one or more tasks. More tasks may improve performance.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

Quick Start

Use this quick start to get up and running with the Confluent Cloud RabbitMQ Source connector. The quick start shows how to select the connector and configure it to read data from RabbitMQ queue(s) and persist the data in an Apache Kafka® topic.

Prerequisites
  • Authorized access to a Confluent Cloud cluster on Amazon Web Services (AWS), Microsoft Azure (Azure), or Google Cloud Platform (GCP).
  • Authorized access to a RabbitMQ host server, queue, and host security details.
  • A topic must exist before launching the connector.
  • The Confluent CLI installed and configured for the cluster. See Install the Confluent CLI.
  • Schema Registry must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf). See Environment Limitations for additional information.
  • For networking considerations, see Network access. To use static egress IPs, see Static Egress IP Addresses.
  • Kafka cluster credentials. The following lists the different ways you can provide credentials.
    • Enter an existing service account resource ID.
    • Create a Confluent Cloud service account for the connector. Make sure to review the ACL entries required in the service account documentation. Some connectors have specific ACL requirements.
    • Create a Confluent Cloud API key and secret. To create a key and secret, you can use confluent api-key create or you can autogenerate the API key and secret directly in the Cloud Console when setting up the connector.

Refer to Cloud connector limitations for additional information.

Note

There is no output.data.format configuration used with this source connector. This is because this connector defaults to ByteArrayConverter for value and StringConverter for key. No other converter is useful for this connector.

Using the Confluent Cloud Console

Step 1: Launch your Confluent Cloud cluster.

See the Quick Start for Apache Kafka using Confluent Cloud for installation instructions.

Step 2: Add a connector.

In the left navigation menu, click Data integration, and then click Connectors. If you already have connectors in your cluster, click + Add connector.

Step 3: Select your connector.

Click the RabbitMQ Source connector icon.

RabbitMQ Source Connector Icon

Step 4: Set up the connection.

Complete the following steps and click Continue.

Note

  • Make sure you have all your prerequisites completed.
  • An asterisk ( * ) designates a required entry.
  1. Enter a connector name.
  2. Select the way you want to provide Kafka Cluster credentials. You can either select a service account resource ID or you can enter an API key and secret (or generate these in the Cloud Console).
  3. Enter a topic name. Enter the topic name where you want data sent. A topic must exist before launching the connector.
  4. Add the connection details.
    • RabbitMQ host: The RabbitMQ host server address to connect to. For example, 192.168.1.99. Add the RabbitMQ username and password.
    • RabbitMQ virtual host: The name of the virtual host created in RabbitMQ.
    • RabbitMQ port: The server port the connector uses to connect to the server. Defaults to 5672.
  5. Add the RabbitMQ details:
    • RabbitMQ queue(s): The RabbitMQ queue name. You can specify multiple RabbitMQ queues to read from.
    • RabbitMQ batch size: The maximum number of records that the connector batches and returns to the Kafka topic. The default property value is 1024 records.
    • RabbitMQ backoff time (in milliseconds): The number of milliseconds (ms) to wait when no records are returned from the RabbitMQ queue. The default property value is 100 ms.
  6. Select the Security protocol (optional): Select PLAINTEXT for an unencrypted and unauthenticated connection. Select SSL for a secure connection. Defaults to PLAINTEXT. When you select SSL, the Key Store and Trust Store file upload buttons appear, along with the following properties:
    • SSL key password: The password for the private key in the keystore.
    • Key Store password: The keystore password.
    • Key Store type: The keystore file format. Defaults to JKS.
    • Trust Store password: The trustore password. Not supported for PEM files.
    • Trust Store type: The trustore file format. Defaults to JKS.
  7. Enter the number of tasks that the connector uses. The connector supports running one or more tasks. More tasks may improve performance.
  8. Transforms and Predicates: See the Single Message Transforms (SMT) documentation for details.

See the RabbitMQ Source configuration properties for property values and definitions.

Step 5: Launch the connector.

Verify the connection details by previewing the running configuration. Once you’ve validated that the properties are configured to your satisfaction, click Launch.

Tip

For information about previewing your connector output, see Connector Data Previews.

Step 6: Check the connector status.

The status for the connector should go from Provisioning to Running. It may take a few minutes.

Step 7: Check the Kafka topic.

After the connector is running, verify that messages are populating your Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.

../_images/topology.png

Using the Confluent CLI

Complete the following steps to set up and run the connector using the Confluent CLI.

Note

  • Make sure you have all your prerequisites completed.
  • The example commands use Confluent CLI version 2. For more information see, Confluent CLI v2.

Step 1: List the available connectors.

Enter the following command to list available connectors:

confluent connect plugin list

Step 2: Show the required connector configuration properties.

Enter the following command to show the required connector properties:

confluent connect plugin describe <connector-catalog-name>

For example:

confluent plugin describe RabbitMQSource

Example output:

Following are the required configs:
connector.class: RabbitMQSource
name
kafka.api.key
kafka.api.secret
kafka.topic
rabbitmq.host
rabbitmq.username
rabbitmq.password
rabbitmq.queue
tasks.max

Step 3: Create the connector configuration file.

Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.

{
    "connector.class": "RabbitMQSource",
    "name": "RabbitMQSource_0",
    "kafka.auth.mode": "KAFKA_API_KEY",
    "kafka.api.key": "<my-kafka-api-key>",
    "kafka.api.secret" : "<my-kafka-api-secret>",
    "kafka.topic" : "topic_0"
    "rabbitmq.host" : "192.168.1.99",
    "rabbitmq.username" : "<username>",
    "rabbitmq.password": "<password>",
    "rabbitmq.queue": "<queue-name>",
    "tasks.max" : "1"
}

Note the following property definitions:

  • "name": Sets a name for your new connector.
  • "connector.class": Identifies the connector plugin name.
  • "kafka.auth.mode": Identifies the connector authentication mode you want to use. There are two options: SERVICE_ACCOUNT or KAFKA_API_KEY (the default). To use an API key and secret, specify the configuration properties kafka.api.key and kafka.api.secret, as shown in the example configuration (above). To use a service account, specify the Resource ID in the property kafka.service.account.id=<service-account-resource-ID>. To list the available service account resource IDs, use the following command:

    confluent iam service-account list
    

    For example:

    confluent iam service-account list
    
       Id     | Resource ID |       Name        |    Description
    +---------+-------------+-------------------+-------------------
       123456 | sa-l1r23m   | sa-1              | Service account 1
       789101 | sa-l4d56p   | sa-2              | Service account 2
    
  • "kafka.topic": Enter the topic name where you want data sent. A topic must exist before launching the connector.

  • "rabbitmq....": Enter your RabbitMQ authentication and queue details. You can specify multiple rabbitmq.queue names to read from using a comma-separated list.

  • "tasks.max": Enter the number of tasks that the connector uses. The connector supports running one or more tasks. More tasks may improve performance.

Single Message Transforms: See the Single Message Transforms (SMT) documentation for details about adding SMTs using the CLI.

See the RabbitMQ Source configuration properties for property values and definitions.

Step 4: Load the properties file and create the connector.

Enter the following command to load the configuration and start the connector:

confluent connect create --config <file-name>.json

For example:

confluent connect create --config rabbitmq-source.json

Example output:

Created connector RabbitMQSourceConnector_0 lcc-ix4dl

Step 5: Check the connector status.

Enter the following command to check the connector status:

confluent connect plugin list

Example output:

ID          |            Name           | Status  |  Type
+-----------+---------------------------+---------+-------+
lcc-ix4dl   | RabbitMQSourceConnector_0 | RUNNING | source

Step 6: Check the Kafka topic.

After the connector is running, verify that messages are populating your Kafka topic.

For more information and examples to use with the Confluent Cloud API for Connect, see the Confluent Cloud API for Connect section.

Configuration Properties

The following connector configuration properties can be used with the RabbitMQ Source connector for Confluent Cloud.

Note

There is no output.data.format configuration used with this source connector. This is because this connector defaults to ByteArrayConverter for value and StringConverter for key. No other converter is useful for this connector.

kafka.topic

Apache Kafka® topic to write the messages to.

  • Type: string
  • Importance: high
rabbitmq.host

The RabbitMQ host to connect to.

  • Type: string
  • Default: localhost
  • Importance: high
rabbitmq.username

The username with which to authenticate to RabbitMQ.

  • Type: string
  • Default: guest
  • Importance: high
rabbitmq.password

The password with which to authenticate to RabbitMQ.

  • Type: string
  • Default: guest
  • Importance: high
rabbitmq.virtual.host

The virtual host to use when connecting to the broker.

  • Type: string
  • Default: /
  • Importance: high
rabbitmq.port

The RabbitMQ port to connect to.

  • Type: int
  • Default: 5672
  • Importance: medium
rabbitmq.queue

RabbitMQ queue(s) to read from. You can specify multiple RabbitMQ queues to read from using a comma-separated list of queue names.

  • Type: list
  • Importance: high
rabbitmq.security.protocol

The security protocol to use when connecting to RabbitMQ. Values can be PLAINTEXT or SSL.

  • Type: string
  • Default: PLAINTEXT
  • Importance: high
rabbitmq.https.ssl.key.password

The password of the private key in the keystore file. This is optional and is only needed if the SSL is used.

  • Type: password
  • Importance: high
rabbitmq.https.ssl.keystorefile

The binary keystore file containing the server certificate. Only required if using SSL and a keystore. When using this property in the CLI, you must encode the binary keystore file in base64, take the encoded string, add the data:text/plain;base64 prefix, and then specify the entire string as the property entry. For example: "rabbitmq.https.ssl.keystorefile" : "data:text/plain;base64,/u3+7QAAAAIAAAACAAAAAQAGY2xpZ...==".

  • Type: password
  • Importance: high
rabbitmq.https.ssl.keystore.password

The password for the keystore file. This is optional and is only needed if the keystore file is used.

  • Type: password
  • Importance: high
rabbitmq.https.ssl.keystore.type

The file format of the keystore file. This is optional and is only needed if the keystore file is used.

  • Type: password
  • Default: JKS
  • Importance: medium
rabbitmq.https.ssl.truststorefile

The binary trustore file containing the server certificate. Only required if using SSL and a truststore. When using this property in the CLI, you must encode the binary trustore file in base64, take the encoded string, add the data:text/plain;base64 prefix, and then specify the entire string as the property entry. For example: "rabbitmq.https.ssl.truststorefile" : "data:text/plain;base64,/u3+7QAAAAIAAAACAAAAAQAGY2xpZ...==".

  • Type: string
  • Default: null
  • Importance: high
rabbitmq.https.ssl.truststore.password

The password for the trust store file. Not supported for PEM format. This is optional and is only needed if the truststore file is used.

  • Type: password
  • Default: null
  • Importance: high
rabbitmq.https.ssl.truststore.type

The file format of the truststore file. This is optional and is only needed if the truststore file is used.

  • Type: password
  • Default: JKS
  • Importance: medium
batch.size

The maximum number of records that the connector batches and returns to the Kafka topic.

  • Type: int
  • Default: 1024
  • Importance: medium
backoff.time.ms

The number of milliseconds (ms) to wait when no records are returned from the RabbitMQ queue. The default property value is 100 ms.

  • Type: int
  • Default: 100
  • Importance: medium

Next Steps

See also

For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent CLI to manage your resources in Confluent Cloud.

../_images/topology.png