Previous topic

The nova.rpc.common Module

Next topic

The nova.rpc.impl_fake Module

This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.rpc.impl_carrot Module

AMQP-based RPC.

Queues have consumers and publishers.

No fan-out support yet.

class AdapterConsumer(connection=None, topic='broadcast', proxy=None)

Bases: nova.rpc.impl_carrot.Consumer

Calls methods on a proxy object based on method and args.

process_data(message_data, message)

Consumer callback to call a method on a proxy object.

Parses the message for validity and fires off a thread to call the proxy object method.

Message data should be a dictionary with two keys:
method: string representing the method to call args: dictionary of arg: value

Example: {‘method’: ‘echo’, ‘args’: {‘value’: 42}}

class Connection(*args, **kwargs)

Bases: carrot.connection.BrokerConnection, nova.rpc.common.Connection

Connection instance object.

cancel_consumer_thread()

Cancel a consumer thread

close()
consume_in_thread()

Consumer from all queues/consumers in a greenthread

create_consumer(topic, proxy, fanout=False)

Create a consumer that calls methods in the proxy

classmethod instance(*args, **kwargs)
classmethod recreate(*args, **kwargs)
class Consumer(*args, **kwargs)

Bases: carrot.messaging.Consumer

Consumer base class.

Contains methods for connecting the fetch method to async loops.

fetch(no_ack=None, auto_ack=None, enable_callbacks=False)

Wraps the parent fetch with some logic for failed connection.

class ConsumerSet(connection, consumer_list)

Bases: object

Groups consumers to listen on together on a single connection.

close()
init(conn)
reconnect()
wait(limit=None)
class DirectConsumer(connection=None, msg_id=None)

Bases: nova.rpc.impl_carrot.Consumer

Consumes messages directly on a channel specified by msg_id.

exchange_type = 'direct'
class DirectPublisher(connection=None, msg_id=None)

Bases: nova.rpc.impl_carrot.Publisher

Publishes messages directly on a channel specified by msg_id.

exchange_type = 'direct'
class FanoutAdapterConsumer(connection=None, topic='broadcast', proxy=None)

Bases: nova.rpc.impl_carrot.AdapterConsumer

Consumes messages from a fanout exchange.

exchange_type = 'fanout'
class FanoutPublisher(topic, connection=None)

Bases: nova.rpc.impl_carrot.Publisher

Publishes messages to a fanout exchange.

exchange_type = 'fanout'
class MulticallWaiter(consumer)

Bases: object

close()
wait()
class Pool(min_size=0, max_size=4, order_as_stack=False, create=None)

Bases: eventlet.pools.Pool

Class that implements a Pool of Connections.

create()
class Publisher(connection, exchange=None, routing_key=None, **kwargs)

Bases: carrot.messaging.Publisher

Publisher base class.

class RpcContext(*args, **kwargs)

Bases: nova.context.RequestContext

reply(reply=None, failure=None, ending=False)
class TopicAdapterConsumer(connection=None, topic='broadcast', proxy=None)

Bases: nova.rpc.impl_carrot.AdapterConsumer

Consumes messages on a specific topic.

exchange_type = 'topic'
class TopicPublisher(connection=None, topic='broadcast', durable=None)

Bases: nova.rpc.impl_carrot.Publisher

Publishes messages on a specific topic.

exchange_type = 'topic'
call(context, topic, msg, timeout=None)

Sends a message on a topic and wait for a response.

cast(context, topic, msg)

Sends a message on a topic without waiting for a response.

cleanup()
create_connection(new=True)

Create a connection

fanout_cast(context, topic, msg)

Sends a message on a fanout exchange without waiting for a response.

generic_response(message_data, message)

Logs a result and exits.

msg_reply(msg_id, reply=None, failure=None, ending=False)

Sends a reply or an error on the channel signified by msg_id.

Failure should be a sys.exc_info() tuple.

multicall(context, topic, msg, timeout=None)

Make a call that returns multiple times.

notify(context, topic, msg)

Sends a notification event on a topic.

send_message(topic, message, wait=True)

Sends a message for testing.