How it works...
In this recipe, we demonstrated how to use the AMQP connector that the Alpakka project provides. In our scenario, we consumed messages from an AMQP queue called akka_streams_consumer_queue. The amqpSource is a Source object responsible for taking these messages and pushing them into the stream using the IncomingMessage type. After that, we mapped them to OutgoingMessage so the amqpSink Sink object understands them and is able to push them to an AMQP exchange.
While configuring our source and sink, we also define our queues, exchange, and binding declarations. This is required because these elements need to exist in the RabbitMQ server before you use them. If you try to use them before declaring them, an exception will be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access