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: Ida071f7862f16cb7c5679d23860f99db9fab6f57
This commit is contained in:
ZhongShengping 2017-02-07 09:42:31 +08:00
parent ad861e4da6
commit 778cbed9b3
3 changed files with 28 additions and 1 deletions

View File

@ -14,6 +14,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
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# amqp (for AMQP 1.0 protocol)
@ -168,6 +178,8 @@
class octavia (
$ensure_package = 'present',
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$rpc_backend = 'rabbit',
$rabbit_use_ssl = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
@ -254,6 +266,8 @@ class octavia (
oslo::messaging::default { 'octavia_config':
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
oslo::messaging::notifications { 'octavia_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

@ -34,6 +34,8 @@ describe 'octavia' do
it 'configures rabbit' do
is_expected.to contain_octavia_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_octavia_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_compression').with_value('<SERVICE DEFAULT>')
@ -50,6 +52,8 @@ describe 'octavia' do
let :params do
{
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '120',
:control_exchange => 'octavia',
:rabbit_ha_queues => 'undef',
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
@ -65,6 +69,8 @@ describe 'octavia' do
it 'configures rabbit' do
is_expected.to contain_octavia_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_octavia_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_octavia_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_octavia_config('DEFAULT/control_exchange').with_value('octavia')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
is_expected.to contain_octavia_config('oslo_messaging_rabbit/kombu_compression').with_value('gzip')