Search code examples
amazon-web-servicesmqttaws-iotsolaceaws-iot-core

Can AWS IoT core subscribe to an external Solace broker MQTT topic?


We have a Solace broker hosted on prem and we'd like to host the backend of our application on AWS with AppSync (GraphQL server) and lambda resolvers.

The question is, how do we subscribe to a Solace broker topic (MQTT) from AWS?

Can we achieve this using AWS IoT core to subscribe?

All we want is our AWS environment to subscribe to an MQTT topic and trigger a lambda.

I realize that we could simply run an EC2 instance with an MQTT.js client but that could prove a little more tricky to scale, a managed solution would be preferable.


Solution

  • I don't know AWS IoT Core much, but here are some options I can think of :

    • Solace PubSub+ has webhook capabilities. The feature is called RDP for REST Delivery Point. It integrates well with AWS API Gateway, and you can call Lambda fonctions or Kinesis for example.
    • How it works : as part of the RDP configuration, you'll create two main configuration
    • a queue that will subscribe to the topics you're interested in having in IoTCore. This list of topics can be updated in real time via the management REST API. (SEMP)
    • The other part of the configuration is where should this events should be posted as HTTP POST (host, port, auth via the API Gateway). The URI and the headers can be configured dynamically from each events topics levels. (ex: company/factory/{robotTypeA|robotTypeB|robotTypeC}/...) you can use ${topic(3)} to get the robot type, so that you can send events to different Lambda depending on the robot type that is sending events.
    • The documentation for RDP is here : https://docs.solace.com/Services/Managing-RDPs.htm (The wizard you see below makes the configuration quite easy, the documentation is for the "build your own connector)

    Solace PubSub+ Manager RDP Connection with AWS

    • Another option is to connect Solace PubSub+ with IoTCore using an MQTT Bridge, as both Solace PubSub+ and AWS IoT Core supports MQTT.
      • You can use this connector : https://solace.com/connectors/mqtt-bridge-connector/ You need to contact Solace to get the connector (which is free to use, currently in Early Access). It's a Spring framework based connector that has HA, Multiple Active instance, monitoring features built in.
      • if IoT Core has bridging capabilities, this could be an option as well