Skip to content

(feature request): MQTT Retained message support between local broker and IoT Core #77

@shumailxyz

Description

@shumailxyz

Describe the bug
I am running MQTT bridge on GG core, configured to forward messages between LocalMqtt to IotCore and vice versa. The bridge does not work with MQTT retained messages. When local client device publishes a retained MQTT message on a topic, forwarded by bridge to IotCore - new subscription of IotCore does not receive the retained message.

To Reproduce

  1. Run bridge with following config:
{
  "mqttTopicMapping": {
      "ClientDevicesToCloud": {
          "topic": "from_local/#",
          "source": "LocalMqtt",
          "target": "IotCore",
      },
      "CloudToClientDevices": {
          "topic": "from_cloud/#",
          "source": "IotCore",
          "target": "LocalMqtt",
      },
  }
}
  1. Publish a MQTT retained message from local client on topic from_local/test.
  2. Go to AWS Iot Core > MQTT test client.
  3. Subscribe on topic from_local/test.
  4. Retained message should appear when you subscribe.
  5. Or retained message should also appear under Retained messages page on AWS IoT Core.

Expected behavior
A local client device publishes a retained MQTT message on a topic, forwarded by bridge to IotCore. I expect that when a new client on AWS IoT Core subscribes on that topic, it receives the retained message.

Actual behavior
When a new client subscribes on topic, it does not receive the retained MQTT message.

Environment

  • OS: Amazon Linux 2 (Linux version 4.14.287-215.504.amzn2.x86_64 )
  • Nucleus version: 2.7.0
  • MQTT Bridge version: 2.2.2
  • aws.greengrass.clientdevices.mqtt.Moquette : 2.2.0

Additional context
We use a specific standard VDA5050 for AGVs - Automated Guided Vehicles (client devices) that requires messages on some specific topics to be sent with RETAINED flag set to true. The services running on AWS cloud following that standard must follow the standard and should be able to receive RETAINED messages sent by local client devices (that communicate through GG core & bridge).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions