Skip to content

gufo.liftbridge.types

AckPolicy

Bases: IntEnum

Publish acknowledgment policy.

Attributes:

Name Type Description
LEADER

Wait for acknowledgment from a leader.

ALL

Wait for acknowledgment from all cluster members.

NONE

Do not wait for an acknowledgment.

Message dataclass

Bases: object

Liftbridge message.

Parameters:

Name Type Description Default
value bytes

Message body.

required
subject str

Message stream.

required
offset int

Message offset.

required
timestamp int

Message timestamp in UNIX format.

required
key bytes

Message key.

required
partition int

stream partition.

required
headers Dict[str, bytes]

Additional message headers.

required

Metadata dataclass

Bases: object

Liftbridge cluster metadata.

Attributes:

Name Type Description
brockers

List of brokers.

metadata List[StreamMetadata]

List of stream's metadata.

RetentionPolicy dataclass

Bases: object

Partition's retention policy.

Attributes:

Name Type Description
retention_bytes int

Keep up to retention_bytes in a partition.

segment_bytes int
retention_ages int
segment_ages int

StartPosition

Bases: IntEnum

Subscriber's start position.

Attributes:

Name Type Description
NEW_ONLY

Start from new messages beyond the latest published.

OFFSET

Start at a specified offset.

EARLIEST

Start at the oldest message remaining in a partition.

LATEST

Start with the newest message.

TIMESTAMP

Start from a specified timestamp.

RESUME

Non-standard. Resume from next to last processed.