Using rumqttc (publish only) from short-lived FaaS function in AWS #914
Unanswered
replicadse
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've successfully been able to integrate rumqttc with AWS IoT core, for which I might also create a use-case example for. So far it's all been working flawlessly.
I do have however an issue when I try to sen messages from an AWS Lambda function, which is the FaaS equivalent. Specifically, if I understand correctly, sending messages requires polling on the event loop since otherwise I don't see any outgoing messages.
First question: Am I right that I need to poll the event loop even when only transmitting to the MQTT broker or did I understand something wrong?
Second question: How do I know when to stop polling? I'd like to avoid doing this by timeout / message counting and am looking for an idiomatic way if there is one.
If this becomes too big of an issue, an alternative would be running a container that lives long (probably ECS / Fargate) that contains a stable long-term connection and takes messages from a queue and processes the event loop continuously. But since that'd cost more than the entire rest of the stack combined I'd like to avoid it for now.
Any way help is much appreciated!
PS: Rough architecture for people familiar with AWS:
Agent mqtt -> publish to IoT Core topic -> Topic rule into SNS -> SQS -> Invokes Lambda function -> does stuff brrrr brrrr processing -> Publish response message (if needed) to topic
Beta Was this translation helpful? Give feedback.
All reactions