Wondering what’s next for npm?Check out our public roadmap! »

    @parse/sqs-mq-adapter

    1.3.4 • Public • Published

    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);
     

    Keywords

    none

    Install

    npm i @parse/sqs-mq-adapter

    DownloadsWeekly Downloads

    12

    Version

    1.3.4

    License

    MIT

    Unpacked Size

    10.5 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar