|
|
@ -8,7 +8,7 @@ module Sylvilagus::Ch02::HelloWorld
|
|
|
|
module ClassMethods
|
|
|
|
module ClassMethods
|
|
|
|
def with_hello_world_conn(&block)
|
|
|
|
def with_hello_world_conn(&block)
|
|
|
|
factory = ConnectionFactory.new
|
|
|
|
factory = ConnectionFactory.new
|
|
|
|
factory.uri = 'amqp://guest:guest@localhost:5672'
|
|
|
|
factory.uri = ENV.fetch('SYLVILAGUS_AMQP_URI')
|
|
|
|
conn = factory.new_connection
|
|
|
|
conn = factory.new_connection
|
|
|
|
channel = conn.create_channel
|
|
|
|
channel = conn.create_channel
|
|
|
|
channel.exchange_declare('hello-exchange', 'direct', true)
|
|
|
|
channel.exchange_declare('hello-exchange', 'direct', true)
|
|
|
|