mirror of
https://github.com/ditkrg/rabbit_carrots.git
synced 2026-01-22 22:06:40 +00:00
Updates docs
This commit is contained in:
parent
b9528c66bf
commit
0a4e8b052f
@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
rabbit_carrots (0.1.13)
|
rabbit_carrots (0.1.14)
|
||||||
bunny (>= 2.19.0)
|
bunny (>= 2.19.0)
|
||||||
connection_pool (~> 2.3.0)
|
connection_pool (~> 2.3.0)
|
||||||
|
|
||||||
|
|||||||
22
README.md
22
README.md
@ -43,6 +43,28 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Note that handler is a class that must implement a method named ```handle!``` that takes 4 parameters as follow:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
class DummyEventHandler
|
||||||
|
def self.handle!(channel, delivery_info, properties, payload)
|
||||||
|
# Handle the received message from the queue
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Inside the handle message, you can NACK the message without re-queuing by raising ```RabbitCarrots::EventHandlers::Errors::NackMessage``` exception.
|
||||||
|
|
||||||
|
To NACK and re-queue, raise ```RabbitCarrots::EventHandlers::Errors::NackAndRequeueMessage``` exception.
|
||||||
|
|
||||||
|
If no errors are thrown, the message will be acknowledged soon after the ```handle!``` method returns.
|
||||||
|
|
||||||
|
Note: Any other unrescued exception raised inside ```handle!``` the that is a subclass of ```StandardError``` will trigger a NACK and re-queue.
|
||||||
|
|
||||||
|
### Running
|
||||||
|
|
||||||
Then run ```bundle exec rake rabbit_carrots:eat```.
|
Then run ```bundle exec rake rabbit_carrots:eat```.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user