kiel.protocol.request

kiel.protocol.request.last_id = 16681161

Seed value for correlation IDs, based on the machine name and PID

kiel.protocol.request.generate_correlation_id()[source]

Creates a new correlation_id for requests.

Increments the last_id value so each generated ID is unique for this machine and process.

class kiel.protocol.request.Request(**kwargs)[source]

Bases: kiel.protocol.part.Part

Base class for all requests sent to brokers.

A specialized subclass of Part with attributes for correlating responses and prefacing payloads with client/api metadata.

api = None
serialize()[source]

Returns a bytesring representation of the request instance.

Prefaces the output with certain information:

api_key => Int16
api_version => Int16
correlation_id => Int32
client_id => String

Since this is a Part subclass the rest is a matter of appending the result of a render() call.