The eventlet executor need additional code to make the RPC server sample
work. Using the blocking executor makes things easier to setup for a
newcomer.
Change-Id: I56dfa54a178962d4ced34e2f15eaf9312b7087cc
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
The notification listener doesn't have anything to send to the notifier
and the notifier doesn't attend to receive something.
So this patch remove the message reply when the listener is a
notification
listener.
Partial implements blueprint notification-subscriber-server
Change-Id: Ic989947ba3b6894cde788422842fca19159ea261
Catch expected exceptions in a way that supports subclasses also being
seen as "expected."
Log a little more detail about unexpected exceptions in the ExecutorBase
so it is easier to add them to the list of expected exceptions.
Change-Id: I1bdd628eba717308f0afe1a889efd8711bad6296
Closes-bug: #1276163
The dispatcher is now responsible to configure and to get the listener from
the transport.
The server just ask to the dispatcher to build and return a configured
listener for a provider transport.
Partial implements blueprint notification-subscriber-server
Change-Id: I4a6d9620b8239f6d377bc5788b8a90a860b2f02c
The client call() and cast() methods take a request context argument
which is expected to be a dictionary. The RPC endpoint methods on the
server are invoked with a dictionary context argument.
However, Nova passes a nova.context.RequestContext on the client side
and the oslo-incubator RPC code deserializes that as a amqp.RpcContext
which looks vaguely compatible with Nova's RequestContext.
Support the serialization and deserialization of RequestContext objects
with an additional (de)serialize_context() hook on our Serializer class.
Note: this is a backwards incompatible API change because Serializer
implementations which do not implement the new abstract methods would
no longer be possible to instantiate. Not a problem with this commit,
but shows the type of compat concerns we'll need to think about once the
API is locked down for good.
Change-Id: I20782bad77fa0b0e396d082df852ca355548f9b7
Review I4e7b19dc730342091fd70a717065741d56da4555 gives a lot of the
background here, but the idea is that some exceptions raised by an RPC
endpoint method do not indicate any sort of failure and should not be
logged by the server as an error.
The classic example of this is conductor's instance_get() method raising
InstanceNotFound. This is perfectly normal and should not be considered
an error.
The new API is a decorator which you can use with RPC endpoints methods
to indicate which exceptions are expected:
@messaging.expected_exceptions(InstanceNotFound)
def instance_get(self, context, instance_id):
...
but we also need to expose the ExpectedException type itself so that
direct "local" users of the endpoint class know what type will be used
to wrap expected exceptions. For example, Nova has an ExceptionHelper
class which unwraps the original exception from an ExpectedException and
re-raises it.
I've changed from client_exceptions() and ClientException to make it
more clear it's intent. I felt that the "client" naming gave the
impression it was intended for use on the client side.
Change-Id: Ieec4600bd6b70cf31ac7925a98a517b84acada4d
Inspired by tulip, have every module define a __all__ list and import *
from the top-level module.
Rename transport.set_defaults() since we don't want this to be a
top-level set_defaults() function as there may be multiple.
Also, rather than configuring flake8 to allow star imports, just exclude
the __init__.py files from flake8 checks.