Adding message queues to PacktChat

We can now add message queues to the application we are building. Our application does not need credit card processing or transaction e-mails, but we will add logging through RabbitMQ. We will create a logging exchange and two queues, debug.log and error.log. The debug.log queue will log everything that comes through the exchange (including errors), and error.log will only log errors. We will do this by using a topic exchange.

Topic exchange

Our test applications have used a direct exchange. What this means is that the queue must use the same exact routing key that the message was published with. Topic exchanges allow pattern matching in the routing key. In our example, we will bind the debug.log queue with a routing ...

Get Building Scalable Apps with Redis and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.