kffl / fastify-amqp-async Goto Github PK
View Code? Open in Web Editor NEW:zap::rabbit: Fastify AMQP plugin with modern Promise-based API based on amqplib-as-promised
License: MIT License
:zap::rabbit: Fastify AMQP plugin with modern Promise-based API based on amqplib-as-promised
License: MIT License
When accessing amqp.confirmChannel
, IDE type hints are not working properly (all of its methods are assumed to be of type any). After installing @types/amqplib
, it turns out that confirmChannel
is of native amqplib's type ConfirmChannel
and not that of amqplib-as-promised (which wraps the native ConfirmChannel
in order to expose promise-based API). This problem doesn't break anything at runtime, since Connection.createChannel()
returns an object with the desired prototype (despite wrong type info).
That behavior is caused by amqplib-as-promised exporting the native ConfirmChannel
instead of the wrapped one.
As of now, the plugin provides a basic onClose
handler which closes the AMQP connection when the Fastify instance closes. It might be beneficial to allow the user to opt-out of such behavior and provide custom logic in onClose
(i.e. waiting for in-flight messages to be delivered before terminating the AMQP connection).
Logging via a FastifyInstance's child logger could be added for easier debugging. Logs could be printed when the following events occur:
As of now, there is a known vulnerability in url-parse
used by amqplib
, which is a dependency of amqplib-as-promised
. Since amqplib-as-promised
uses a rather old version 0.5.5 of amqplib
there are two less severe vulnerabilities as well. These can be temporarily fixed using npm-force-resolutions
until the top-level dependencies update their sub-dependencies as needed.
Version 1 could be released in order to allow for updates within a major version when a dependency is declared with a caret symbol.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.