![]() |
VOOZH | about |
The CData JDBC Driver for RabbitMQ enables you to execute queries to RabbitMQ data in tools like Squirrel SQL Client. In this article, you will create a JDBC data source for RabbitMQ data and execute queries.
Follow the steps below to add the driver JAR.
Follow the steps below to save connection properties in the driver alias.
In the Add Alias wizard that opens, the following fields are required for the JDBC driver:
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.
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:
After configuring your RabbitMQ server, set the following connection properties to connect:
Profile=C:\profiles\RabbitMQ.apip;AuthScheme=Basic;URL=http://localhost:15672;User=guest;Password=guest;
The RabbitMQ profile provides access to the following tables:
Below is a typical connection string:
jdbc:api:Profile=C:\profiles\\RabbitMQ.apip;AuthScheme=Basic;URL=http://localhost:15672;User=guest;Password=guest;๐ Connection properties automatically detected by Squirrel SQL. (Salesforce is shown.)
After the metadata has loaded, a new tab for the RabbitMQ data source is displayed. On the Objects subtab, you can discover schema information, such as the available tables and views.
๐ Column metadata for a table. (Salesforce is shown.)
To view table data, select the table on the Objects tab. The table data is then loaded in a grid on the Content tab.
๐ Tables can be edited on the Content tab. (Salesforce is shown.)To execute an SQL query, enter the query on the SQL tab and then click Run SQL (the runner icon). For example:
SELECT , FROM AuthAttempts WHERE NodeName = 'rabbit@hostname'๐ A query and the results. (Salesforce is shown.)
Connect to live data from RabbitMQ with the API Driver
Connect to RabbitMQ