Messaging serendipity

One of the advantages of messaging is that the new behavior that wasn't initially envisioned can easily be grafted to a system because of its lowly coupled nature. In our case, the fact that all application logs are not being published to a single topic exchange allows us to create a specific consumer that will receive only error messages and report them to the operations team.

If you remember our discussion about the routing keys used by the application logs' publishers, all we need to do is to receive messages whose routing first component (that is, the string before the first period of the routing key) indicates an error. These components are as follows:

  • For the syslog publisher: err, crit, alert, and emerg
  • for the Log4j ...

Get RabbitMQ Essentials 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.