Glossary of all AMQP frames

class coolamqp.framing.definitions.ConnectionBlocked(reason)

This method indicates that a connection has been blocked

and does not accept new publishes.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionBlocked

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionClose(reply_code, reply_text, class_id, method_id)

Request a connection close

This method indicates that the sender wants to close the connection. This may be due to internal conditions (e.g. a forced shut-down) or due to an error handling a specific method, i.e. an exception. When a close is due to an exception, the sender provides the class and method id of the method which caused the exception.

Parameters
  • class_id (int, 16 bit unsigned (class-id in AMQP)) – Failing method class When the close is provoked by a method exception, this is the class of the method.

  • method_id (int, 16 bit unsigned (method-id in AMQP)) – Failing method id When the close is provoked by a method exception, this is the ID of the method.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionClose

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionCloseOk

Confirm a connection close

This method confirms a Connection.Close method and tells the recipient that it is safe to release resources for the connection and close the socket.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionCloseOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ConnectionOpen(virtual_host)

Open connection to virtual host

This method opens a connection to a virtual host, which is a collection of resources, and acts to separate multiple application domains within a server. The server may apply arbitrary limits per virtual host, such as the number of each type of entity that may be used, per connection and/or in total.

Parameters

virtual_host (binary type (max length 255) (path in AMQP)) – Virtual host name The name of the virtual host to work with.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionOpen

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionOpenOk

Signal that connection is ready

This method signals to the client that the connection is ready for use.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionOpenOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ConnectionStart(version_major, version_minor, server_properties, mechanisms, locales)

Start connection negotiation

This method starts the connection negotiation process by telling the client the protocol version that the server proposes, along with a list of security mechanisms which the client can use for authentication.

Parameters
  • version_major (int, 8 bit unsigned (octet in AMQP)) – Protocol major version The major version number can take any value from 0 to 99 as defined in the AMQP specification.

  • version_minor (int, 8 bit unsigned (octet in AMQP)) – Protocol minor version The minor version number can take any value from 0 to 99 as defined in the AMQP specification.

  • server_properties (table. See coolamqp.uplink.framing.field_table (peer-properties in AMQP)) – Server properties The properties SHOULD contain at least these fields: “host”, specifying the server host name or address, “product”, giving the name of the server product, “version”, giving the name of the server version, “platform”, giving the name of the operating system, “copyright”, if appropriate, and “information”, giving other general information.

  • mechanisms (binary type (longstr in AMQP)) – Available security mechanisms A list of the security mechanisms that the server supports, delimited by spaces.

  • locales (binary type (longstr in AMQP)) – Available message locales A list of the message locales that the server supports, delimited by spaces. The locale defines the language in which the server will send reply texts.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionStart

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionSecure(challenge)

Security mechanism challenge

The SASL protocol works by exchanging challenges and responses until both peers have received sufficient information to authenticate each other. This method challenges the client to provide more information.

Parameters

challenge (binary type (longstr in AMQP)) – Security challenge data Challenge information, a block of opaque binary data passed to the security mechanism.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionSecure

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionStartOk(client_properties, mechanism, response, locale)

Select security mechanism and locale

This method selects a SASL security mechanism.

Parameters
  • client_properties (table. See coolamqp.uplink.framing.field_table (peer-properties in AMQP)) – Client properties The properties SHOULD contain at least these fields: “product”, giving the name of the client product, “version”, giving the name of the client version, “platform”, giving the name of the operating system, “copyright”, if appropriate, and “information”, giving other general information.

  • mechanism (binary type (max length 255) (shortstr in AMQP)) – Selected security mechanism A single security mechanisms selected by the client, which must be one of those specified by the server.

  • response (binary type (longstr in AMQP)) – Security response data A block of opaque data passed to the security mechanism. The contents of this data are defined by the SASL security mechanism.

  • locale (binary type (max length 255) (shortstr in AMQP)) – Selected message locale A single message locale selected by the client, which must be one of those specified by the server.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionStartOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionSecureOk(response)

Security mechanism response

This method attempts to authenticate, passing a block of SASL data for the security mechanism at the server side.

Parameters

response (binary type (longstr in AMQP)) – Security response data A block of opaque data passed to the security mechanism. The contents of this data are defined by the SASL security mechanism.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionSecureOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionTune(channel_max, frame_max, heartbeat)

Propose connection tuning parameters

This method proposes a set of connection configuration values to the client. The client can accept and/or adjust these.

Parameters
  • channel_max (int, 16 bit unsigned (short in AMQP)) – Proposed maximum channels Specifies highest channel number that the server permits. Usable channel numbers are in the range 1..channel-max. Zero indicates no specified limit.

  • frame_max (int, 32 bit unsigned (long in AMQP)) – Proposed maximum frame size The largest frame size that the server proposes for the connection, including frame header and end-byte. The client can negotiate a lower value. Zero means that the server does not impose any specific limit but may reject very large frames if it cannot allocate resources for them.

  • heartbeat (int, 16 bit unsigned (short in AMQP)) – Desired heartbeat delay The delay, in seconds, of the connection heartbeat that the server wants. Zero means the server does not want a heartbeat.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionTune

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionTuneOk(channel_max, frame_max, heartbeat)

Negotiate connection tuning parameters

This method sends the client’s connection tuning parameters to the server. Certain fields are negotiated, others provide capability information.

Parameters
  • channel_max (int, 16 bit unsigned (short in AMQP)) – Negotiated maximum channels The maximum total number of channels that the client will use per connection.

  • frame_max (int, 32 bit unsigned (long in AMQP)) – Negotiated maximum frame size The largest frame size that the client and server will use for the connection. Zero means that the client does not impose any specific limit but may reject very large frames if it cannot allocate resources for them. Note that the frame-max limit applies principally to content frames, where large contents can be broken into frames of arbitrary size.

  • heartbeat (int, 16 bit unsigned (short in AMQP)) – Desired heartbeat delay The delay, in seconds, of the connection heartbeat that the client wants. Zero means the client does not want a heartbeat.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionTuneOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConnectionUnblocked

This method indicates that a connection has been unblocked

and now accepts publishes.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConnectionUnblocked

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ChannelClose(reply_code, reply_text, class_id, method_id)

Request a channel close

This method indicates that the sender wants to close the channel. This may be due to internal conditions (e.g. a forced shut-down) or due to an error handling a specific method, i.e. an exception. When a close is due to an exception, the sender provides the class and method id of the method which caused the exception.

Parameters
  • class_id (int, 16 bit unsigned (class-id in AMQP)) – Failing method class When the close is provoked by a method exception, this is the class of the method.

  • method_id (int, 16 bit unsigned (method-id in AMQP)) – Failing method id When the close is provoked by a method exception, this is the ID of the method.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelClose

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ChannelCloseOk

Confirm a channel close

This method confirms a Channel.Close method and tells the recipient that it is safe to release resources for the channel.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelCloseOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ChannelFlow(active)

Enable/disable flow from peer

This method asks the peer to pause or restart the flow of content data sent by a consumer. This is a simple flow-control mechanism that a peer can use to avoid overflowing its queues or otherwise finding itself receiving more messages than it can process. Note that this method is not intended for window control. It does not affect contents returned by Basic.Get-Ok methods.

Parameters

active (bool (bit in AMQP)) – Start/stop content frames If 1, the peer starts sending content frames. If 0, the peer stops sending content frames.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelFlow

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ChannelFlowOk(active)

Confirm a flow method

Confirms to the peer that a flow command was received and processed.

Parameters

active (bool (bit in AMQP)) – Current flow setting Confirms the setting of the processed flow method: 1 means the peer will start sending or continue to send content frames; 0 means it will not.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelFlowOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ChannelOpen

Open a channel for use

This method opens a channel to the server.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelOpen

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ChannelOpenOk

Signal that the channel is ready

This method signals to the client that the channel is ready for use.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ChannelOpenOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ExchangeBind(destination, source, routing_key, no_wait, arguments)

Bind exchange to an exchange

This method binds an exchange to an exchange.

Parameters
  • destination (binary type (max length 255) (exchange-name in AMQP)) – Name of the destination exchange to bind to Specifies the name of the destination exchange to bind.

  • source (binary type (max length 255) (exchange-name in AMQP)) – Name of the source exchange to bind to Specifies the name of the source exchange to bind.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key for the binding. The routing key is used for routing messages depending on the exchange configuration. Not all exchanges use a routing key - refer to the specific exchange documentation.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments for binding A set of arguments for the binding. The syntax and semantics of these arguments depends on the exchange class.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeBind

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ExchangeBindOk

Confirm bind successful

This method confirms that the bind was successful.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeBindOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ExchangeDeclare(exchange, type_, passive, durable, auto_delete, internal, no_wait, arguments)

Verify exchange exists, create if needed

This method creates an exchange if it does not already exist, and if the exchange exists, verifies that it is of the correct and expected class.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Exchange names starting with “amq.” are reserved for pre-declared and standardised exchanges. The client MAY declare an exchange starting with “amq.” if the passive option is set, or the exchange already exists.

  • type (binary type (max length 255) (shortstr in AMQP)) – Exchange type Each exchange belongs to one of a set of exchange types implemented by the server. The exchange types define the functionality of the exchange - i.e. how messages are routed through it. It is not valid or meaningful to attempt to change the type of an existing exchange.

  • passive (bool (bit in AMQP)) – Do not create exchange If set, the server will reply with Declare-Ok if the exchange already exists with the same name, and raise an error if not. The client can use this to check whether an exchange exists without modifying the server state. When set, all other method fields except name and no-wait are ignored. A declare with both passive and no-wait has no effect. Arguments are compared for semantic equivalence.

  • durable (bool (bit in AMQP)) – Request a durable exchange If set when creating a new exchange, the exchange will be marked as durable. Durable exchanges remain active when a server restarts. Non-durable exchanges (transient exchanges) are purged if/when a server restarts.

  • auto_delete (bool (bit in AMQP)) – Auto-delete when unused If set, the exchange is deleted when all queues have finished using it.

  • internal (bool (bit in AMQP)) – Create internal exchange If set, the exchange may not be used directly by publishers, but only when bound to other exchanges. Internal exchanges are used to construct wiring that is not visible to applications.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments for declaration A set of arguments for the declaration. The syntax and semantics of these arguments depends on the server implementation.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeDeclare

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ExchangeDelete(exchange, if_unused, no_wait)

Delete an exchange

This method deletes an exchange. When an exchange is deleted all queue bindings on the exchange are cancelled.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – The client must not attempt to delete an exchange that does not exist.

  • if_unused (bool (bit in AMQP)) – Delete only if unused If set, the server will only delete the exchange if it has no queue bindings. If the exchange has queue bindings the server does not delete it but raises a channel exception instead.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeDelete

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ExchangeDeclareOk

Confirm exchange declaration

This method confirms a Declare method and confirms the name of the exchange, essential for automatically-named exchanges.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeDeclareOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ExchangeDeleteOk

Confirm deletion of an exchange

This method confirms the deletion of an exchange.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeDeleteOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ExchangeUnbind(destination, source, routing_key, no_wait, arguments)

Unbind an exchange from an exchange

This method unbinds an exchange from an exchange.

Parameters
  • destination (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the destination exchange to unbind.

  • source (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the source exchange to unbind.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Routing key of binding Specifies the routing key of the binding to unbind.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments of binding Specifies the arguments of the binding to unbind.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeUnbind

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ExchangeUnbindOk

Confirm unbind successful

This method confirms that the unbind was successful.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ExchangeUnbindOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.QueueBind(queue, exchange, routing_key, no_wait, arguments)

Bind queue to an exchange

This method binds a queue to an exchange. Until a queue is bound it will not receive any messages. In a classic messaging model, store-and-forward queues are bound to a direct exchange and subscription queues are bound to a topic exchange.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to bind.

  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Name of the exchange to bind to A client MUST NOT be allowed to bind a queue to a non-existent exchange.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key for the binding. The routing key is used for routing messages depending on the exchange configuration. Not all exchanges use a routing key - refer to the specific exchange documentation. If the queue name is empty, the server uses the last queue declared on the channel. If the routing key is also empty, the server uses this queue name for the routing key as well. If the queue name is provided but the routing key is empty, the server does the binding with that empty routing key. The meaning of empty routing keys depends on the exchange implementation.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments for binding A set of arguments for the binding. The syntax and semantics of these arguments depends on the exchange class.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueBind

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueBindOk

Confirm bind successful

This method confirms that the bind was successful.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueBindOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.QueueDeclare(queue, passive, durable, exclusive, auto_delete, no_wait, arguments)

Declare queue, create if needed

This method creates or checks a queue. When creating a new queue the client can specify various properties that control the durability of the queue and its contents, and the level of sharing for the queue.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – The queue name may be empty, in which case the server MUST create a new queue with a unique generated name and return this to the client in the Declare-Ok method.

  • passive (bool (bit in AMQP)) – Do not create queue If set, the server will reply with Declare-Ok if the queue already exists with the same name, and raise an error if not. The client can use this to check whether a queue exists without modifying the server state. When set, all other method fields except name and no-wait are ignored. A declare with both passive and no-wait has no effect. Arguments are compared for semantic equivalence.

  • durable (bool (bit in AMQP)) – Request a durable queue If set when creating a new queue, the queue will be marked as durable. Durable queues remain active when a server restarts. Non-durable queues (transient queues) are purged if/when a server restarts. Note that durable queues do not necessarily hold persistent messages, although it does not make sense to send persistent messages to a transient queue.

  • exclusive (bool (bit in AMQP)) – Request an exclusive queue Exclusive queues may only be accessed by the current connection, and are deleted when that connection closes. Passive declaration of an exclusive queue by other connections are not allowed.

  • auto_delete (bool (bit in AMQP)) – Auto-delete queue when unused If set, the queue is deleted when all consumers have finished using it. The last consumer can be cancelled either explicitly or because its channel is closed. If there was no consumer ever on the queue, it won’t be deleted. Applications can explicitly delete auto-delete queues using the Delete method as normal.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments for declaration A set of arguments for the declaration. The syntax and semantics of these arguments depends on the server implementation.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueDeclare

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueDelete(queue, if_unused, if_empty, no_wait)

Delete a queue

This method deletes a queue. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration, and all consumers on the queue are cancelled.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to delete.

  • if_unused (bool (bit in AMQP)) – Delete only if unused If set, the server will only delete the queue if it has no consumers. If the queue has consumers the server does does not delete it but raises a channel exception instead.

  • if_empty (bool (bit in AMQP)) – Delete only if empty If set, the server will only delete the queue if it has no messages.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueDelete

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueDeclareOk(queue, message_count, consumer_count)

Confirms a queue definition

This method confirms a Declare method and confirms the name of the queue, essential for automatically-named queues.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – Reports the name of the queue. if the server generated a queue name, this field contains that name.

  • consumer_count (int, 32 bit unsigned (long in AMQP)) – Number of consumers Reports the number of active consumers for the queue. Note that consumers can suspend activity (Channel.Flow) in which case they do not appear in this count.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueDeclareOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueDeleteOk(message_count)

Confirm deletion of a queue

This method confirms the deletion of a queue.

Parameters

message_count (int, 32 bit unsigned (message-count in AMQP)) – Reports the number of messages deleted.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueDeleteOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueuePurge(queue, no_wait)

Purge a queue

This method removes all messages from a queue which are not awaiting acknowledgment.

Parameters

queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to purge.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueuePurge

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueuePurgeOk(message_count)

Confirms a queue purge

This method confirms the purge of a queue.

Parameters

message_count (int, 32 bit unsigned (message-count in AMQP)) – Reports the number of messages purged.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueuePurgeOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueUnbind(queue, exchange, routing_key, arguments)

Unbind a queue from an exchange

This method unbinds a queue from an exchange.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to unbind.

  • exchange (binary type (max length 255) (exchange-name in AMQP)) – The name of the exchange to unbind from.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Routing key of binding Specifies the routing key of the binding to unbind.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments of binding Specifies the arguments of the binding to unbind.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueUnbind

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.QueueUnbindOk

Confirm unbind successful

This method confirms that the unbind was successful.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

QueueUnbindOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.BasicAck(delivery_tag, multiple)

Acknowledge one or more messages

When sent by the client, this method acknowledges one or more messages delivered via the Deliver or Get-Ok methods. When sent by server, this method acknowledges one or more messages published with the Publish method on a channel in confirm mode. The acknowledgement can be for a single message or a set of messages up to and including a specific message.

Parameters

multiple (bool (bit in AMQP)) – Acknowledge multiple messages If set to 1, the delivery tag is treated as “up to and including”, so that multiple messages can be acknowledged with a single method. If set to zero, the delivery tag refers to a single message. If the multiple field is 1, and the delivery tag is zero, this indicates acknowledgement of all outstanding messages.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicAck

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicConsume(queue, consumer_tag, no_local, no_ack, exclusive, no_wait, arguments)

Start a queue consumer

This method asks the server to start a “consumer”, which is a transient request for messages from a specific queue. Consumers last as long as the channel they were declared on, or until the client cancels them.

Parameters
  • queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to consume from.

  • consumer_tag (binary type (max length 255) (consumer-tag in AMQP)) – Specifies the identifier for the consumer. the consumer tag is local to a channel, so two clients can use the same consumer tags. If this field is empty the server will generate a unique tag.

  • exclusive (bool (bit in AMQP)) – Request exclusive access Request exclusive consumer access, meaning only this consumer can access the queue.

  • arguments (table. See coolamqp.uplink.framing.field_table (table in AMQP)) – Arguments for declaration A set of arguments for the consume. The syntax and semantics of these arguments depends on the server implementation.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicConsume

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicCancel(consumer_tag, no_wait)

End a queue consumer

This method cancels a consumer. This does not affect already delivered messages, but it does mean the server will not send any more messages for that consumer. The client may receive an arbitrary number of messages in between sending the cancel method and receiving the cancel-ok reply. It may also be sent from the server to the client in the event of the consumer being unexpectedly cancelled (i.e. cancelled for any reason other than the server receiving the corresponding basic.cancel from the client). This allows clients to be notified of the loss of consumers due to events such as queue deletion. Note that as it is not a MUST for clients to accept this method from the server, it is advisable for the broker to be able to identify those clients that are capable of accepting the method, through some means of capability negotiation.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicCancel

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicConsumeOk(consumer_tag)

Confirm a new consumer

The server provides the client with a consumer tag, which is used by the client for methods called on the consumer at a later stage.

Parameters

consumer_tag (binary type (max length 255) (consumer-tag in AMQP)) – Holds the consumer tag specified by the client or provided by the server.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicConsumeOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicCancelOk(consumer_tag)

Confirm a cancelled consumer

This method confirms that the cancellation was completed.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicCancelOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicDeliver(consumer_tag, delivery_tag, redelivered, exchange, routing_key)

Notify the client of a consumer message

This method delivers a message to the client, via a consumer. In the asynchronous message delivery model, the client starts a consumer using the Consume method, then the server responds with Deliver methods as and when messages arrive for that consumer.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the exchange that the message was originally published to. May be empty, indicating the default exchange.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key name specified when the message was published.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicDeliver

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicGet(queue, no_ack)

Direct access to a queue

This method provides a direct access to the messages in a queue using a synchronous dialogue that is designed for specific types of application where synchronous functionality is more important than performance.

Parameters

queue (binary type (max length 255) (queue-name in AMQP)) – Specifies the name of the queue to get a message from.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicGet

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicGetOk(delivery_tag, redelivered, exchange, routing_key, message_count)

Provide client with a message

This method delivers a message to the client following a get method. A message delivered by ‘get-ok’ must be acknowledged unless the no-ack option was set in the get method.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the exchange that the message was originally published to. If empty, the message was published to the default exchange.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key name specified when the message was published.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicGetOk

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicGetEmpty

Indicate no messages available

This method tells the client that the queue has no messages available for the client.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicGetEmpty

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.BasicNack(delivery_tag, multiple, requeue)

Reject one or more incoming messages

This method allows a client to reject one or more incoming messages. It can be used to interrupt and cancel large incoming messages, or return untreatable messages to their original queue. This method is also used by the server to inform publishers on channels in confirm mode of unhandled messages. If a publisher receives this method, it probably needs to republish the offending messages.

Parameters
  • multiple (bool (bit in AMQP)) – Reject multiple messages If set to 1, the delivery tag is treated as “up to and including”, so that multiple messages can be rejected with a single method. If set to zero, the delivery tag refers to a single message. If the multiple field is 1, and the delivery tag is zero, this indicates rejection of all outstanding messages.

  • requeue (bool (bit in AMQP)) – Requeue the message If requeue is true, the server will attempt to requeue the message. If requeue is false or the requeue attempt fails the messages are discarded or dead-lettered. Clients receiving the Nack methods should ignore this flag.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicNack

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicPublish(exchange, routing_key, mandatory, immediate)

Publish a message

This method publishes a message to a specific exchange. The message will be routed to queues as defined by the exchange configuration and distributed to any active consumers when the transaction, if any, is committed.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the exchange to publish to. the exchange name can be empty, meaning the default exchange. If the exchange name is specified, and that exchange does not exist, the server will raise a channel exception.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key for the message. The routing key is used for routing messages depending on the exchange configuration.

  • mandatory (bool (bit in AMQP)) – Indicate mandatory routing This flag tells the server how to react if the message cannot be routed to a queue. If this flag is set, the server will return an unroutable message with a Return method. If this flag is zero, the server silently drops the message.

  • immediate (bool (bit in AMQP)) – Request immediate delivery This flag tells the server how to react if the message cannot be routed to a queue consumer immediately. If this flag is set, the server will return an undeliverable message with a Return method. If this flag is zero, the server will queue the message, but with no guarantee that it will ever be consumed.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicPublish

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicQos(prefetch_size, prefetch_count, global_)

Specify quality of service

This method requests a specific quality of service. The QoS can be specified for the current channel or for all channels on the connection. The particular properties and semantics of a qos method always depend on the content class semantics. Though the qos method could in principle apply to both peers, it is currently meaningful only for the server.

Parameters
  • prefetch_size (int, 32 bit unsigned (long in AMQP)) – Prefetch window in octets The client can request that messages be sent in advance so that when the client finishes processing a message, the following message is already held locally, rather than needing to be sent down the channel. Prefetching gives a performance improvement. This field specifies the prefetch window size in octets. The server will send a message in advance if it is equal to or smaller in size than the available prefetch size (and also falls into other prefetch limits). May be set to zero, meaning “no specific limit”, although other prefetch limits may still apply. The prefetch-size is ignored if the no-ack option is set.

  • prefetch_count (int, 16 bit unsigned (short in AMQP)) – Prefetch window in messages Specifies a prefetch window in terms of whole messages. This field may be used in combination with the prefetch-size field; a message will only be sent in advance if both prefetch windows (and those at the channel and connection level) allow it. The prefetch-count is ignored if the no-ack option is set.

  • global (bool (bit in AMQP)) – Apply to entire connection RabbitMQ has reinterpreted this field. The original specification said: “By default the QoS settings apply to the current channel only. If this field is set, they are applied to the entire connection.” Instead, RabbitMQ takes global=false to mean that the QoS settings should apply per-consumer (for new consumers on the channel; existing ones being unaffected) and global=true to mean that the QoS settings should apply per-channel.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicQos

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicQosOk

Confirm the requested qos

This method tells the client that the requested QoS levels could be handled by the server. The requested QoS applies to all active consumers until a new QoS is defined.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicQosOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.BasicReturn(reply_code, reply_text, exchange, routing_key)

Return a failed message

This method returns an undeliverable message that was published with the “immediate” flag set, or an unroutable message published with the “mandatory” flag set. The reply code and text provide information about the reason that the message was undeliverable.

Parameters
  • exchange (binary type (max length 255) (exchange-name in AMQP)) – Specifies the name of the exchange that the message was originally published to. May be empty, meaning the default exchange.

  • routing_key (binary type (max length 255) (shortstr in AMQP)) – Message routing key Specifies the routing key name specified when the message was published.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicReturn

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicReject(delivery_tag, requeue)

Reject an incoming message

This method allows a client to reject a message. It can be used to interrupt and cancel large incoming messages, or return untreatable messages to their original queue.

Parameters

requeue (bool (bit in AMQP)) – Requeue the message If requeue is true, the server will attempt to requeue the message. If requeue is false or the requeue attempt fails the messages are discarded or dead-lettered.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicReject

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicRecoverAsync(requeue)

Redeliver unacknowledged messages

This method asks the server to redeliver all unacknowledged messages on a specified channel. Zero or more messages may be redelivered. This method is deprecated in favour of the synchronous Recover/Recover-Ok.

Parameters

requeue (bool (bit in AMQP)) – Requeue the message If this field is zero, the message will be redelivered to the original recipient. If this bit is 1, the server will attempt to requeue the message, potentially then delivering it to an alternative subscriber.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicRecoverAsync

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicRecover(requeue)

Redeliver unacknowledged messages

This method asks the server to redeliver all unacknowledged messages on a specified channel. Zero or more messages may be redelivered. This method replaces the asynchronous Recover.

Parameters

requeue (bool (bit in AMQP)) – Requeue the message If this field is zero, the message will be redelivered to the original recipient. If this bit is 1, the server will attempt to requeue the message, potentially then delivering it to an alternative subscriber.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicRecover

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.BasicRecoverOk

Confirm recovery

This method acknowledges a Basic.Recover method.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

BasicRecoverOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxCommit

Commit the current transaction

This method commits all message publications and acknowledgments performed in the current transaction. A new transaction starts immediately after a commit.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxCommit

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxCommitOk

Confirm a successful commit

This method confirms to the client that the commit succeeded. Note that if a commit fails, the server raises a channel exception.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxCommitOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxRollback

Abandon the current transaction

This method abandons all message publications and acknowledgments performed in the current transaction. A new transaction starts immediately after a rollback. Note that unacked messages will not be automatically redelivered by rollback; if that is required an explicit recover call should be issued.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxRollback

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxRollbackOk

Confirm successful rollback

This method confirms to the client that the rollback succeeded. Note that if an rollback fails, the server raises a channel exception.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxRollbackOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxSelect

Select standard transaction mode

This method sets the channel to use standard transactions. The client must use this method at least once on a channel before using the Commit or Rollback methods.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxSelect

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.TxSelectOk

Confirm transaction mode

This method confirms to the client that the channel was successfully set to use standard transactions.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

TxSelectOk

Returns

an instance of this class

Raises

ValueError – invalid data

class coolamqp.framing.definitions.ConfirmSelect(nowait)

This method sets the channel to use publisher acknowledgements.

The client can only use this method on a non-transactional channel.

Parameters

nowait (bool (bit in AMQP)) – If set, the server will not respond to the method. the client should not wait for a reply method. If the server could not complete the method it will raise a channel or connection exception.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConfirmSelect

Returns

an instance of this class

Raises

ValueError – invalid data

get_size()

Calculate the size of this frame.

Needs to be overloaded, unless you’re a class with IS_CONTENT_STATIC

Return type

int

Returns

int, size of argument section

Raises

RuntimeError – this class isn’t IS_CONTENT_STATIC and this method was called directly. In this case, you should have rather subclassed it.

write_arguments(buf)

Write the argument portion of this frame into target buffer.

Parameters

buf (tp.BinaryIO) – buffer to write to

Raises

ValueError – some field here is invalid!

Return type

None

class coolamqp.framing.definitions.ConfirmSelectOk

This method confirms to the client that the channel was

successfully set to use publisher acknowledgements.

classmethod from_buffer(buf, start_offset)

Construct this frame from a buffer

Parameters
  • buf (buffer or memoryview) – a buffer to construct the frame from

  • offset (int) – offset the argument portion begins at

Return type

ConfirmSelectOk

Returns

an instance of this class

Raises

ValueError – invalid data