| CARVIEW |
Select Language
HTTP/2 301
date: Sat, 17 Jan 2026 06:38:47 GMT
content-type: text/html; charset=iso-8859-1
location: https://doc.akkasource.org/amqp
server: cloudflare
host-header: 6b7412fb82ca5edfd0917e3957f05d89
x-proxy-cache: MISS
x-proxy-cache-info: 0301 NC:000000 UP:
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=Cq2yjUQKHGD4OZwiAjYwC0WS62CgT3kI0%2Fvy%2BZxufmsDlOHLi8D6NbOf2mXU%2BfUzEH9FVhAsxwTBF0SLuxUvSfAVAMigJaSfHdd%2FqGkH30XpYA%3D%3D"}]}
cf-ray: 9bf3da05ba7eb081-BOM
alt-svc: h3=":443"; ma=86400
HTTP/1.1 200 OK
Date: Sat, 17 Jan 2026 06:38:47 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: cloudflare
Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
Vary: Accept-Encoding
X-Httpd: 1
Host-Header: 6b7412fb82ca5edfd0917e3957f05d89
X-Proxy-Cache: MISS
X-Proxy-Cache-Info: 0 NC:000000 UP:
Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=7x0umbslih8MPcpjklZ7NYJ4uQpQa1Lfq07iXYb9%2FejyI7b7Jahg7jzUZExIp8UhcgO%2FJcgEdSp%2Fjn6fM76WMnDBzFhX88OtabwP%2Bv9rhSKQDA%3D%3D"}]}
cf-cache-status: DYNAMIC
Content-Encoding: gzip
CF-RAY: 9bf3da093b5b4938-BOM
alt-svc: h3=":443"; ma=86400
akka - amqp
Home
Download
Getting Started
Build & run Akka
Documentation
Project Info
- Source Code
- Maven Repository
- Team
- Issue Tracking
- Mailing List
- License
- Release Notes
- Developer Guidelines
- Sponsors
- Benchmark
- Commercial Support
Join this Wiki-
Recent Changes
-
Manage Wiki
Protected
Akka has an AMQP module which abstracts AMQP Producer and Consumer as Actors. It is fault-tolerant through supervisor hierarchies and does auto-reconnect on failure.
It is currently based on the RabbitMQ Java client but completely generic, works with any AMQP broker.
Here is an simple example showing how to create a Producer and Consumer and add a MessageConsumerListener (with an Actor listener) to the consumer to have it send the actor each new message posted to the consumer. The first method is configured using a 'direct' exchange and the second one a 'fanout' exchange.
| Details |
last edit by |
|
|---|---|---|
| Tags |
AMQP
Akka has an AMQP module which abstracts AMQP Producer and Consumer as Actors. It is fault-tolerant through supervisor hierarchies and does auto-reconnect on failure.
It is currently based on the RabbitMQ Java client but completely generic, works with any AMQP broker.
Here is an simple example showing how to create a Producer and Consumer and add a MessageConsumerListener (with an Actor listener) to the consumer to have it send the actor each new message posted to the consumer. The first method is configured using a 'direct' exchange and the second one a 'fanout' exchange.
import se.scalablesolutions.akka.amqp.AMQP._ import se.scalablesolutions.akka.actor.Actor._ val CONFIG = new ConnectionParameters val HOSTNAME = "localhost" val PORT = 5672 val IM = "im.whitehouse.gov" val CHAT = "chat.whitehouse.gov" def direct = { val consumer = AMQP.newConsumer( CONFIG, HOSTNAME, PORT, IM, ExchangeType.Direct, None, 100, false, false, Map[String, AnyRef]()) consumer ! MessageConsumerListener("@george_bush", "direct", actor { case Message(payload, _, _, _, _) => l log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) }) val producer = AMQP.newProducer(CONFIG, HOSTNAME, PORT, IM, None, None, 100) producer ! Message("@me: Nobody expects the Spanish Inquisition!".getBytes, "direct") } def fanout = { val consumer = AMQP.newConsumer( CONFIG, HOSTNAME, PORT, CHAT, ExchangeType.Fanout, None, 100, false, false, Map[String, AnyRef]()) consumer ! MessageConsumerListener("@george_bush", "", actor { case Message(payload, _, _, _, _) => log.info("@george_bush received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) }) consumer ! MessageConsumerListener("@barack_obama", "", actor { case Message(payload, _, _, _, _) => log.info("@barack_obama received message from: %s", new String(payload.asInstanceOf[Array[Byte]])) }) val producer = AMQP.newProducer(CONFIG, HOSTNAME, PORT, CHAT, None, None, 100) producer ! Message("@me: I'm going surfing".getBytes, "") }
Copyright 2009-2010 - Scalable Solutions AB

