Automated Continuous RabbitMQ Replication to Snowflake

Cameron Leblanc
Cameron Leblanc
Senior Technology Evangelist
Use CData Sync for automated, continuous, customizable RabbitMQ replication to Snowflake.

Always-on applications rely on automatic failover capabilities and real-time data access. CData Sync integrates live RabbitMQ data into your Snowflake instance, allowing you to consolidate all of your data into a single location for archiving, reporting, analytics, machine learning, artificial intelligence and more.

Configure Snowflake as a Replication Destination

Using CData Sync, you can replicate RabbitMQ data to Snowflake. To add a replication destination, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select the Destinations tab and locate the Snowflake connector.
  3. Click the Configure Connection icon at the end of that row to open the New Connection page. If the Configure Connection icon is not available, click the Download Connector icon to install the Snowflake connector. For more information about installing new connectors, see Connections in the Help documentation.
  4. To connect to Snowflake, set the following connection properties:
    • Connection Name: Enter a connection name of your choice for the Snowflake connection.
    • Warehouse: Enter the name of your Snowflake warehouse.
    • URL: Enter the URL for your Snowflake database. CData Sync supports both Microsoft Azure and Amazon Web Services (AWS) instances:
      • AWS: https://MyAccount.Region.snowflakecomputing.com
      • Azure: https://MyAccount.Region.azure.snowflakecomputing.com
    • URL: Enter the URL of the Snowflake database instance, for example: https://myaccount.snowflakecomputing.com
    • Database: The name of the Snowflake database
    • Auth Scheme: Select the authentication scheme. The default auth scheme is Password. The auth schemes available for Snowflake are Password, OKTA, PrivateKey, AzureAD, OAuth, PingFederate, and External Browser.
    • User: Enter the username that you use to authenticate to Snowflake.
    • Password: Enter the password that you use to authenticate to Snowflake.
    • Schema: The schema of the Snowflake database.
  5. Once connected, click Create & Test to create, test and save the connection.

You are now connected to Snowflake and can use it as both a source and a destination.

NOTE: You can use the Label feature to add a label for a source or a destination.

In this article, we will demonstrate how to load RabbitMQ data into Snowflake and utilize it as a destination.

Configure the RabbitMQ Connection

You can configure a connection to RabbitMQ from the Connections tab. To add a connection to your RabbitMQ account, navigate to the Connections tab.

  1. Click Add Connection.
  2. Select a source (RabbitMQ).
  3. Configure the connection properties.

    About RabbitMQ Management HTTP API

    RabbitMQ is an open-source message broker that supports multiple messaging protocols. The RabbitMQ Management HTTP API provides HTTP-based access to management and monitoring data for a RabbitMQ server. The API exposes information about virtual hosts, exchanges, queues, bindings, connections, channels, consumers, users, permissions, policies, and cluster-wide statistics.

    The Management plugin must be enabled on the RabbitMQ server for the HTTP API to be available. By default, the management interface listens on port 15672.

    Using Basic Authentication

    RabbitMQ Management HTTP API uses HTTP Basic authentication. You must supply the username and password of a RabbitMQ management user.

    To enable access to the management API:

    1. Ensure the RabbitMQ Management plugin is enabled on your server (rabbitmq-plugins enable rabbitmq_management).
    2. Use an existing management user or create one with the appropriate management tag (management, policymaker, monitoring, or administrator).
    3. Note the full base URL of your RabbitMQ Management HTTP API (e.g., http://localhost:15672).

    After configuring your RabbitMQ server, set the following connection properties to connect:

    • AuthScheme: Set this to Basic.
    • URL: Set this to the base URL of your RabbitMQ Management HTTP API (e.g., http://localhost:15672).
    • User: Set this to your RabbitMQ management username (e.g., guest).
    • Password: Set this to your RabbitMQ management password.

    Example connection string:

    Profile=C:\profiles\RabbitMQ.apip;AuthScheme=Basic;URL=http://localhost:15672;User=guest;Password=guest;
    

    Available Tables

    The RabbitMQ profile provides access to the following tables:

    • Overview - Cluster-wide statistics and information about the RabbitMQ node
    • Nodes - Information about individual nodes in the RabbitMQ cluster
    • NodeMemory - Detailed memory usage breakdown for a specific cluster node
    • Connections - List of all open AMQP connections to the broker
    • Channels - List of all open AMQP channels across all connections
    • Consumers - List of all consumers registered across all queues
    • Exchanges - List of exchanges declared across all virtual hosts
    • Queues - List of queues declared across all virtual hosts
    • Bindings - List of all bindings between exchanges and queues
    • VirtualHosts - List of virtual hosts configured on the broker
    • VhostPermissions - User permissions within a specific virtual host
    • Users - List of all RabbitMQ users
    • Permissions - Permission records for all users across all virtual hosts
    • TopicPermissions - Topic-level permission records for all users
    • Policies - List of policies applied to queues and exchanges in virtual hosts
    • OperatorPolicies - List of operator policies applied to queues in virtual hosts
    • Parameters - List of component parameters (e.g., federation, shovel) per virtual host
    • GlobalParameters - List of global parameters that apply across all virtual hosts
    • VhostLimits - Resource limits configured for specific virtual hosts
    • UserLimits - Resource limits configured for specific users
    • FeatureFlags - List of feature flags and their enabled/disabled state on the node
    • DeprecatedFeatures - List of deprecated features and their usage state
    • AuthAttempts - Authentication attempt statistics for the node
    • ClusterName - The name of the RabbitMQ cluster
    • WhoAmI - Information about the currently authenticated management user
    • ExchangeBindingsSource - Bindings for which a specific exchange is the source
    • ExchangeBindingsDestination - Bindings for which a specific exchange is the destination
    • QueueBindings - Bindings for a specific queue within a virtual host
  4. Click Connect to RabbitMQ to ensure that the connection is configured properly.
  5. Click Save & Test to save the changes.

Configure Replication Queries

CData Sync enables you to control replication with a point-and-click interface and with SQL queries. For each replication you wish to configure, navigate to the Jobs tab and click Add Job. Select the Source and Destination for your replication.

Replicate Entire Tables

To replicate an entire table, navigate to the Task tab in the Job, click Add Tasks, choose the table(s) from the list of RabbitMQ tables you wish to replicate into Snowflake, and click Add Tasks again.

Customize Your Replication

You can use the Columns and Query tabs of a task to customize your replication. The Columns tab allows you to specify which columns to replicate, rename the columns at the destination, and even perform operations on the source data before replicating. The Query tab allows you to add filters, grouping, and sorting to the replication with the help of SQL queries.

Schedule Your Replication

Select the Overview tab in the Job, and click Configure under Schedule. You can schedule a job to run automatically by configuring it to run at specified intervals, ranging from once every 10 minutes to once every month.

Once you have configured the replication job, click Save Changes. You can configure any number of jobs to manage the replication of your RabbitMQ data to Snowflake.

Run the Replication Job

Once all the required configurations are made for the job, select the RabbitMQ table you wish to replicate and click Run. After the replication completes successfully, a notification appears, showing the time taken to run the job and the number of rows replicated.

Free Trial & More Information

Now that you have seen how to replicate RabbitMQ data into Snowflake, visit our CData Sync page to explore more about CData Sync and download a free 30-day trial. Start consolidating your enterprise data today!

As always, our world-class Support Team is ready to answer any questions you may have.

Ready to get started?

Learn more or sign up for a free trial:

CData Sync