![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the RabbitMQ via the CData ADO.NET Data Provider for RabbitMQ. To achieve this, we will use LINQ to Entity Framework, which facilitates the generation of connections and can be seamlessly employed with any CData ADO.NET Data Providers to access data through LINQ.
See the help documentation for a guide to setting up an EF 6 project to use the provider.
Enter your data source connection information.
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:
Profile=C:\profiles\\RabbitMQ.apip;AuthScheme=Basic;URL=http://localhost:15672;User=guest;Password=guest;
Using the entity you created, you can now perform select commands. For example:
APIEntities context = new APIEntities();
var authattemptsQuery = from authattempts in context.AuthAttempts
select authattempts;
foreach (var result in authattemptsQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Connect to live data from RabbitMQ with the API Driver
Connect to RabbitMQ