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.
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 key of *.log
. This will match any messages that are debug.log
or error.log
. The error.log
queue will bind using error.log
, so it will work exactly like a direct exchange. The exchange will put an error.log
message in both the error and debug...