It’s tough to get started using RabbitMQ in Node.js. Almost every npm package exposed me to RabbitMQ’s raw complexity that seemed to know no bounds. Thankfully I was smart enough to realize I wasn’t smart enough to try using the powerful libraries. I needed something simpler.
Eventually found Jackrabbit, which markets itself as “RabbitMQ in Node.js without hating life“.
Jackrabbit hides RabbitMQ’s complexity behind a very beginner-friendly API, so it was an obvious choice to get started with. Today, I’m still happily using it 🙂
While I haven’t outgrown Jackrabbit yet, my needs are slightly more mature. Would love to hook into its event emitter so I can get some insight from (or just log) what Jackrabbit is doing.
Unfortunately there’s no public documentation of Jackrabbit’s API, so I’m writing this blog post to document my notes and serve as a starting point for other beginners.
Odds are you don’t remember exactly how the code works so you need to read a lot of it just to figure out what’s wrong. While this is the norm in most cases, it diagnosing problems in code doesn’t have to be this painful.
Due to its long life expectancy (27%+ of its population is over 65), many seniors have resorted to a very unusual tactic to get state-sponsored care: going to prison.
Neither the government nor the private sector has established an effective rehabilitation program for seniors, and the costs to keep them in prison are rising fast. Expenses associated with elder care helped push annual medical costs at correctional facilities past 6 billion yen (more than $50 million) in 2015, an 80 percent increase from a decade before.
At some facilities, being a correctional officer has come to resemble being a nursing-home attendant. Satomi Kezuka, a veteran officer at Tochigi Women’s Prison, about 60 miles north of Tokyo, says her duties now include dealing with incontinence.
If your app has never experienced memory issues, is it really in production?
An Erlang-Inspired Node.js project I deployed at work runs out of memory randomly. It maintains a relatively flat memory usage profile at about 10% of the server’s RAM, but it will suddenly spike to 1.5x ~ 2x RAM.
Thankfully Heroku is flexible enough to tolerate spikes under 2x of the allotted RAM so in most cases the app continues to do its job and the worst that happens is I get notified about it. Despite its ability to elegantly recover from crashes, my pride felt like it was being curb-stomped whenever Slack notified me the server ran out of memory again.
After determining to redeem my self-respect by fixing the issue, I quickly realized I had no idea where to begin!
Despite the unshakable feeling that I’m a terrible programmer, I’ve end up going on some very experimental journeys writing code that reflects the way I think about software.
I feel like a teenager who just discovered he has super-powers!
Last year we gave our production servers the ability to send notifications to Slack and it’s been so helpful! Each one comes with all the relevant data, sometimes with a link to an admin page where you can fix the problem. It’s been truly empowering to deal with many types of problems without needing to write code.
One of the notifications is for a problem we can’t fix without input from our customers, so we needed to move the data from Slack to a Google Spreadsheet we could share with them.
Quickly discarding the idea creating an endpoint that gave me a CSV-formatted version of the data, I settled on copying the text straight from Slack (it was already there for the copy-pasting so don’t judge me) to a file and writing a program to process the Markdown-formatted data from Slack to generate the CSV.
The formatting program itself is nothing special, so straightforward I didn’t need to import a single library to make it work, but you wouldn’t believe how much more useful the program got after a tiny change at the beginning and the end of the code.