pamqp.frame

Manage the marshaling and unmarshaling of AMQP frames

unmarshal will turn a raw AMQP byte stream into the appropriate AMQP objects from the specification file.

marshal will take an object created from the specification file and turn it into a raw byte stream.

pamqp.frame.marshal(frame_value: Union[pamqp.base.Frame, pamqp.body.ContentBody, pamqp.header.ContentHeader, pamqp.header.ProtocolHeader, pamqp.heartbeat.Heartbeat], channel_id: int) bytes[source]

Marshal a frame to be sent over the wire.

Raises

ValueError

pamqp.frame.unmarshal(data_in: bytes) Tuple[int, int, Union[pamqp.base.Frame, pamqp.body.ContentBody, pamqp.header.ContentHeader, pamqp.header.ProtocolHeader, pamqp.heartbeat.Heartbeat]][source]

Takes in binary data and maps builds the appropriate frame type, returning a frame object.

Returns

tuple of bytes consumed, channel, and a frame object

Raises

exceptions.UnmarshalingException

pamqp.frame.frame_parts(data: bytes) Tuple[int, int, Optional[int]][source]

Attempt to decode a low-level frame, returning frame parts