loopback-sqs-producer-mixin
SQS Producer mixin for loopback to add sendEvent method to your models.
INSTALL
npm install loopback-sqs-producer-mixin --save
SERVER CONFIG
Add the mixins
property to your server/model-config.json
:
MODEL CONFIG
To use with your Models add the mixins
attribute to the definition object of your model config.
CONNEXIONS
To be able to connect to your SQS queue and listen for events in the topic, you have to set the SQS_QUEUE_URL and AWS_REGION env variables. You also have to set AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID for authentication.
export SQS_QUEUE_URL=https://sqs.eu-west-1.amazonaws.com/account-id/queue-nameexport AWS_SECRET_ACCESS_KEY=...export AWS_ACCESS_KEY_ID=...export AWS_REGION=eu-west-1