PartitionContext 클래스

파티션 관련 컨텍스트 정보를 포함합니다.

PartitionContext 인스턴스는 EventHubConsumerClient.receive()를 호출할 때 정의된 이벤트, 오류 및 초기화 콜백에 전달됩니다. 사용자는 이 클래스의 update_checkpoint()를 호출하여 검사점 데이터를 유지할 수 있습니다.

상속
builtins.object
PartitionContext

생성자

PartitionContext(fully_qualified_namespace: str, eventhub_name: str, consumer_group: str, partition_id: str, checkpoint_store: CheckpointStore | None = None)

매개 변수

Name Description
fully_qualified_namespace
필수
eventhub_name
필수
consumer_group
필수
partition_id
필수
checkpoint_store
기본값: None

메서드

update_checkpoint

지정된 이벤트 오프셋에 수신 검사점 업데이트.

update_checkpoint

지정된 이벤트 오프셋에 수신 검사점 업데이트.

async update_checkpoint(event: EventData | None = None, **kwargs: Any) -> None

매개 변수

Name Description
event

검사점에서 사용되는 오프셋 및 시퀀스 번호 정보를 포함하는 EventData 인스턴스입니다.

기본값: None

반환

형식 Description

특성

last_enqueued_event_properties

큐에 포함되는 최신 이벤트 정보입니다.

이 속성은 수신자가 true로 설정된 track_last_enqueued_event_properties 만든 경우 이벤트가 수신될 때마다 업데이트됩니다. 속성 dict에는 마지막 큐에 추가된 이벤트에 대한 다음 정보가 포함됩니다.

  • sequence_number (int)

  • offset (str)

  • enqueued_time (UTC datetime.datetime)

  • retrieval_time (UTC datetime.datetime)

반환

형식 Description
dict,