Processing RabbitMQ messages with Akka streams
Messaging brokers have become the central piece of many distributed and real-time systems. RabbitMQ is one of most commonly used brokers nowadays. It is an open source Advanced Message Queuing Protocol (AMQP) and Message Queue Telemetry Transport (MQTT) broker that provides a clustered high-availability solution to decouple applications using the publisher-subscriber pattern.
In this recipe, we will see how to consume AMQP messages from a RabbitMQ queue into your stream. Once consumed, we will transform the message and publish it back to RabbitMQ. To achieve this, we are going to use the AMQP module from Alpakka. Alpakka is a community-driven repository that provides useful Akka Streams stages for the most common protocols and formats. For example, there are connectors for Amazon S3, Amazon SQS, JMS, Cassandra, and many others.
Note
To check all the available Alpakka modules, visit their GitHub repository at https://github.com/akka/alpakka.