title: Quarkus - Reactive file download
body: <p>Using <a href="https://quarkus.io/" rel="nofollow noreferrer">Quarkus</a>, can somebody give an example on how the server and client side code using a reactive API to download a file over http looks?  </p>
  
  <p>So far I tried to return a Flux of nio ByteBuffers but it seems not to be supported:</p>
  
  <pre><code>@RegisterRestClient(baseUri = "http://some-page.com")
  interface SomeService {
  
      // same interface for client and server
      @GET
      @Produces(MediaType.APPLICATION_OCTET_STREAM)
      @Path("/somePath")
      fun downloadFile(): reactor.core.publisher.Flux&lt;java.nio.ByteBuffer&gt;
  }
  </code></pre>
  
  <p>Trying to return a Flux on the server-side results in the following exception:</p>
  
  <pre><code>ERROR: RESTEASY002005: Failed executing GET /somePath
  org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: kotlinx.coroutines.reactor.FlowAsFlux of media type: application/octet-stream
      at org.jboss.resteasy.core.ServerResponseWriter.lambda$writeNomapResponse$3(ServerResponseWriter.java:124)
      at org.jboss.resteasy.core.interception.jaxrs.ContainerResponseContextImpl.filter(ContainerResponseContextImpl.java:403)
      at org.jboss.resteasy.core.ServerResponseWriter.executeFilters(ServerResponseWriter.java:251)
      ...
  </code></pre>