support setting write timeout for RabbitMQ API requests
MODIFY
lib/beetle/configuration.rb
lib/beetle/configuration.rb
@@ -107,8 +107,10 @@ module Beetle
# Whether to update quueue policies synchronously or asynchronously.
attr_accessor :update_queue_properties_synchronously
- # Read timeout for http requests to create dead letter bindings
+ # Read timeout for http requests to RabbitMQ HTTP API
attr_accessor :rabbitmq_api_read_timeout
+ # Write timeout for http requests to RabbitMQ HTTP API
+ attr_accessor :rabbitmq_api_write_timeout
# Returns the port on which the Rabbit API is hosted
attr_accessor :api_port
@@ -178,6 +180,7 @@ module Beetle
self.dead_lettering_enabled = false
self.dead_lettering_msg_ttl = 1000 # 1 second
self.rabbitmq_api_read_timeout = 60 # 60 seconds
+ self.rabbitmq_api_write_timeout = 60 # 60 seconds
self.lazy_queues_enabled = false
self.throttling_refresh_interval = 60 # seconds

MODIFY
lib/beetle/queue_properties.rb
lib/beetle/queue_properties.rb
@@ -164,6 +164,7 @@ module Beetle
end
http = Net::HTTP.new(uri.hostname, config.api_port)
http.read_timeout = config.rabbitmq_api_read_timeout
+ http.write_timeout = config.rabbitmq_api_write_timeout
# don't do this in production:
# http.set_debug_output(logger.instance_eval{ @logdev.dev })
http.start do |instance|

support setting write timeout for RabbitMQ API requests