You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-17Lines changed: 16 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
11
11
## About ##
12
12
13
-
The RabbitMqBundle incorporates messaging in your application via [RabbitMQ](http://www.rabbitmq.com/) using the [php-amqplib](http://github.com/php-amqplib/php-amqplib) library.
13
+
The `RabbitMqBundle` incorporates messaging in your application via [RabbitMQ](http://www.rabbitmq.com/) using the [php-amqplib](http://github.com/php-amqplib/php-amqplib) library.
14
14
15
15
The bundle implements several messaging patterns as seen on the [Thumper](https://github.com/php-amqplib/Thumper) library. Therefore publishing messages to RabbitMQ from a Symfony controller is as easy as:
16
16
@@ -386,7 +386,7 @@ class OnConsumeEvent extends AMQPEvent
386
386
```
387
387
388
388
Let`s say you need to sleep / stop consumer/s on a new application deploy.
389
-
You can listen for OnConsumeEvent (\OldSound\RabbitMqBundle\Event\OnConsumeEvent) and check for new application deploy.
389
+
You can listen for `OldSound\RabbitMqBundle\Event\OnConsumeEvent` and check for new application deploy.
390
390
391
391
##### BEFORE PROCESSING MESSAGE #####
392
392
@@ -407,7 +407,7 @@ class BeforeProcessingMessageEvent extends AMQPEvent
407
407
}
408
408
}
409
409
```
410
-
Event raised before processing a AMQPMessage.
410
+
Event raised before processing a `AMQPMessage`.
411
411
412
412
##### AFTER PROCESSING MESSAGE #####
413
413
@@ -428,7 +428,7 @@ class AfterProcessingMessageEvent extends AMQPEvent
428
428
}
429
429
}
430
430
```
431
-
Event raised after processing a AMQPMessage.
431
+
Event raised after processing a `AMQPMessage`.
432
432
If the process message will throw an Exception the event will not raise.
433
433
434
434
##### IDLE MESSAGE #####
@@ -460,7 +460,7 @@ By default process exit on idle timeout, you can prevent it by setting `$event->
460
460
#### Idle timeout ####
461
461
462
462
If you need to set a timeout when there are no messages from your queue during a period of time, you can set the `idle_timeout` in seconds.
463
-
The `idle_timeout_exit_code` specifies what exit code should be returned by the consumer when the idle timeout occurs. Without specifying it, the consumer will throw an **PhpAmqpLib\Exception\AMQPTimeoutException** exception.
463
+
The `idle_timeout_exit_code` specifies what exit code should be returned by the consumer when the idle timeout occurs. Without specifying it, the consumer will throw an `PhpAmqpLib\Exception\AMQPTimeoutException` exception.
464
464
465
465
```yaml
466
466
consumers:
@@ -543,7 +543,7 @@ used for arguments autowiring based on declared type and argument name. This all
543
543
example to:
544
544
545
545
```php
546
-
public function indexAction($name, ProducerInteface $uploadPictureProducer)
546
+
public function indexAction($name, ProducerInterface $uploadPictureProducer)
@@ -557,12 +557,12 @@ argument name. `upload_picture_producer` producer key would also be aliased to `
557
557
It is best to avoid names similar in such manner.
558
558
559
559
All producers are aliased to `OldSound\RabbitMqBundle\RabbitMq\ProducerInterface` and producer class option from
560
-
configuration. In sandbox mode only ProducerInterface aliases are made. It is highly recommended to use ProducerInterface
560
+
configuration. In sandbox mode only `ProducerInterface` aliases are made. It is highly recommended to use `ProducerInterface`
561
561
class when type hinting arguments for producer injection.
562
562
563
-
All consumers are aliased to 'OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface' and '%old_sound_rabbit_mq.consumer.class%'
563
+
All consumers are aliased to `OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface` and `%old_sound_rabbit_mq.consumer.class%`
564
564
configuration option value. There is no difference between regular and sandbox mode. It is highly recommended to use
565
-
ConsumerInterface when type hinting arguments for client injection.
565
+
`ConsumerInterface`when type hinting arguments for client injection.
566
566
567
567
568
568
### Callbacks ###
@@ -621,7 +621,7 @@ And that's it!
621
621
### Audit / Logging ###
622
622
623
623
This was a requirement to have a traceability of messages received/published.
624
-
In order to enable this you'll need to add "enable_logger" config to consumers or publishers.
624
+
In order to enable this you'll need to add `enable_logger` config to consumers or publishers.
625
625
626
626
```yaml
627
627
consumers:
@@ -633,7 +633,7 @@ consumers:
633
633
enable_logger: true
634
634
```
635
635
636
-
If you would like you can also treat logging from queues with different handlers in monolog, by referencing channel "phpamqplib"
636
+
If you would like you can also treat logging from queues with different handlers in monolog, by referencing channel `phpamqplib`.
637
637
638
638
### RPC or Reply/Response ###
639
639
@@ -689,7 +689,7 @@ The arguments we are sending are the __min__ and __max__ values for the `rand()`
689
689
690
690
The final piece is to get the reply. Our PHP script will block till the server returns a value. The __$replies__ variable will be an associative array where each reply from the server will contained in the respective __request\_id__ key.
691
691
692
-
By default the RPC Client expects the response to be serialized. If the server you are working with returns a non-serialized result then set the RPC client expect_serialized_response option to false. For example, if the integer_store server didn't serialize the result the client would be set as below:
692
+
By default the RPC Client expects the response to be serialized. If the server you are working with returns a non-serialized result then set the RPC client `expect_serialized_response` option to false. For example, if the **integer_store** server didn't serialize the result the client would be set as below:
693
693
694
694
```yaml
695
695
rpc_clients:
@@ -719,7 +719,7 @@ As you can guess, we can also make __parallel RPC calls__.
719
719
720
720
### Parallel RPC ###
721
721
722
-
Let's say that for rendering some webpage, you need to perform two database queries, one taking 5 seconds to complete and the other one taking 2 seconds –very expensive queries–. If you execute them sequentially, then your page will be ready to deliver in about 7 seconds. If you run them in parallel then you will have your page served in about 5 seconds. With RabbitMqBundle we can do such parallel calls with ease. Let's define a parallel client in the config and another RPC server:
722
+
Let's say that for rendering some webpage, you need to perform two database queries, one taking 5 seconds to complete and the other one taking 2 seconds –very expensive queries–. If you execute them sequentially, then your page will be ready to deliver in about 7 seconds. If you run them in parallel then you will have your page served in about 5 seconds. With `RabbitMqBundle` we can do such parallel calls with ease. Let's define a parallel client in the config and another RPC server:
723
723
724
724
```yaml
725
725
rpc_clients:
@@ -941,7 +941,7 @@ batch_consumers:
941
941
942
942
*Note*: If the `keep_alive` option is set to `true`, `idle_timeout_exit_code` will be ignored and the consumer process continues.
943
943
944
-
You can implement a batch consumer that will acknowledge all messages in one return or you can have control on what message to acknoledge.
944
+
You can implement a batch consumer that will acknowledge all messages in one return or you can have control on what message to acknowledge.
945
945
946
946
```php
947
947
namespace AppBundle\Service;
@@ -1013,9 +1013,8 @@ How to run the following batch consumer:
Important: BatchConsumers will not have the -m|messages option available
1017
-
Important: BatchConsumers can also have the -b|batches option available if you want to only consume a specific number of batches and then stop the consumer.
1018
-
! Give the number of the batches only if you want the consumer to stop after those batch messages were consumed.!
1016
+
Important: BatchConsumers will not have the `-m|messages` option available
1017
+
Important: BatchConsumers can also have the `-b|batches` option available if you want to only consume a specific number of batches and then stop the consumer. Give the number of the batches only if you want the consumer to stop after those batch messages were consumed!
0 commit comments