Subscription to IOThub with mqtt with static Topic.

Mark Frost 0 Reputation points
2024-09-13T10:50:59.09+00:00

Hi Experts

I am using a Device to Send/Receive msg to Azue IOThub via raw mqtt msg.

An Azure function is sending the C2D message.

Problem:

If I Subscribe to devices/{deviceName}/messages/devicebound/#

I am receiving the msg. Under this topic:

devices/{deviceName}/messages/devicebound/%24.mid=static&%24.to=%2Fdevices%2F{deviceName}%2Fmessages%2Fdevicebound

My problem starts because my Device does not support wildcards in the subscribe Topic.

Witch means that I need to subscribe to the full topic with the URL Parameters.

But if I do the subscribe to the full Topic I will not receive anything.

Even if I create a subscription to the full topic with the URL Parameters from a Test tool like MQTTX I will not receive anything.

Why can’t I subscribe to the full topic with URL parameters?  Is the a limitation or something?

Best Regards Mark  

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,273 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,766 Reputation points MVP Volunteer Moderator
    2024-09-13T20:44:29.7333333+00:00

    Hello @Mark Frost,

    welcome to this moderated Azure community forum.

    The IoT Hub is a cloud gateway for IoT devices where each device has its own registration and security identity.

    The IoT Hub support multiple protocols to accomplish the device-to-cloud and cloud-to-device communication like MQTT, AMQP, and HTTPS (not recommended).

    These protocols support the device twin abilities like cloud messages, direct methods, and device twin properties.

    See this blog post for an example implementation.

    There you will see a limited set of properties is supported.

    If you want to make use of 'plain' MQTT and all the abilities the MQTT protocol offers (like using custom topics, topic wildcards, last will and testament), check out the Azure EventGrid Namespace MQTT support.

    This is a 'plain' MQTT broker supporting both MQTT protocol V3.11 and V5 features.

    Check out this blog post on how to use this new MQTT broker living in Azure.


    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.