Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

off-sqs-debearloper

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

off-sqs-debearloper

Helper app that manages SQS and RabbitMQ transactions

  • 0.1.13
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

OFF-SQS: Manage Amazon SQS and RabbitMQ on node.js

This easy manager provides the basic functionality to use Amazon SQS in production enviroment and RabbitMQ in development enviroment. To start using it just clone it or install it via npm npm install off-sqs-debearloper.

Amazon SQS settings

You only need edit the aws-config.json adding your own keys:

    {
        "accessKeyId": "STRING",
        "secretAccessKey": "STRING",
        "region": "STRING"
    }

Note: that every operation checks first if the Queue exists, if not it'll create it.**

RabbitMQ settings

To work with RabbitMQ, you need to install the Server. We recommend you to do it with homebrew, so you dont have to set up the server manually when you are in the development environment.

Before installing make sure you have the latest brews: brew update

Then, install RabbitMQ server with:

brew install rabbitmq

Enviroments

development is the enviroment by default. If you want to use production or qa execute your node app in this way:

NODE_ENV=production node yourApp.js
//or
NODE_ENV=qa node yourApp.js

Methods

Sender()

  • Params: the name of the SQS queue and the data you want to send.
  • Returns: nothing.

Usage:

sqs.sender('myQueueName', ["foo": "bar"]);

##Receiver()

  • Params: the name of the SQS queue.
  • Return: A promise which will become a tuple of receiver a function and queueUrl a string.

Usage:

   sqs.receiver('myQueue').then(function(Receiver){
   	Receiver.receiver(Receiver.url, yourDataManager);
   }

Note: Where yourDataManager is a function that receives every message on the queue, so you can easyly customize your data miner. Something like: `myMiner(messageOfTheQueue);``

###Example

    offSqs.receiver("queueName").then(function(data){
        data.receiver(data.url, saveData);
    });

    var saveData = function(data){
       //save your data
    }

##getQueueUrl()

  • Params: The name of the SQS Queue.
  • Returns: A promise, which will become the url of the Queue.

Usage:

    sqs.getQueueUrl('myQueue').then(function('myQueueURL'){
    	return myQueueURL;
    });

##parseMessage()

  • Params: Data received by SQS Queues.
  • Returns: The cleaned data of the body as array.

Usage:

sqs.parseMessage(data);

Keywords

FAQs

Package last updated on 20 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc