Class RawUploadResource

java.lang.Object
ai.pipestream.connector.intake.http.RawUploadResource

@Path("/uploads") public class RawUploadResource extends Object
HTTP endpoint for raw binary uploads from connectors (POST /uploads/raw). Validates headers, derives document identity, and streams the body to repository-service.
  • Constructor Details

    • RawUploadResource

      public RawUploadResource()
  • Method Details

    • uploadRaw

      @POST @Path("/raw") @Consumes("*/*") @Produces("application/json") @RolesAllowed("intake-client") public jakarta.ws.rs.core.Response uploadRaw(InputStream body, @HeaderParam("content-length") Long contentLength, @HeaderParam("content-type") String contentType, @HeaderParam("x-datasource-id") String datasourceId, @HeaderParam("x-api-key") String apiKey, @HeaderParam("x-doc-id") String clientDocId, @HeaderParam("x-source-doc-id") String sourceDocId, @HeaderParam("x-source-uri") String sourceUri, @HeaderParam("x-source-path") String sourcePath, @HeaderParam("x-filename") String filename, @HeaderParam("x-checksum-sha256") String checksumSha256, @HeaderParam("x-request-id") String requestId, @HeaderParam("x-crawl-id") String crawlId, @HeaderParam("x-force-save") String forceSave)
      Synchronous proxy of a raw upload to repository-service.

      RunOnVirtualThread dispatches each request on its own virtual thread — concurrent uploads each get their own VT, blocking on body forwarding parks the VT without pinning a carrier thread, and there's no Mutiny operator chain wrapping the body InputStream (which had been silently losing subscription events under burst load: 9 parallel s3 uploads would log entry, then their chains would evaporate with no error and no thread parked anywhere).

      Body streaming through RepositoryUploadClient's now- synchronous REST client is direct blocking I/O: the inbound HTTP request body InputStream and the outbound REST client body stream are coupled through the VT, with HTTP/2 native backpressure.