3

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.

2 Answers2

0

You certainly want to look into addressing specific endpoints such as the device to cloud messaging one and into the authentication mechanisms linked from this doc as well.

Olivier Bloch
  • 662
  • 4
  • 7
  • Thank you for your answer. However, your linked Documentation only covers accessing the iot-hub via the Microsoft Azure SDK. As already stated, I can do that. My question is, how to achieve this using RabbitMQ. – DeveloperExceptionError Jun 09 '17 at 08:16
  • We indeed don't have such a detailed documentation for AMQP yet. However, one of our MVPs has published a couple of articles that can certainly help (using another library but explaining endpoints and authentication). https://paolopatierno.wordpress.com/2015/10/24/connecting-to-the-azure-iot-hub-using-an-the-amqp-stack/ https://paolopatierno.wordpress.com/2015/10/31/azure-iot-hub-commands-and-feedback-using-amqp-net-lite/ If you may, I'd like to understand why you wouldn't want to use our SDKs. We'd like to improve them, so any feedback (especially negative) is more than welcome – Olivier Bloch Jun 12 '17 at 15:56
  • @OlivierBlock Thank you for your reply. We are currently looking for an SDK to use for AMQP communication. For this we already created a few prototypes, also one using the Microsoft Azure SDKs. All of the previous ones are working as expected. The question was if RabbitMQ could also be one of the possible candidates, as we would not be bound to Azure using it. After having a talk with one of your Cloud Solution Architects at Microsoft in Berlin (Germany), I am pretty sure it is not possible because of the version difference in the used AMQP protocol (0.9.1 to 1.0 seems not to be possible). – DeveloperExceptionError Jun 14 '17 at 12:38
  • Indeed, the AMQP version might be an issue. Thanks for sharing more about what you are doing. Have you checked the one we are using under the hoods for our csharp SDK (https://github.com/Azure/azure-amqp) ? – Olivier Bloch Jun 15 '17 at 15:34
0

Here again as an answer:

After having a talk with a Cloud Solution Architect at Microsoft in Berlin (Germany), I am pretty sure it is not possible because of the version difference in the used AMQP protocol (0.9.1 to 1.0 seems not to be possible).