- Newest
- Most votes
- Most comments
Hello,
MQTT wildcards are indeed supported when subscribing to a MQTT topic. The topic which you subscribe to must be a subset of the allowed topics which are listed in the "resources" section of the access control policy.
I will work to get this clarified in the documentation.
For example: If you are allowed to subscribe to a/b/+/d in the resources section of the access control policy, then you may subscribe using the IPC call to a/b/c/d, a/b/e/d, or a/b/+/d.
You may also use *
in the resources section to allow subscribing to any topic.
Edit clarification:
Local PubSub is a different set of APIs; local pubsub is not MQTT, and thus it does not support MQTT-style wildcards.
If you wish to allow publishing and subscribing for local pubsub topics without specifying each topic individually, then you should use the wildcard *
Relevant content
- asked 2 years ago
- asked 4 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Hi, Michael. Thanks for the fast response. But I tried, and this doesn't works for aws.greengrass.ipc.pubsub. In my component configuration I use (just like explained in documentation): accessControl: aws.greengrass.ipc.pubsub: com.simemap.GG-EMU-pg-db-insert:pubsub:1: operations: - "aws.greengrass#PublishToTopic" - "aws.greengrass#SubscribeToTopic" policyDescription: "Allows access to publish/subscribe to all topics." resources: - "*"
In my code: (not working) topic = "Simemap/POC/1/1/+/eletric/data" request = SubscribeToTopicRequest() request.topic = topic request.qos = QOS.AT_MOST_ONCE handler = StreamHandler() operation = ipc_client.new_subscribe_to_topic(handler) future = operation.activate(request)
However, if I use topic = "Simemap/POC/1/1/POC_2/eletric/data"
works fine. I confirm wildcards works well for aws.greengrass.ipc.mqttproxy. But not for aws.greengrass.ipc.pubsub.
Hello, as I said, local pubsub (subscribe to topic) is not the same as MQTT, therefore it does not use MQTT wildcards. You can subscribe to a topic called a/b/+/c, but that is subscribing to literally a topic called a/b/+/c, it doesn't subscribe with a wildcard. Wildcard subscriptions are not supported in anyway for local pubsub, you must subscribe to the specific topic.