Which makes this hack entirely unneccessary for SNS notifcations. Update: Lambda now supports SNS notifications as an event source, In the readme, the author mentions the following: Just to extend my question with some research I've made, this github repo shows how to read an SQS queu from a Lambda function but the lambda function works only if is fired from the command line: Is there another way to do what I want or am I in a dead-end? I have the feeling that is not possible to create this infrastructure due to the current limitations in the AWS services. Right now I'm a bit stuck because I don't know how to continue. I was thinking in using SNS notifications to invoke the Lambda function so that every time a message is pushed to the queue, an SNS notification is fired and invokes the Lambda function but after playing a bit with it I've realised that is not possible to create an SNS notification from SQS, it's only possible to write SNS notifications to the queue. I know that Lambda function are invoked in response to an event, and the events supported at the moment are S3, SNS, SES, DynamoDB, Kinesis, Cognito, CloudWatch and Cloudformation but NOT SQS. The problem is that I don't know if this is possible. Now I want to put the process that reads the SQS ( process 2) in a Lambda function so that the process that writes to the queue and the one that reads from the queue are completely independent. ( Just to clarify, messages are generated by users, they send a chunk of data which can contain arbitrary information to the endpoint where the process 1 is listening) When it finds a message in the queue it inserts the data in a MariaDB database sitting on an RDS instance. Then I have another process in the same machine reading the queue using long polling ( process 2). Every time the process receives a message it sends it to an SQS queue. I have an EC2 instance with a NodeJS+Express process listening on a port for messages ( process 1).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |