Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrikjohansson/2651990 to your computer and use it in GitHub Desktop.
Save patrikjohansson/2651990 to your computer and use it in GitHub Desktop.
bunny = Bunny.new(:host => "localhost" )
bunny.start
APP_CONFIG[:asset_sync_bindings].each do |e|
queue = bunny.queue e[:queue], :durable => true
exchange = bunny.exchange e[:exchange] , :durable => true , :type => :fanout
queue.bind exchange
end
bindings = [
{ :queue => APP_CONFIG[:mq_queue_sbab] , :exchange => APP_CONFIG[:mq_queue_sbab] },
{ :queue => APP_CONFIG[:mq_queue] ,:exchange => APP_CONFIG[:mq_queue] },
{ :queue => "eniro_transaction_queue" ,:exchange => "eniro_transaction_exchange" },
{ :queue => APP_CONFIG[:duplicate_items_queue] , :exchange => APP_CONFIG[:duplicate_items_exchange] },
{ :queue => APP_CONFIG[:inspiration_queue] , :exchange => APP_CONFIG[:inspiration_exchange] } ,
{ :queue => "nimg01-asset_sync" , :exchange => APP_CONFIG[:asset_sync_exchange] } ,
{ :queue => "nimg02-asset_sync" ,:exchange => APP_CONFIG[:asset_sync_exchange] }
]
bindings.each do |b|
queue = bunny.queue b[:queue] , :durable => true
exchange = bunny.exchange b[:exchange] , :durable => true , :type => :fanout
queue.bind exchange
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment