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: Ic26aefb3f39f6e7c031fefaa7e32defac1738943
This commit is contained in:
ZhongShengping 2017-02-07 16:58:02 +08:00
parent 3ad9b2c214
commit 300851b246
3 changed files with 28 additions and 1 deletions

View File

@ -15,6 +15,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
#
# [*rabbit_heartbeat_timeout_threshold*]
# (optional) Number of seconds after which the RabbitMQ broker is considered
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
@ -150,6 +160,8 @@
class tacker(
$rpc_backend = 'rabbit',
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
$rabbit_heartbeat_rate = $::os_service_default,
$rabbit_use_ssl = $::os_service_default,
@ -225,6 +237,8 @@ class tacker(
}
oslo::messaging::default { 'tacker_config':
transport_url => $default_transport_url,
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
}

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

@ -21,6 +21,8 @@ describe 'tacker' do
it 'configures rabbit' do
is_expected.to contain_tacker_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_tacker_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/kombu_compression').with_value('<SERVICE DEFAULT>')
@ -32,6 +34,8 @@ describe 'tacker' do
let :params do
{
:default_transport_url => 'rabbit://user:pass@host:1234/virt',
:rpc_response_timeout => '120',
:control_exchange => 'tacker',
:rabbit_ha_queues => 'undef',
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
@ -42,6 +46,8 @@ describe 'tacker' do
it 'configures rabbit' do
is_expected.to contain_tacker_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_tacker_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt')
is_expected.to contain_tacker_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_tacker_config('DEFAULT/control_exchange').with_value('tacker')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
is_expected.to contain_tacker_config('oslo_messaging_rabbit/kombu_compression').with_value('gzip')