Add control_exchange and rpc_response_timeout options

Add control_exchange to configure an exchange name for message.
Add rpc_response_timeout to configure seconds time for waiting
for a response from a call.

Change-Id: I255c4ceda252f0f39eecc823cef2820c9e7b1e48
This commit is contained in:
ZhongShengping 2017-01-28 13:52:04 +08:00
parent 31ca15b037
commit 4570df5d79
3 changed files with 32 additions and 1 deletions

View File

@ -7,6 +7,16 @@
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*rpc_response_timeout*]
# (Optional) Seconds to wait for a response from a call.
# Defaults to $::os_service_default
#
# [*control_exchange*]
# (Optional) The default exchange under which topics are scoped. May be
# overridden by an exchange name specified in the transport_url
# option.
# Defaults to $::os_service_default
#
# [*notification_transport_url*]
# (optional) Connection url for oslo messaging notification backend. An
# example rabbit url would be, rabbit://user:pass@host:port/virtual_host
@ -111,6 +121,8 @@
#
class glance::notify::rabbitmq(
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$notification_transport_url = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
@ -171,7 +183,9 @@ deprecated. Please use glance::notify::rabbitmq::default_transport_url instead."
}
oslo::messaging::default { ['glance_api_config', 'glance_registry_config']:
transport_url => $default_transport_url,
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
oslo::messaging::notifications { ['glance_api_config', 'glance_registry_config']:

View File

@ -0,0 +1,7 @@
---
features:
- Add new parameter "control_exchange", the default exchange under
which topics are scoped. May be overridden by an exchange name
specified in the transport_url option.
- Add new parameter "rpc_response_timeout", seconds to wait for a
response from a call

View File

@ -4,6 +4,8 @@ describe 'glance::notify::rabbitmq' do
shared_examples_for 'glance::notify::rabbitmq' do
describe 'when defaults with rabbit pass specified' do
it { is_expected.to contain_glance_api_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>') }
@ -22,6 +24,8 @@ describe 'glance::notify::rabbitmq' do
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glance_registry_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>') }
@ -199,10 +203,16 @@ describe 'glance::notify::rabbitmq' do
let :params do
{
:default_transport_url => 'rabbit://user:pass@host:1234/virt',
:rpc_response_timeout => '120',
:control_exchange => 'glance',
}
end
it { is_expected.to contain_glance_api_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') }
it { is_expected.to contain_glance_api_config('DEFAULT/rpc_response_timeout').with_value('120') }
it { is_expected.to contain_glance_api_config('DEFAULT/control_exchange').with_value('glance') }
it { is_expected.to contain_glance_registry_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') }
it { is_expected.to contain_glance_registry_config('DEFAULT/rpc_response_timeout').with_value('120') }
it { is_expected.to contain_glance_registry_config('DEFAULT/control_exchange').with_value('glance') }
end
end