aduis / hapi-rabbit Goto Github PK
View Code? Open in Web Editor NEWrabbitMQ hapijs plugin
rabbitMQ hapijs plugin
Nice work! But ran into an error when subscribed data is received from RabbitMQ. I got if fixed by changing JSON.parse(message) to JSON.parse(message)
hapi-rabbit/lib/index.js
sub.on('data', function (message) {
// callback(null, JSON.parse(message)); -> throw an error
callback(null, JSON.stringify(message));
});
This may be a dumb question but I'm not sure I understand what you get by making this a plugin versus just using a native RabbitMQ module? I'd really appreciate it if someone can explain this to me.
Thanks
plugin.events.once('start', function () {
...
TypeError: Cannot read property 'once' of undefined
If you are not aware yet, Hapi v17 is making the transition from callbacks to async
/await
, as well as deprecating some other rarely used functionality. This is a breaking change that may make your plugin no longer compatible with the Hapi API.
Draft release notes can be found here: hapijs/hapi#3658
The target release date for v17 is the beginning of November.
async
/await
compatible using the v17
branch from Hapi for testing
npm link
within the Hapi reponpm link hapi
within your plugin repov17
of Hapi branch for testsnpm
. Please use a major version increment as this will be a breaking change and it would be terrible for it to sneak into current versions of Hapi.<8.0.0
.v16
will continue to be supported for as long as there exists a Node LTS actively being supported that is not compatible with v17
.messageType in rabbit.publish function should allow special characters like ".", "*", "#" in order to respect rabbit topic routing_key format . RabbitMq Topic.
Your plugin instead allow only alphanumeric characters.
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.