By following tutorials from RabbitMQ official site. There is a problem for me to adapt the code from tutorials and use it in my project, since most examples not running on long-lived process.
After googling for a pattern I could use, I ended up found this great article
So here I will use pattern I found from the article along with express.js to create producer, and use this tutorial to create consumer.
- node & npm
- rabbitmq
npm install
rabbitmq-server
# first terminal
node app.js
# second terminal
node rpcServer.js
Then navigate to "localhost:3000/fibonacci/15" and you will see the result.