Bases: exceptions.Exception
This encapsulates some actual exception that is expected to be hit by an RPC proxy object. Merely instantiating it records the current exception information, which will be passed back to the RPC client without exceptional logging.
Bases: object
Bases: object
A connection, returned by rpc.create_connection().
This class represents a connection to the message bus used for rpc. An instance of this class should never be created by users of the rpc API. Use rpc.create_connection() instead.
Close the connection.
This method must be called when the connection will no longer be used. It will ensure that any resources associated with the connection, such as a network connection, and cleaned up.
Spawn a thread to handle incoming messages.
Spawn a thread that will be responsible for handling all incoming messages for consumers that were set up on this connection.
Message dispatching inside of this is expected to be implemented in a non-blocking manner. An example implementation would be having this thread pull messages in for all of the consumers, but utilize a thread pool for dispatching the messages to the proxy objects.
Create a consumer on this connection.
A consumer is associated with a message queue on the backend message bus. The consumer will read messages from the queue, unpack them, and dispatch them to the proxy object. The contents of the message pulled off of the queue will determine which method gets called on the proxy object.
Parameters: |
|
---|
Create a worker on this connection.
A worker is like a regular consumer of messages directed to a topic, except that it is part of a set of such consumers (the “pool”) which may run in parallel. Every pool of workers will receive a given message, but only one worker in the pool will be asked to process it. Load is distributed across the members of the pool in round-robin fashion.
Parameters: |
|
---|
Register as a member of a group of consumers for a given topic from the specified exchange.
Exactly one member of a given pool will receive each message.
A message will be delivered to multiple pools, if more than one is created.
Parameters: |
|
---|
Bases: heat.openstack.common.rpc.common.RPCException
Bases: heat.openstack.common.rpc.common.RPCException
RPC Envelope Version.
This version number applies to the top level structure of messages sent out. It does not apply to the message payload, which must be versioned independently. For example, when using rpc APIs, a version number is applied for changes to the API being exposed over rpc. This version number is handled in the rpc proxy and dispatcher modules.
This version number applies to the message envelope that is used in the serialization done inside the rpc layer. See serialize_msg() and deserialize_msg().
The current message format (version 2.0) is very simple. It is:
- {
- ‘oslo.version’: <RPC Envelope Version as a String>, ‘oslo.message’: <Application Message Payload, JSON encoded>
}
Message format version ‘1.0’ is just considered to be the messages we sent without a message envelope.
So, the current message envelope just includes the envelope version. It may eventually contain additional information, such as a signature for the message payload.
We will JSON encode the application message payload. The message envelope, which includes the JSON encoded application message body, will be passed down to the messaging libraries as a dict.
Bases: exceptions.Exception
Bases: heat.openstack.common.rpc.common.RPCException
Signifies that a remote class has raised an exception.
Contains a string representation of the type of the original exception, the value of the original exception, and the traceback. These are sent to the parent as a joined string so printing the exception contains all of the relevant info.
Bases: heat.openstack.common.rpc.common.RPCException
Signifies that a timeout has occurred.
This exception is raised if the rpc_response_timeout is reached while waiting for a response from the remote side.
Bases: heat.openstack.common.rpc.common.RPCException
Bases: heat.openstack.common.rpc.common.RPCException
Decorator for manager methods that raise expected exceptions. Marking a Manager method with this decorator allows the declaration of expected exceptions that the RPC layer should not consider fatal, and not log as if they were generated in a real error scenario. Note that this will cause listed exceptions to be wrapped in a ClientException, which is used internally by the RPC layer.