0
我通过JMeter向我的应用发送大量数据。兔子MQ(兔子)中的消费者太多
我的订阅块和出版商是这样的:
BunnyStarter.start_bunny_components
cons = BunnyStarter.queue.subscribe do |delivery_info, metadata, payload|
method_calling (payload)
cons.cancel
end
BunnyStarter.exchange.publish(body.to_json, routing_key: BunnyStarter.queue.name)
而且我BunnyStarter类:
def self.start_bunny_components
if @@conn.nil?
@@conn = Bunny.new
@@conn.start
@@ch = @@conn.create_channel
@@queue = @@ch.queue("dump_probe_queue")
@@exchange = @@ch.default_exchange
end
end
的问题是,虽然我叫consumer.cancel
method_calling
后,在我的兔子MQ管理我仍然看到我在大约6分钟内创建了1000个消费者。
这是因为我发送的数据的速率和数量?
我该如何改进?