Categorygithub.com/conduitio-labs/conduit-connector-rabbitmq

# README

Conduit Connector for RabbitMQ

The RabbitMQ connector is one of Conduit standalone plugins. It provides both a source and a destination connector for RabbitMQ.

It uses the AMQP 0-9-1 Model to connect to RabbitMQ.

What data does the OpenCDC record consist of?

FieldDescription
record.Positionjson object with the delivery tag and the queue name from where the record was read from.
record.Operationcurrently fixed as "create".
record.Metadataa string to string map, with keys prefixed as rabbitmq.{DELIVERY_PROPERTY}.
record.Keythe message id from the read message.
record.Payload.Before
record.Payload.Afterthe message body

How to Build?

Run make build to compile the connector.

Testing

Execute make test to perform all non-tls tests. Execute make test-tls for the TLS tests. Both commands use docker files located at test/docker-compose.yml and test/docker-compose-tls.yml respectively. Tests require docker-compose v2.

Source Configuration Parameters

NameDescriptionRequiredDefault Value
urlThe RabbitMQ server's URL.Yes
tls.enabledFlag to enable or disable TLS.falsefalse
tls.clientCertPath to the client certificate for TLS.No
tls.clientKeyPath to the client's key for TLS.No
tls.caCertPath to the CA (Certificate Authority) certificate for TLS.No
queue.nameThe name of the RabbitMQ queue to consume messages from.Yes
queue.durableSpecifies whether the queue is durable.Notrue
queue.autoDeleteIf the queue will auto-delete.Nofalse
queue.exclusiveIf the queue is exclusive.Nofalse
queue.noWaitIf the queue is declared without waiting for server reply.Nofalse
consumer.nameThe name of the consumer.No
consumer.autoAckIf the server should consider messages acknowledged once delivered.Nofalse
consumer.exclusiveIf the consumer should be exclusive.Nofalse
consumer.noLocalIf the server should not deliver messages published by the same connection.Nofalse
consumer.noWaitIf the consumer should be declared without waiting for server confirmation.Nofalse

Destination Configuration Parameters

NameDescriptionRequiredDefault Value
urlThe RabbitMQ server's URL.Yes
tls.enabledFlag to enable or disable TLS.falsefalse
tls.clientCertPath to the client certificate for TLS.No
tls.clientKeyPath to the client's key for TLS.No
tls.caCertPath to the CA (Certificate Authority) certificate for TLS.No
queue.nameThe name of the RabbitMQ queue where messages will be published to.Yes
queue.durableSpecifies whether the queue is durable.Notrue
queue.autoDeleteIf the queue will auto-delete.Nofalse
queue.exclusiveIf the queue is exclusive.Nofalse
queue.noWaitIf the queue is declared without waiting for server reply.Nofalse
contentTypeThe MIME content type of the messages written to RabbitMQ.Notext/plain
delivery.contentEncodingThe content encoding for the message.No
delivery.deliveryModeDelivery mode of the message. Non-persistent (1) or persistent (2).No2
delivery.priorityThe priority of the message.No0
delivery.correlationIDThe correlation id associated with the message.No
delivery.replyToAddress to reply to.No
delivery.messageTypeNameThe type name of the message.No
delivery.userIDThe user id associated with the message.No
delivery.appIDThe application id associated with the message.No
delivery.mandatoryIndicates if this message is mandatory.Nofalse
delivery.immediateIndicates if this message should be treated as immediate.Nofalse
delivery.expirationIndicates the message expiration time, if any.No
exchange.nameThe name of the exchange to publish to.No
exchange.typeThe type of the exchange to publish to.Nodirect
exchange.durableSpecifies whether the exchange is durable.Notrue
exchange.autoDeleteIf the exchange will auto-delete.Nofalse
exchange.internalIf the exchange is internal.Nofalse
exchange.noWaitIf the exchange is declared without waiting for server reply.Nofalse
routingKeyThe routing key to use when publishing to an exchange.No

Example pipeline.yml file

Here's an example of a pipeline.yml file using file to RabbitMQ and RabbitMQ to file pipelines:

version: 2.0
pipelines:
  - id: file-to-rabbitmq
    status: running
    connectors:
      - id: file.in
        type: source
        plugin: builtin:file
        name: file-destination
        settings:
          path: ./file.in
      - id: rabbitmq.out
        type: destination
        plugin: standalone:rabbitmq
        name: rabbitmq-source
        settings:
          url: amqp://guest:guest@localhost:5672/
          queue.name: demo-queue
          sdk.record.format: template
          sdk.record.format.options: '{{ printf "%s" .Payload.After }}'

  - id: rabbitmq-to-file
    status: running
    connectors:
      - id: rabbitmq.in
        type: source
        plugin: standalone:rabbitmq
        name: rabbitmq-source
        settings:
          url: amqp://guest:guest@localhost:5672/
          queue.name: demo-queue

      - id: file.out
        type: destination
        plugin: builtin:file
        name: file-destination
        settings:
          path: ./file.out
          sdk.record.format: template
          sdk.record.format.options: '{{ printf "%s" .Payload.After }}'

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
Specification returns the connector's specification.

# Variables

Connector combines all constructors for each plugin in one struct.

# Structs

No description provided by the author
to use with ampq.Channel Consume method.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author