Copy of payload to external MQTT

Vinicius Miranda 0 Reputation points
2024-04-26T19:40:29.97+00:00

So, my question is whether, even if I have my devices inside the Azure platform, I'll be able to send copies of their payloads to an external MQTT.

To explain: I have a lab and I'm testing interactions and homologations all the time. In this case, I'd like to know if it's possible that by receiving my payloads in Azure, I could forward a copy of these messages to my own MQTT which is hosted on a server. So I would handle the messages both in Azure and in my own MQTT.

My MQTT is RabbitMQ.

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
401 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
576 questions
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
364 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,201 questions
Azure IoT Operations
Azure IoT Operations
Azure IoT Operations is a set of modular services enabled by Azure Arc.
28 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Azar 22,870 Reputation points MVP
    2024-04-26T21:35:05.6533333+00:00

    Hi there Vinicius Miranda

    Thanks for posting on QandA platform,

    I guess you're definitely on the right track! It's possible to send copies of your device payloads from Azure to your own MQTT.

    If your devices are already sending messages to Azure IoT Hub or Event Hubs, you can set up message routing to automatically forward copies of these messages to your RabbitMQ MQTT broker. You can define rules to filter messages based on properties or content, ensuring you're only forwarding what you need.

    If this helps kindly accept the answer thanks ,much.

    1 person found this answer helpful.
    0 comments No comments

  2. Sander van de Velde | MVP 33,051 Reputation points MVP
    2024-04-27T15:46:10.9+00:00

    Hello @Vinicius Miranda ,

    welcome to this moderated Azure community forum.

    The answer provided by @Azar is good advice, any message received in the cloud can be forwarded.

    I created a separate answer because I want to propose a different approach.

    You have a MQTT running locally.

    This could be an instance installed on a machine already or running inside an 'edge' solution as seen with this Azure IoT Edge local MQTT module example.

    If your devices can send data to the local MQTT broker, you can then forward any message to a cloud solution.

    This is a faster solution than the full roundtrip, from local device to the cloud and back again.

    This could be done using the Azure IoT Hub and Azure IoT edge as seen in the example above where the internal edge routing is an easy solution for bridging the MQTT broker topics towards messages being sent to the cloud. It also offers temporary local storage of messages when the cloud connection is interrupted. Azure IoT Edge is also great for filtering, enriching or transforming messages locally.

    Depending on the level of security and architecture needs, messages can be forwarded to other cloud endpoints too.

    You only need to program some custom logic listening to topics on the local MQTT broker and forward it to eg. an Azure Function or the EventGrid MQTT broker.

    I hope this architecture alternative offers some new ideas regarding building a stable solution.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.