New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@proca/queue

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@proca/queue

Proca server pushes actions through AMQP queues, to which you can plug in your microservice. This module provides few helpers to work with queues.

  • 5.3.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
0
Weekly downloads
 
Created
Source

Proca SDK: queue helpers

Proca server pushes actions through AMQP queues, to which you can plug in your microservice. This module provides few helpers to work with queues.

if you intend to sync with a crm, you might want to start with this higher level template

TypeScript types

  • ActionMessageV2 - a type describing message with an action data
  • EventMessageV2 - a type describing message with an event supporter email_status changed data
  • CampaignUpdated - a type describing message with an event campaign updated data

Functions

  • syncQueue(url, queueName, callback, options) - Start reading actions and events from queueName queue from AMQP server at url. For each action or event, callback is called.

    • options is a map with:

      • concurrency - if set, set number of messages to be processed at the same time
      • keyStore - decryption key store (see @proca/crypto module) if PII of supporters is to be decrypted
    • Callback signature is: async callback(action : ActionMessageV2 | EventMessageV2)

    • it returns boolean (or {processed:boolean{) if false, the message is nacked. if it's the first time the message has been processed, it is directly requeued, otherwise, it's dropped (pushed in the dead-letter queue and replayed later)

    • if this function throw an error, we are going to close the connection

    • TODO: testQueue(url, queueName) - If queue queueName exists on AMQP server url, return its stats

AMQP authentication

Use HTTP Basic Auth inlined in url to authenticate to AMQP server (eg. amqps://username:password@example.com:1572).

Version 5.0.0

Function syncQueue is updated to manage the case when it needs to nack a message without closing the channel. It will fail if the callback does not return the boolean. All the apps that use version 3 of this function should be adapted before updating, or they will break.

Keywords

FAQs

Package last updated on 22 Jan 2025

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