Class IntakeOutcomeRecorder

java.lang.Object
ai.pipestream.connector.intake.status.IntakeOutcomeRecorder

@ApplicationScoped public class IntakeOutcomeRecorder extends Object
Single place where an intake outcome is published. The HTTP and gRPC surfaces both call this so an outcome is emitted identically regardless of entry point.

Publish-then-write: this only emits the (non-blocking) event. The durable upload-receipt write happens downstream in IntakeReceiptProjector when it consumes the accepted stream — never on the upload hot path.

  • Constructor Details

    • IntakeOutcomeRecorder

      public IntakeOutcomeRecorder()
  • Method Details

    • accepted

      public void accepted(String datasourceId, String crawlId, String sessionId, String sourceDocId, String docId)
    • failed

      public void failed(String datasourceId, String crawlId, String sessionId, String sourceDocId, String docId, IntakeErrorCode code, String errorId, String clientMessage)
      A failed upload, emitted as a lifecycle event so the consumer can project it into the status read-model. A client rejection (4xx) becomes a DocumentRejected; a server error (5xx) — not the client's fault, even a valid account can hit one — becomes a DocumentError carrying its errorId. The two stay distinct so the stream never blames the client for our faults.

      Best-effort and keyed: if there is no doc_id/source_doc_id/datasource_id to key the event on, nothing is emitted (the boundary already logged it).