Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
31vi5 committed Jul 31, 2018
1 parent 20f6f49 commit a2036fb
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Expand Up @@ -40,7 +40,8 @@ rabbitmq:
queues:
testQueue:
connection: default
autoCreate: true
# force queue declare on first queue operation during request
# autoCreate: true
exchanges:
testExchange:
Expand All @@ -49,7 +50,8 @@ rabbitmq:
queueBindings:
testQueue:
routingKey: testRoutingKey
autoCreate: true
# force exchange declare on first exchange operation during request
# autoCreate: true
producers:
testProducer:
Expand All @@ -67,9 +69,24 @@ rabbitmq:
prefetchCount: 5
```

### Publishing messages
### Declaring Queues and Exchanges

Since v3.0, all queues and exchanges are by default declared on demand using the console command:

```
php index.php rabbitmq:declareQueuesAndExchanges
```

Note: Queue will be created automatically after publishing first message.
It's intended to be a part of the deploy process to make sure all the queues and exchanges are prepared for use.

If you need to override this behavior (for example only declare queues that are used during a request and nothing else),
just add the `autoCreate: true` parameter to queue or exchange of your choice.

You may also want to declare the queues and exchanges via rabbitmq management interface or a script but if you fail to
do so, don't run the declare console command and don't specify `autoCreate: true`, exceptions will be thrown
when accessing undeclared queues/exchanges.

### Publishing messages

services.neon:

Expand Down

0 comments on commit a2036fb

Please sign in to comment.