diff options
| author | mo khan <mo@mokhan.ca> | 2015-02-02 22:19:05 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-02-02 22:19:05 -0700 |
| commit | a203ecad6c996665d503d11474ca5981b5621abd (patch) | |
| tree | 87bc4f144aff5db37e5a7ca771acf8fd7c4276e4 /lib | |
| parent | a71b8dc0743a769b861b91d693230b0b88961b79 (diff) | |
parse event as json.g
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/tasks/rabbitmq.rake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/tasks/rabbitmq.rake b/lib/tasks/rabbitmq.rake new file mode 100644 index 0000000..6c8e3d2 --- /dev/null +++ b/lib/tasks/rabbitmq.rake @@ -0,0 +1,18 @@ +namespace :rabbitmq do + desc "setup rabbitmq routing" + task setup: :environment do + require "bunny" + connection = Bunny.new + connection.start + channel = connection.create_channel + + # create exchange + exchange = channel.fanout("malwer.events") + + # get or create queue (note the durable setting) + queue = channel.queue("dashboard.events", durable: true) + # bind queue to exchange + queue.bind("malwer.events") + connection.close + end +end |
