Currently we want to access our Azure IoT-Hub using RabbitMQ. We know that there are other options and already tested a few, but this project is to test if it is possible and suitable for us.
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
using System;
using System.Text;
Our Code looks somewhat like this:
var factory = new ConnectionFactory();
factory.HostName = $"{IOT_HUB_NAME}.azure-devices.net";
// This fails with the message: 'None of the specified endpoints were reachable.'
using (var connection = factory.CreateConnection())
{
// ...
}
The endpoint the factory wants to connect to is:
amqp://<IoT-Hub Name>.azure-devices.net:5672
Our IT-Department already checked our filewall: it is not blocking this connection.
A quick check using telnet results in a connection error:
telnet <IoT-Hub Name>.azure-devices.net 5672
However, the port 5671 (another port required by AMQP) is available.
I already tried setting the factory.Port = 5671
with no success. Another check using the Microsoft Azure IoT SDK reveiled that it is indeed possible to connect to the IoT-Hub.
This leads me to the assumption that I either miss an important configuration or it might not be possible to connect to Azure IoT-Hubs with RabbitMQ.