I currently have an API running that delegates an ingestion job to a short polling bash script. I wan't to know if using something like the native adapter of strongMQ would consume less resources than the short-polling implementation.
https://github.com/strongloop/strong-mq
If message queuing is less resource-intensive than short-polling how exactly is this possible considering that an implementation of a message queue is a separately running microservice which is yet another node-process or "cluster" running on the operating system.
It comes down to polling frequency and the overhead for each poll.
If you aren't polling very frequently, then it may consume less resources to do something like a bash script in a crontab because the resources are only consumed during the poll.
If you are polling so frequently that your polling script spends more time running than sleeping, then it may make more sense to use something like a message queue and pay a smaller but more constant overhead tax.
Each cycle involves starting a bash process, and that bash process forks off a handful of child processes to perform tasks like reading a file and running the results through grep, then you've got some measurable overhead. If the result of the checks are positive, you fork off some other script or process to perform the queued action.
Each cycle involves inspecting a value in memory against some sort of conditional. If the condition is met, send a notification message/packet to a connected client. The client then performs whatever action was queued.