sonata-project/SonataNotificationBundle — pull request #24 by pulse00 (2012-10-22 22:14:36+00:00)
Title: [WIP] added support for multiple queues/routing keys (refs #20)

This PR adds support for multiple rabbitMQ backend queues. The rabbitMQ configuration has been changed to make the definition of multiple queue/route_key combinations possible, e.g.:

```yaml
sonata_notification:
backend: sonata.notification.backend.rabbitmq

backends:
rabbitmq:
connection:
host: %rabbitmq_host%
user: %rabbitmq_user%
pass: %rabbitmq_pass%
port: %rabbitmq_port%
vhost: %rabbitmq_vhost%
exchange: main
default_queue: mailnotification
queues:
transcoding:
queue: transcoding
routing_key: transcoder
mailnotification:
queue: notification
routing_key: mail
facebooknotification:
queue: notification
routing_key: facebook
```

To start a consumerHandler for a specific queue, simply pass the `--queue` argument to the command:

```
php app/console sonata:notification:start --env=prod --iteration=250 --queue=transcoding
```

A specific queue backend can be retrieved with the service id `sonata.notification.backend.queue_`, e.g. `sonata.notification.backend.queue_transcoding`