The module consumer-pgmq to consume messages from Supabase/Postgres queue
I’m here today to show you the node.js module consumer-pgmq I created. The module took the responsibility of polling the messages and passing the messages to a handler function to process.
Why I created it?
Recently I discovered a feature queue on Supabase where I can implement a messaging queue using Postgresql database.
Spoiler if you have a Postgresql running out of Supabase you can use the queue feature too, you need only install the extension named pgmq. Link of instructions: https://lnkd.in/dii-Q7Wv
But I noticed something missing on my opinion I didn’t find a package on Npm to make the polling from the message and passing to a function I defined to execute something, so as result of it I created the npm package named consumer-pgmq where integrate with Supabase and Postgresql
What did I learned?
- Github actions + semantic-release to update the release and generate the versions of my module based on the git commits. PS: the version generated is based on the semantic version. - Github actions to automate the process to build and publish the module on Npm. - Use the AbortController class on Node.js to stop the asynchronous(Promise) processes if it takes a long time to execute. - I reviewed the EventEmitter
Link of module on Npm: https://www.npmjs.com/package/consumer-pgmq Link of Github repository: https://github.com/tiago123456789/consumer-pgmq
No comments yet