Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (37 sloc) 2.01 KB
title permalink
Install MQLess locally
/docs/install-locally/

In order to run MQLess locally, we first need a way to run Lambda locally. For IOT example we would also need DynamoDB to store the actors' state.

Prerequisites

Install NodeJS, Docker, AWS Cli and SAM Cli.

On linux, it is recommended to allow docker cli to run without sudo, follow this guide https://docs.docker.com/install/linux/linux-postinstall/.

Configure Docker Network

In order for the local Lambda instance and Dynamodb to talk to each other, we need to create a user-defined network.

docker network create mqless-local --subnet 192.168.0.0/24 --gateway 192.168.0.1

Install Dynamodb

We are going to use amazon docker image for local dynamodb and configure it to use the network we just created.

docker run -d -p 8000:8000 --restart always --network mqless-local --name dynamodb amazon/dynamodb-local

State Table

It is recommended to store the actors' state in Dyanmodb, as we do in the tutorial. Run the following to create the table locally:

aws dynamodb create-table --endpoint-url http://localhost:8000 \
  --table-name state \
  --attribute-definitions '[{"AttributeName": "address", "AttributeType": "S"}]' \
  --key-schema '[{"AttributeName": "address", "KeyType": "HASH"}]' \
  --provisioned-throughput '{"ReadCapacityUnits":1,"WriteCapacityUnits":1}'

Install MQLess

We are going to install MQLess as docker container as well.

 docker run -d -p 34543:34543 --restart always --name mqless --network mqless-local mqless/mqless --aws-local http://192.168.0.1:3001

Summary

You now have MQLess installed locally together with DynamoDB and SAM cli. You are ready to develop your MQLess applicaiton and test it locally.

You can’t perform that action at this time.