I'm publishing RabbitMQ messages using Bunny (Ruby) like this:
x.publish("Message !"+n.to_s, :routing_key => 'mychannel')
and subscribing like this:
ch = conn.create_channel
x = ch.topic('fling',durable: true)
q = ch.queue("")
q.bind(x, :routing_key => 'mychannel')
puts "Waiting for messages."
q.subscribe( :block => true) do |delivery_info, properties, body|
puts " [x] Received #{body}, message properties are #{properties.inspect}"
Once I start the subscriber, it immediately receives any messages which are sent. However, if I send messages without starting the subscriber, they aren't received when I start the subscriber (whether the sender is still pushing messages, or not).
Is it possible to go back through the queue and receive messages that were sent in the past, when no subscribers were listening?