
Security News
Security Community Slams MIT-linked Report Claiming AI Powers 80% of Ransomware
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.
exp-amqp-connection
Advanced tools
This library is intended for doing simple publish and subscribe to an amqp broker.
Limitations:
Exposes a single function that boostraps a broker object, which in turn can be used for publishing and consuming messages. The connection will be re-established in case of errors.
For example:
const init = require("exp-amqp-connection");
const behaviour = {
  exchange: "my-exchange",
  url: "amqp://localhost"
};
const broker = init(behaviour);
broker.subscribeTmp("routingKey1", console.log);
broker.subscribeTmp("routingKey2", console.log);
broker.publish("routingKey1", "Msg 1");
broker.publish("routingKey1", "Msg 2");
// Delay delivery with 3000 ms using temporary exchange/queue-pair and dead-lettering.
broker.delayedPublish("routingKey2", "Msg 3", 3000);
The following options are accepted:
The broker object returned has the following functions. See the examples for more info on parameters etc.
Regular publish
Delayed publish using dead-letter-hack: https://www.cloudamqp.com/docs/delayed-messages.html
Subscribe using named durable queue.
If you need to wait for the subscription to start, use .on("subscribed", (sub) => ...)
Subscribe using nameless tmp queue. Queue will be destroyed when the broker disconnects.
If you need to wait for the subscription to start, use .on("subscribed", (sub) => ...)
Shuts down connection to broker.
By default one and only one connection is maintained for the entire process.
It is possible to add more by initializing with another configKey.
For example:
const init = require("exp-amqp-connection");
const behaviour = {
  exchange: "my-exchange",
  url: "amqp://localhost",
  configKey: "my-amqp"
};
// 1st connection
const broker = init(behaviour);
const otherBehaviour = {
   url: "amqp://otherhost",
   exchange: "other-exchange",
   configKey: "other-amqp"
}
const broker2 = init(behaviour2)
FAQs
Wrapper for amqp lib that adds some nice features
The npm package exp-amqp-connection receives a total of 87 weekly downloads. As such, exp-amqp-connection popularity was classified as not popular.
We found that exp-amqp-connection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 18 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.