Kotlin reactor MultiPart processing in RestController

Viewed 130

I'm trying to convert a Java Spring Reactive RestController to Kotlin coroutine based RestController. Here's the signature of the Java RestController.

    @PostMapping(path = "/{db}/manifest/{asset_id}")
Mono<PushResult> pushManifest(
        @PathVariable(name = "db") String db,
        @PathVariable(name = "asset_id") String assetId,
        @RequestPart(name = "manifest") Mono<FilePart> manifest,
        @RequestPart(name = "head", required = false) Mono<FilePart> head
) {
}

While I can easily change Mono<FilePart> to just FilePart, to read the content of FilePart I have to deal with Flux<DataBuffer>, whereas in Kotlin it would be preferable to always deal with Flow<DataBuffer>.

Is there a Kotlin equivalent for dealing with multipart requests in Spring Reactive that uses the Kotlin native reactive types, such as Flow?

0 Answers
Related