Commit Graph

589 Commits

Author SHA1 Message Date
Zuul 63f95e92c3 Merge "kafka: Fix invalid hostaddr format for IPv6 address" 2024-03-27 12:02:40 +00:00
Takashi Kajinami b0e28a1603 kafka: Fix invalid hostaddr format for IPv6 address
When IPv6 address is used for host, the hostaddr should be formatted
in [<address>]:<port> format instead of <address>:<port> format. This
ensures the correct format is used.

Closes-Bug: 1907702
Change-Id: I6f4a453a69e942d5b2d66ffeca6960b85c8bc721
2024-02-20 19:09:56 +09:00
Hervé Beraud 97d457f0af
Display the reply queue's name in timeout logs
It would be helpful if "Timed out waiting for <service>" log messages at least
specified on which `reply_q` it was waited for.

Example without the reply_q:

```
12228 2020-09-14 14:56:37.187 7 WARNING nova.conductor.api
[req-1e081db6-808b-4af1-afc1-b87db7839394 - - - - -] Timed out waiting for
nova-conductor.  Is it running? Or did this service start before
nova-conductor?  Reattempting establishment of nova-conductor connection...:
oslo_messaging.exceptions.MessagingTimeout: Timed out waiting for a reply to
message ID 1640e7ef6f314451ba9a75d9ff6136ad
```

Example after adding the reply_q:

```
12228 2020-09-14 14:56:37.187 7 WARNING nova.conductor.api
[req-1e081db6-808b-4af1-afc1-b87db7839394 - - - - -] Timed out waiting for
nova-conductor.  Is it running? Or did this service start before
nova-conductor?  Reattempting establishment of nova-conductor connection...:
oslo_messaging.exceptions.MessagingTimeout: Timed out waiting for a reply
(reply_2882766a63b540dabaf7d019cf0c0cda)
to message ID 1640e7ef6f314451ba9a75d9ff6136ad
```

It could help us to more merely debug and observe if something went
wrong with a reply queue.

Change-Id: Ied2c881c71930dc631919113adc00112648f9d72
Closes-Bug: #1896925
2024-02-06 15:17:46 +01:00
Takashi Kajinami 4f4c2772da Bump hacking (again)
The previous attempt did not update the version in pre commit config
so the old version is still used by pep8 target.

Change-Id: Idf8c7d99f7c6aeb0244d58e85524ba1f039195d8
2024-01-26 01:10:57 +09:00
Jay Faulkner 800c58826e Utilize the new RequestContext redacted_copy method
We now expect context objects to support returning a redacted copy of
themselves.

As a related cleanup, removed the practice entirely of using
dictionaries to represent contexts in unit tests and the logging driver.

As part of developing this change, I discovered code in Glance (and
potentially other services) which explicitly pass {} in lieu of a
context when notifying; so we now properly handle dictionaries as
contexts.

To ensure we have the method required; require oslo.context 5.3.0 or
newer.

Change-Id: I894f38cc83c98d3e8d48b59864c0c7c2d27e7dcd
2024-01-16 12:08:20 -08:00
Zuul f455edd601 Merge "Bump bandit and make oslo.messaging compatible with latest rules" 2023-10-20 13:47:33 +00:00
Jay Faulkner 1b315615e7 Only allow safe context fields in notifications
Publishing a fully hydrated context object in a notification would give
someone with access to that notification the ability to impersonate the
original actor through inclusion of sensitive fields.

Now, instead, we pare down the context object to the bare minimum before
passing it for serialization in notification workflows.

Related-bug: 2030976
Change-Id: Ic94323658c89df1c1ff32f511ca23502317d0f00
2023-08-11 13:07:54 -07:00
Hervé Beraud ee13e53614 Bump bandit and make oslo.messaging compatible with latest rules
- Apply a timeout to requests calls to avoid uncontrolled
  resource consumption (CWE-400) [1].
- Ignore CWE 377

[1] https://cwe.mitre.org/data/definitions/400.html
[2] https://cwe.mitre.org/data/definitions/377.html

Change-Id: Ic558ad392424a25b5fd9a10749163d8427159eda
2023-05-17 11:06:34 +02:00
Andrew Bogott 0602d1a10a Increase ACK_REQUEUE_EVERY_SECONDS_MAX to exceed default kombu_reconnect_delay
Previously the two values were the same; this caused us
to always exceed the timeout limit ACK_REQUEUE_EVERY_SECONDS_MAX
which results in various code paths never being traversed
due to premature timeout exceptions.

Also apply min/max values to kombu_reconnect_delay so it doesn't
exceed ACK_REQUEUE_EVERY_SECONDS_MAX and break things again.

Closes-Bug: #1993149
Change-Id: I103d2aa79b4bd2c331810583aeca53e22ee27a49
2023-04-20 15:27:58 -05:00
Zuul 9f710ce6cd Merge "Remove logging from ProducerConnection._produce_message" 2022-12-21 07:46:22 +00:00
Tobias Urdin 4ead7cb2dc Implement get_rpc_client function
We already expose functions to handle the instantiation
of classes such as RPCServer and RPCTransport but the
same was never done for RPCClient so the API is
inconsistent in its enforcement.

This adds a get_rpc_client function that should be used
instead of instatiating the RPCClient class directly to
be more consistent.

This also allows to handle more logic inside the function
in the future such as if implementations for an async client
is implemented, as investigation in [1] has shown.

[1] https://review.opendev.org/c/openstack/oslo.messaging/+/858936

Change-Id: Ia4d1f0497b9e2728bde02f4ff05fdc175ddffe66
2022-10-25 11:42:40 +00:00
Guillaume Espanel 43f2224aac Remove logging from ProducerConnection._produce_message
In impl_kafka, _produce_message is run in a tpool.execute
context but it was also calling logging functions.
This could cause subsequent calls to logging functions to
deadlock.

This patch moves the logging calls out of the tpool.execute scope.

Change-Id: I81167eea0a6b1a43a88baa3bc383af684f4b1345
Closes-bug: #1981093
2022-08-03 17:35:16 +02:00
Sean Mooney cde68026eb update hacking pin to support flake8 3.8.3
this change updates the max version of hacking
to 4.1.0 to allow pre-commit to work with the
flake 3.8.3 release and correct one new error that was
raised as a result.

Change-Id: I3a0242208f411b430db0e7429e2c773f45b3d301
2022-05-23 14:39:56 +00:00
Zuul 64888bd05a Merge "Add a new option to enforce the OpenSSL FIPS mode" 2022-04-26 14:15:36 +00:00
Stephen Finucane 723513a9d9 tests: Fix test failures with kombu >= 5.2.4
kombu 5.2.4 fixed an off-by-one issue that meant we were attempting
retries more than once [1]. We need to handle this to unblock the gate.
This was discovered by examining the call stack and comparing this with
recent changes in openstack/requirements.

[1] 5bed2a8f98

Change-Id: I476e3c573523d5991c56b31ad4df1172196aa7f1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-04-05 17:19:13 +01:00
Balazs Gibizer 7b3968d9b0 [rabbit] use retry parameters during notification sending
The rabbit backend now applies the [oslo_messaging_notifications]retry,
[oslo_messaging_rabbit]rabbit_retry_interval, rabbit_retry_backoff and
rabbit_interval_max configuration parameters when tries to establish the
connection to the message bus during notification sending.

This patch also clarifies the differences between the behavior
of the kafka and the rabbit drivers in this regard.

Closes-Bug: #1917645
Change-Id: Id4ccafc95314c86ae918336e42cca64a6acd4d94
2022-01-12 12:22:55 +01:00
Balazs Gibizer 1db6de63a8 Reproduce bug 1917645
The [oslo_messaging_notification]retry parameter is not applied during
connecting to the message bus. But the documentation implies it should[1][2].
The two possible drivers, rabbit and kafka, behaves differently.

1) The rabbit driver will retry the connection forever, blocking the caller
   process.

2) The kafka driver also ignores the retry configuration but the
   notifier call returns immediately even if the notification is not
   (cannot) be delivered.

This patch adds test cases to show the wrong behavior.

[1] https://docs.openstack.org/oslo.messaging/latest/configuration/opts.html#oslo_messaging_notifications.retry
[2] feb72de7b8/oslo_messaging/notify/messaging.py (L31-L36)

Related-Bug: #1917645

Change-Id: Id8557050157aecd3abd75c9114d3fcaecdfc5dc9
2021-11-24 16:01:34 +01:00
Hervé Beraud 384738a92d Add a new option to enforce the OpenSSL FIPS mode
This option ``ssl_enforce_fips_mode`` allow us to enforce the FIPS mode
if supported by the version of python in use.

https://en.wikipedia.org/wiki/Federal_Information_Processing_Standards

Change-Id: I50c7de71bfd38137eb83d23e910298946507ce9f
2021-11-08 15:05:30 +01:00
Zuul d4f7ea21fc Merge "use message id cache for RPC listener" 2021-09-13 16:54:59 +00:00
Zuul ef0b31f112 Merge "limit maximum timeout in the poll loop" 2021-09-13 16:39:10 +00:00
Nikita Kalyanov 129c223307 use message id cache for RPC listener
Return back the message id cache feature to RPC listener, it was
removed while refactoring in I708c3d6676b974d8daac6817c15f596cdf35817b
See attached bug for more info.

We should not raise DuplicateMessageError to avoid rejecting the
previously ACK'ed message.

Closes-Bug: #1935883
Change-Id: Ie237e9e3fdc3fc27b3deb18b94751cdc3afd190e
2021-09-10 11:19:43 +03:00
John Eckersberg f9de265f39 amqp1: Do not reuse _socket_connection on reconnect
Each _SocketConnection object is unique per-peer.  For example, the
properties attribute may contain keys such as 'x-ssl-peer-name'.
Reusing the existing _socket_connection during failover will cause the
TLS handshake to fail since the peer name will not match.  There is
potential for other similar-yet-unexplored bad things to happen as
well.

Instead, reconnect by waking up the eventloop via the _do_reconnect
method, which reconstructs the connection properties to reflect the
new (failed-over-to) host and ultimately crates a new
_SocketConnection (or re-uses a *valid* old one) in
eventloop.Thread.connect().

Closes-Bug: #1938945
Change-Id: I0c8dc447f4dc8d0d08c312a1f3e6fa1745fb69fd
2021-08-10 17:01:04 -04:00
John Eckersberg 01f5b37874 amqp1: re-organize TestFailover to be reused by TestSSL
This breaks out the generation of brokers and transport_url into
separate methods.  These methods are used in the next patch in this
series, where TestSSL is updated to inherit from TestFailover, and
TestSSL overrides the _gen_brokers and _gen_transport_url methods to
supply the necessary SSL-aware options.

Change-Id: Ia2f977795abc2e81a996e299867e05d41057f33f
2021-08-10 16:55:44 -04:00
John Eckersberg fc49e04e6d Revert "Disable AMQP 1.0 SSL unit tests"
This reverts commit 8f5cfda664.

Reason for revert: This was supposed to be temporary to unblock the gate.  Whatever broke SSL cert generation in the first place appears to be fixed because I can run SSL tests now.

Change-Id: I4f286cf3af0d578f472b84fe355c812910c7a121
2021-08-10 16:55:36 -04:00
Nikita Kalyanov bdcf915e78 limit maximum timeout in the poll loop
We should properly limit the maximum timeout with a 'min' to avoid
long delays before message processing. Such delays may happen if
the connection to a RabbitMQ server is re-established at the same
time when the message arrives (see attached bug for more info).

Moreover, this change is in line with the original intent to
actually have an upper limit on maximum possible timeout (see
comments in code and in the original review).

Closes-Bug: #1935864
Change-Id: Iebc8a96e868d938a5d250bf9d66d20746c63d3d5
2021-07-13 00:15:38 +03:00
Ching Kuo bdbb6d62ee Add Support For oslo.metrics
This commit added support to send rpc metrics to oslo.metrics.

Changes includes:
- Adding client wrapper for oslo.metrics to process metrics information
  and send to oslo.metrics socket
- Modify rpc client to send metric when certain rpc events happens

For more information on oslo.metrics
https://opendev.org/openstack/oslo.metrics

Change-Id: Idf8cc0e52ced1f697ac4048655eff4c956fd5c79
2021-06-08 22:22:37 +08:00
xuanyandong 642367cdfd remove unicode from code
Change-Id: Ib2b816728307166450a4cea2ccdb3c4b550a0713
2021-01-03 16:11:46 +08:00
Thomas Goirand 0c4203bbdc Python 3.9: isAlive is removed
The Threading method isAlive was deprecated a long time ago, in the favor
of is_alive(). Though in Python 3.9, isAlive is removed. We must switch
to it. Note that is_alive() is available at least in Python 3.5 (I tried)
and probably even earlier, so switching to is_alive() is not a problem
for the Python interpreter versions currently supported by OpenStack.

Change-Id: I9d671abcd2cea9c0c726edaddcd65e1093d96731
2020-10-16 09:45:36 +02:00
Sean Mooney 00d15eaeab add min of 1 to rpc_conn_pool_size
This change add a min value of 1 to
[oslo_messaging_rabbit]/rpc_conn_pool_size
such that there is always at least 1 connection avaiable.

This change add a runtime check to ensure that
[oslo_messaging_rabbit]/rpc_conn_pool_size is greater than
or equal too [oslo_messaging_rabbit]/conn_pool_min_size

Change-Id: I2ad4b9f1d012c9f0586a932ac27d96da1bcc4e4c
Closes-Bug: #1899533
2020-10-13 12:44:30 +01:00
Hervé Beraud a997f09e5b Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: Ibd0c3d64fdc5c293d9d676d33eab828d9fde971f
Co-authored-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:35:37 +02:00
Zuul 32943fd5a5 Merge "Add a ping endpoint to RPC dispatcher" 2020-08-28 19:55:30 +00:00
Arnaud Morin 82492442f3 Add a ping endpoint to RPC dispatcher
The purpose of this patch is to add an endpoint directly in RPC
dispatcher, so this endpoint will always be available, in a cross
project manner, without the need for projects to manage it by themself.

This endpoint stay disabled by default, so this change is harmless
without a specific configuration option.

To enable this ping endpoint, an operator will just have to add a new
parameter in the [DEFAULT] section, alongside with rpc_response_timeout
[DEFAULT]
rpc_ping_enabled=true  # default is false

The purpose of this new endpoint is to help operators do a RPC call (a
ping) toward a specific RPC callback (e.g. a nova-compute, or a
neutron-agent).
This is helping a lot for monitoring agents (for example, if agents are
deployed in a kubernetes pod).

The endpoint is named oslo_rpc_server_ping.

Change-Id: I51cf67e060f240e6eb82260e70a057fe599f9063
Signed-off-by: Arnaud Morin <arnaud.morin@corp.ovh.com>
2020-08-18 15:09:29 +02:00
Zuul 8d78ab2339 Merge "Cancel consumer if queue down" 2020-08-01 01:21:42 +00:00
shenjiatong 196fa877a9 Cancel consumer if queue down
Previously, we have switched to use default exchanges
to avoid excessive amounts of exchange not found messages.
But it does not actually solve the problem because
reply_* queue is already gone and agent will not receive callbacks.

after some debugging, I found under some circumstances
seems rabbitmq consumer does not receive basic cancel
signal when queue is already gone. This might due to
rabbitmq try to restart consumer when queue is down
(for example when split brain). In such cases,
it might be better to fail early.

by reading the code, seems like x-cancel-on-ha-failover
is not dedicated to mirror queues only, https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_channel.erl#L1894,
https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_channel.erl#L1926.

By failing early, in my own test setup,
I could solve a certain case of exchange not found problem.

Change-Id: I2ae53340783e4044dab58035bc0992dc08145b53
Related-bug: #1789177
2020-07-31 06:05:16 +08:00
Stephen Finucane afb035d971 tests: Resolves issues with kombu > 4.6.8
The 'kombu.connection.Connection.ensure_connection' method has changed
from calling 'retry_over_time' on 'self.connect' to calling it on
'self._connection_factory' [1], meaning our mocks are outdated. Address
this change.

[1] https://github.com/celery/kombu/pull/1193/commits/398aa5b8cd1fe1fc

Change-Id: Ibbcf21a57ab1e3f90c21901296e5c088b645127c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1885923
2020-07-02 10:37:09 +01:00
Andreas Jaeger 7e406c312a Simplify tools/test-setup.sh
test-setup.sh is called after bindep is run in CI, and tox is not setup.

Simplify the script so that it only does what's needed - install
qdrouterd for Ubuntu from qpid/testing.

Install the other packages using bindep, add test to amqp1 profile.

Add amqp1 to bindep_profiles where needed for scenario tests, previously
test-setup.sh added it everywhere.

Some tests are skipped due to changes in recent versions of kombu. These
will be unskipped when we come up with a proper fix.

Change-Id: Ic3a9e2c873619670edfbf71022d593f3cb5f70f2
Related-Bug: #1885923
2020-07-01 14:40:24 +01:00
Andreas Jaeger e44c988306 Remove six usage
Remove six, the python 2/3 compatibility library. It's not needed
anymore since the repo is python3 only.

Remove a now unneeded hacking test.

Change-Id: I40522c4accb4aaf8115d11fee8b081e2d991cb4d
2020-05-11 10:21:58 +02:00
Andreas Jaeger 7f638bb493 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update local hacking check for new flake8 version.

Blacklist:
W504 line break after binary operator

Fix:
E741 ambiguous variable name
E117 over-indented
E305 expected 2 blank lines after class or function definition, found 1
F841 local variable 'e' is assigned to but never used
W605 invalid escape sequence '\.'

Change-Id: I99d574ca6569f1f177d2c5ce1011f269f4343619
2020-03-30 13:49:29 +00:00
Zuul d87618b24f Merge "Setup backend scenarios for functional tests" 2020-02-21 15:52:26 +00:00
Hervé Beraud fed48aea44 Remove the deprecated blocking executor
The blocking executor has been deprecated in Pike and marked for removal
in Rocky, but some user like Mistral asked us to wait before. We decided
to remove this executor for Train or next cycle, now we are in the
Ussuri and after some researchs on usage I think we can go ahead.

This patch drop the deprecation warnings, related unit tests and
set the server with the threading executor is the default executor.

Change-Id: If07bab61ee2b148658b88be98b12f8539f274efe
Closes-Bug: #1715141
2020-02-18 15:49:27 +01:00
Andy Smith ab78c8e3dd Setup backend scenarios for functional tests
This patchset introduces scenarios for the functional tests to unify the
setup and configuration of alternate messaging backends for RPC and
Notifications. The scenarios are defined to reduce redundancy in
the testing of backends and to demonstrate functional correctness
across driver combinations.

Current driver support:
rabbit - RPC, Notify
amqp   - RPC
kafka  - Notify

                  RPC       Notify
               ---------  ----------
scenario01       rabbit     rabbit
scenario02       rabbit     kafka
scenario03        amqp      rabbit
scenario04        amqp      kafka

It is anticipated that additional scenarios will be defined as new
drivers are introduced and/or new messaging intermediarites are supported.

Note: The removal of python2 jobs are also included patch

Change-Id: I0f86416623a0b718516147f0660b4df2b74cf867
2020-02-05 08:00:56 -05:00
Michal Arbet 5a43d4548a Add support for kafka SSL autentication
Change-Id: Idef066a2e3b4923789a6b081d5442e931aba4507
2020-01-16 23:26:53 +01:00
John Eckersberg d873c0d8f5 Do not use threading.Event
Waiting on a threading.Event with eventlet can cause busy looping via
epoll_wait, see related bug for more details.

Change-Id: I007613058a2d21d1712c02fa6d1602b63705c1ab
Related-bug: #1518430
2019-12-18 13:11:41 +00:00
Kenneth Giusti 859e0d4eaa Revert "Add RPC incoming and reply log"
This broke non-rabbitmq message bus drivers. See:

https://bugs.launchpad.net/oslo.messaging/+bug/1855775

This reverts commit b104f254ab.

Change-Id: I17a448a768b544482b375b0076889db989e03e8c
2019-12-09 16:22:06 -05:00
LIU Yulong b104f254ab Add RPC incoming and reply log
Typically a simple log will not narrow down the
performance, but give us more information about
the service status.

Change-Id: I51c8f2743dd39cccd3d1d021d3c50dc09f70cd97
Closes-Bug: #1847747
2019-10-21 22:32:07 +08:00
Zuul 1541b0c7f9 Merge "Allow users run the rabbitmq heartbeat inside a standard pthread." 2019-08-08 15:50:07 +00:00
Hervé Beraud 22f240b82f Allow users run the rabbitmq heartbeat inside a standard pthread.
This is an experimental feature.

The proposed changes will fix related issues when we run
heartbeat under apache/httpd enviornment with the apache MPM `prefork`
[1] engine and mod_wsgi or uwsgi in a monkey patched environment.

Propose changes to allow user to choose to run the rabbitmq health check
heartbeat in a standard python thread.

Issue
=====

We facing an issue with the rabbitmq driver heartbeat
under apache MPM `prefork` module and mod_wsgi when nova_api monkey
patched the stdlib by using eventlet.

nova_api calling eventlet.monkey_patch() [2] when it runs under mod_wsgi.

This impacts the AMQP heartbeat thread,
which is meant to be a native thread. Instead of checking AMQP sockets
every 15s, It is now suspended and resumed by eventlet. However,
resuming greenthreads can take a very long time if mod_wsgi isn't
processing traffic regularly, which can cause rabbitmq to close the AMQP
connection.

Root Cause
==========

The oslo.messaging RabbitMQ driver and especially the heartbeat
suffer to inherit the execution model of the service which consume him.

In this scenario nova_api need green threads to manage cells and edge
features so nova_api monkey patch the stdlib to obtain async features,
and the oslo.messaging rabbitmq driver endure these changes.

I think the main issue here is that nova_api want async and use eventlet green
threads to obtain it.

Solution
========

We want to allow user to isolate the heartbeat execution model
from the parent process inherited execution model by passing the
`heartbeat_in_pthread` option through the driver config.

While we use MPM `prefork` we want to avoid to use libevent and epoll.

If the `heartbeat_in_pthread` option is given we want to force to use the
python stdlib threading module to run the
rabbitmq heartbeat to avoid issue related to a non "standard"
environment. I mean "standard" because async features isn't the default
config in mostly case, starting by apache which define `prefork` is the
default engine.

This is an experimental feature, we can help us to ensure to run heartbeat
through a classical python thread

Specifications
==============

- https://review.opendev.org/661314

[1] https://httpd.apache.org/docs/2.4/fr/mod/prefork.html
[2] 3c5e2b0e9f

Change-Id: If8846599efc48fe18ecfb99c04e2c38f9a45b9ed
2019-08-07 17:17:02 +02:00
Zuul dfc8fe9a8f Merge "Support kafka message compression" 2019-08-05 15:53:35 +00:00
Gabriele c50076b4ef
Implement mandatory flag for RabbitMQ driver
With this feature it is possible to use the mandatory RabbitMQ
mandatory flag.

Implements: blueprint transport-options (point 3)

The blueprint link is [1]

Please follow the link [2] to use and test the feature.

1- https://blueprints.launchpad.net/oslo.messaging/+spec/transport-options
2- https://github.com/Gsantomaggio/rabbitmq-utils/
tree/master/openstack/mandatory_test

Change-Id: Ie269fc08ba80c4b94a24a8207c1e86c19c3b3fcb
2019-07-01 21:38:32 +02:00
Gabriele e804874c50
Implement the transport options
With this feature, it is possible to specialize the parameters to send.
`options = oslo_messaging.TransportOptions(at_least_once=True)`

TransportOptions is used in every single driver,
for example in RabbitMQ driver is used to handle the mandatory flag.

Notes:
  - The idea of creating a new  class TransportOptions is because I'd like
    to have an abstract class not related only to the RPCClient
  - at_least_once is the first parameter, when needed we can add the
    others.

Implements: blueprint transport-options (second point)

The blueprint link is [1]
To test it you can use [2]

1- https://blueprints.launchpad.net/oslo.messaging/+spec/transport-options
2- https://github.com/Gsantomaggio/rabbitmq-utils/
   tree/master/openstack/mandatory_test

Change-Id: I1858e4a990507d3c2bac2ef7fbef75d8c2dbfce2
2019-06-24 16:50:35 +02:00