publisher
Kafka publisher for docling-extraction-request events.
Classes
KafkaPublisher
Publisher for docling-extraction-request events using Kafka.
Constructor:
def __init__(self) -> None
Methods
publish_docling_extraction_request
def publish_docling_extraction_request(self, document_id: str, organization_id: str, storage_path: str, user_id: str | None = None, project_id: str | None = None, filename: str | None = None, file_size_bytes: int | None = None, content_type: str | None = None, content_hash: str | None = None, trace_id: str | None = None, metadata: dict[str, Any] | None = None) -> str | None
Publish docling-extraction-request event.
This publishes a message to the docling-extraction-request topic in the format expected by docling-extractor service.
Args: document_id: Document UUID organization_id: Organization UUID storage_path: Relative path in object storage bucket user_id: User UUID (optional) project_id: Project UUID (optional) filename: Original filename (optional) file_size_bytes: File size in bytes (optional) content_type: MIME type (optional) content_hash: SHA256 hash (optional) trace_id: Trace ID for distributed tracing (optional) metadata: Additional metadata dict (optional)
Returns: document_id if enqueued for publish, or None if publish failed
close
def close(self) -> None
Close the producer and flush any pending messages.