mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
- Add durability setting for queue, too. (LOGSTASH-148)
This commit is contained in:
parent
06b8788f58
commit
9bccb4bada
1 changed files with 9 additions and 1 deletions
|
@ -41,6 +41,10 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
||||||
# Is this exchange durable? (aka; Should it survive a broker restart?)
|
# Is this exchange durable? (aka; Should it survive a broker restart?)
|
||||||
config :durable, :validate => :boolean, :default => true
|
config :durable, :validate => :boolean, :default => true
|
||||||
|
|
||||||
|
# Is this queue durable? (aka; Should it survive a broker restart?).
|
||||||
|
# If you omit this setting, the 'durable' property will be used as default.
|
||||||
|
config :queue_durable, :validate => :boolean
|
||||||
|
|
||||||
# Enable or disable debugging
|
# Enable or disable debugging
|
||||||
config :debug, :validate => :boolean, :default => false
|
config :debug, :validate => :boolean, :default => false
|
||||||
|
|
||||||
|
@ -86,6 +90,10 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
||||||
if @queue_name.nil?
|
if @queue_name.nil?
|
||||||
@queue_name = @name
|
@queue_name = @name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @queue_durable.nil?
|
||||||
|
@queue_durable = @durable
|
||||||
|
end
|
||||||
end # def register
|
end # def register
|
||||||
|
|
||||||
def run(queue)
|
def run(queue)
|
||||||
|
@ -95,7 +103,7 @@ class LogStash::Inputs::Amqp < LogStash::Inputs::Base
|
||||||
return if terminating?
|
return if terminating?
|
||||||
@bunny.start
|
@bunny.start
|
||||||
|
|
||||||
@queue = @bunny.queue(@queue_name, :durable => @durable)
|
@queue = @bunny.queue(@queue_name, :durable => @queue_durable)
|
||||||
exchange = @bunny.exchange(@name, :type => @exchange_type.to_sym, :durable => @durable)
|
exchange = @bunny.exchange(@name, :type => @exchange_type.to_sym, :durable => @durable)
|
||||||
@queue.bind(exchange, :key => @key)
|
@queue.bind(exchange, :key => @key)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue