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: I05586dbb4b1599007eda2de546da135b9215cd19
This commit is contained in:
ZhongShengping 2017-01-21 20:03:39 +08:00
parent ae3f75130a
commit f371c9f2cf
3 changed files with 28 additions and 1 deletions

View File

@ -46,6 +46,16 @@
# would be, rabbit://user:pass@host:port/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 notifications backend. An
# example rabbit url would be, rabbit://user:pass@host:port/virtual_host
@ -249,6 +259,8 @@ class barbican::api (
$max_allowed_request_size_in_bytes = $::os_service_default,
$rpc_backend = $::os_service_default,
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$notification_transport_url = $::os_service_default,
$notification_driver = $::os_service_default,
$notification_topics = $::os_service_default,
@ -368,7 +380,9 @@ deprecated. Please use barbican::default_transport_url instead.")
}
oslo::messaging::default { 'barbican_config':
transport_url => $default_transport_url,
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
oslo::messaging::notifications { 'barbican_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

@ -29,6 +29,8 @@ describe 'barbican::api' do
:bind_port => '9311',
:rpc_backend => 'rabbit',
:default_transport_url => '<SERVICE DEFAULT>',
:rpc_response_timeout => '<SERVICE DEFAULT>',
:control_exchange => '<SERVICE DEFAULT>',
:notification_transport_url => '<SERVICE DEFAULT>',
:notification_driver => '<SERVICE DEFAULT>',
:notification_topics => '<SERVICE DEFAULT>',
@ -74,6 +76,8 @@ describe 'barbican::api' do
:bind_port => '9312',
:rpc_backend => 'rabbit',
:default_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost',
:rpc_response_timeout => '120',
:control_exchange => 'barbican',
:notification_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost',
:notification_driver => 'kombu',
:notification_topics => 'notifications',
@ -159,6 +163,8 @@ describe 'barbican::api' do
it 'configures rabbit' do
is_expected.to contain_barbican_config('DEFAULT/rpc_backend').with_value(param_hash[:rpc_backend])
is_expected.to contain_barbican_config('DEFAULT/transport_url').with_value(param_hash[:default_transport_url])
is_expected.to contain_barbican_config('DEFAULT/rpc_response_timeout').with_value(param_hash[:rpc_response_timeout])
is_expected.to contain_barbican_config('DEFAULT/control_exchange').with_value(param_hash[:control_exchange])
is_expected.to contain_barbican_config('oslo_messaging_notifications/transport_url').with_value(param_hash[:notification_transport_url])
is_expected.to contain_barbican_config('oslo_messaging_notifications/driver').with_value(param_hash[:notification_driver])
is_expected.to contain_barbican_config('oslo_messaging_notifications/topics').with_value(param_hash[:notification_topics])