Skip to content
Spread work queue accross cluster of parse servers using SQS
Branch: master
Clone or download
acinader Merge pull request #26 from parse-community/dependabot/npm_and_yarn/l…
…odash-4.17.14

Bump lodash from 4.17.11 to 4.17.14
Latest commit ad355ea Jul 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.eslintrc move to airbnb base. Aug 9, 2017
.gitignore fix gitignore Dec 16, 2016
.travis.yml Don't specify peer version for parse-server Jun 29, 2018
README.md
index.js
package-lock.json
package.json release version and package were out of sync!! Jul 9, 2019

README.md

parse-server-sqs-mq-adapter

Build Status codecov Greenkeeper badge

AWS SQS backed message queue. This adapter allows a work queue to be spread across a cluster of machines.

Installation

npm install --save @parse/sqs-mq-adapter

Usage

const ParseServer = require('parse-server').ParseServer;
const SQSEventEmitterMQ = require('@parse/sqs-mq-adapter').SQSEventEmitterMQ;

config = {
  ....
  queueOptions: {
    messageQueueAdapter: SQSEventEmitterMQ,
    queueUrl: 'https://sqs.us-east-1.amazonaws.com/XXX/Parse-Queue', // required
    region: 'us-east-1',
  },
};

const parseServer = new ParseServer(config);

See: sqs-consumer for complete list of configuration options.

Credentials

By default the consumer will look for AWS credentials in the places specified by the AWS SDK. The simplest option is to export your credentials as environment variables:

export AWS_SECRET_ACCESS_KEY=...
export AWS_ACCESS_KEY_ID=...

If you need to specify your credentials manually, you can use a pre-configured instance of the AWS SQS client:

const ParseServer = require('parse-server').ParseServer;
const SQSEventEmitterMQ = require('@parse/sqs-mq-adapter').SQSEventEmitterMQ;
const AWS = require('aws-sdk');

AWS.config.update({
  region: 'eu-west-1',
  accessKeyId: '...',
  secretAccessKey: '...'
});

config = {
  ....
  messageQueueAdapter: SQSEventEmitterMQ,
  SQSEventEmitterMQOptions: {
    queueUrl: 'https://sqs.us-east-1.amazonaws.com/XXX/Parse-Queue',
    sqs: new AWS.SQS(),
  },
};

const parseServer = new ParseServer(config);
You can’t perform that action at this time.