Skip to main content

hybrid_to_proto2

Create a fresh protocol 2 message from a hybrid protocol 1/2 message.

def hybrid_to_proto2(
message: Message,
body: dict
) - > tuple

Create a fresh protocol 2 message from a hybrid protocol 1/2 message.

Parameters

NameTypeDescription
messageMessageThe original message object containing transport-level headers to be merged into the new protocol 2 structure.
bodydictThe message body dictionary containing task metadata, arguments, and execution options like ETA and retries.

Returns

TypeDescription
tupleA tuple containing the task payload (args, kwargs, and embedded callbacks), the merged header dictionary, a boolean flag indicating protocol 2, and the UTC timezone setting.