Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMq Consumer on AWS Lambda

From what I know, Lambdas are for listening to events and running a piece of code on response to those events.

The events need to be AWS services or HTTP endpoints. If I have a RabbitMq service running on an EC2 server (Not using SQS), is it possible to have a consumer deployed on Lambda?

If possible, would this be the right thing to do?

Also, since lambdas are billed on compute time, I shouldn't be billed for when the queue is idle, right?

like image 662
Vaulstein Avatar asked Jun 12 '17 09:06

Vaulstein


People also ask

Is Amazon MQ compatible with RabbitMQ?

Amazon MQ now supports RabbitMQ, a popular open source message broker. This enables you to migrate your existing RabbitMQ message brokers to AWS without having to rewrite code.

What is the difference between Amazon MQ and SQS?

As I understand, both AWS MQ and AWS SQS are Message Queue tools. The only noted difference is that SQS is fully managed.


1 Answers

You can probably install this on the same server as the rabbitMQ, and make it trigger the lambdas. I haven't tried myself though https://github.com/AirHelp/rabbit-amazon-forwarder

As far as I understand, lambdas are billed by the running time, and you pay based on amount of memory (per gigabyte/second). So making a lambda wait all the time will probably be pretty expensive and hard to manage since it will time out. If you already have a server with RabbitMQ, use that for consuming the queue and calling the lambdas.

like image 194
Esben von Buchwald Avatar answered Sep 19 '22 06:09

Esben von Buchwald