This project demonstrates how to use the rabbitmq_delayed_message_exchange
's plugin.
- An exchange is created with the
x-delayed-message
type. - Then we declare a queue
user-published-queue
that we bind to the routing keyuser.event.publish
. - Then we send an event with into
user.event.publish
with a 'delay' of 10 sec. - Finally, we consume the queue
user-published-queue
and we can see that the event sent is only received after the delay of 10 sec.
We also handle a disconnection and reconnection of rabbitmq trying every 5 sec if a new connection is available.
Uses dep
tool for dependency management:
$ go get -u github.com/golang/dep/cmd/dep
$ dep ensure