zmq: switch back to not using message envelopes

In oslo-incubator, we default to not serializing messages using a
message envelope:

  def _cast(.., envelope=False, ...)

except using the v2 notifyer which explicitly passes envelope=True.

However, in oslo.messaging, we accidentally switched to using a
message envelope:

     def _send(self, ..., envelope=True):

This was not intentional and may be disruptive to users.

This issue was identified because the envelope=True path just doesn't
work! We don't have any zmq tests in oslo.messaging, but even in
oslo-incubator the code path isn't tested and has been broken since
I73aad7697cf83ad4aabb3c2058b7cc4f53f783c2

Partial-Bug: #1301132
Change-Id: I6aa2e2ac3cebf443719d64ebcd9eaadc0a9328b8
Explicitly name subscription queue for responses

This prevents response queues being abandoned but still bound to
the exchange with the same key as the newer queue.

Change-Id: Iee0465010a1c6d00e96fb672505688a0f763f86c
Closes-Bug: 1318742
Cleaned up references to executor specific RPCServer types

In oslo.messaging design phase, it was planned to introduce executor
specific RPCServer types though they were never implemented. References
to those types sneaked into docstrings from the original design
document. Since we're not going to implement those types now, docstrings
should be updated accordingly.

Change-Id: Ic4017bb8f89d47115bb7dc59483e81d26c76212b
Remove amqp default exchange hack

This change remove the hack to set the default exchange of a transport in the
amqp driver, by removing the usage of the configuration object to get the
default exchange in rabbit and qpid driver, and instead use the value
passed to the driver constructor into all amqp publishers and consumers
class/method that needs it.

Closes-bug: #1256345
Change-Id: Iba54ca79a49f8545854205c1451b2403735c1006
Setup for translation

To start translation, we need to initially import the
translation file - and place it at the proper place so that
the usual CI scripts can handle it.

The proper place is for all python projects
$PROJECT/locale/$PROJECT.pot - see setup.cfg.

Further imports will be done by the OpenStack Proposal bot.

Setup also setup.cfg with the usual babel commands and add the default
babel.cfg file.

Change-Id: I583e98fac2f9b84cd1115640b936057ad95957e8
fixed pep8 issue E265

  * E265 block comment should start with '# '

E265 was introduced in pep8 1.5 (2014-03-26).

Change-Id: I076addadd2e67a8ac4162c706a36239f4af37a8c
Merge "Remove amqp default exchange hack"
Removes unused config option

This change removes the unused 'allowed_rpc_exception_modules' options

Change-Id: Ibb30709e5a3a08573fc1975fab80498a27b5ef0f
Merge "Setup for translation"
Bump hacking to 0.9.x series

In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.

Change-Id: I5711e066da1076486d291bc4f45359ecb26e1b1a
Merge "Removes unused config option"
Add an optional timeout parameter to Listener.poll

For asynchronous programming, a timeout parameter is required on the listener
to allow to stop it at exit. poll() returns None on timeout.

It plan to use it in my new asyncio (Trollius) executor:
https://review.openstack.org/#/c/70983/

See also the related blueprint for the rationale:
https://wiki.openstack.org/wiki/Oslo/blueprints/asyncio

Change-Id: I918ae3c267743a0eaed1d6a210c79fb4a0eb8733
Add transport reconnection retries

When a rpc client try to make a RPC call and the server is unreachable
The rpc call hang until the server come back.

In most case this is the desired behavior.

But sometimes, we can prefer that the library raise an exception after a
certain number of retries.

For example in ceilometer, when publishing a
storage.objects.incoming.bytes sample from the Swift middleware to an
AMQP topic, you might not want to block the Swift client if the AMQP broker
is unavailable - instead, you might have a queueing policy whereby
if a single reconection attempt fails we queue the sample in memory and
try again when another sample is to be published.

This patch is the oslo.messaging part that allow this.

Closes bug #1282639
Co-Authored-By: Ala Rezmerita <ala.rezmerita@cloudwatt.com>

Change-Id: I32086d0abf141c368343bf225d4b021da496c020
Add an example usage of RPCClient retry parameter

Change-Id: Ib88870b312721deff0d9b6db2ba2e3cb99da6038
rabbit/qpid: remove the args/kwargs from ensure()

Having an *args list following the retry kwargs just screams:

  SyntaxError: non-keyword arg after keyword arg

but we don't actually pass any args to methods invoked via ensure() so
these are just unused and can be removed. If we did want them in future
we could just use functools.partial().

Change-Id: Idef12bbc94d39c84ee06ddd6d743f3d2f705a8d1
Merge "Bump hacking to 0.9.x series"
Merge "Add transport reconnection retries"
Merge "rabbit/qpid: remove the args/kwargs from ensure()"
Handle unused allowed_remote_exmods in _multi_send

allowed_remote_exmods which is passed to _multi_send method in
impl_zmq.py is not passed further to _call, _cast, etc.

Due to that, all remote exceptions, that are supposed to be
expected, are wrapped into messaging.RemoteError exception with
all details of the remote exception.

To fix this allowed_remote_exmods needs to be passed as a
parameter in a called method().

Change-Id: If1dc2f85eab6f542bc21961b9d5c0bd0ab64add2
Closes-Bug: 1330460
Fix the notify method of the routing notifier

The notify method of the routing notifier don't have the correct
signature and change the case of the priority.

This change fixes it.

Change-Id: I833b19d0c054c94b861a4f6cc263c3487fa0e544
Closes-bug: #1316681