Hello everyone and thanks in advance for reading this.

I wonder if I can get a recommendation from you on how to design the following solution:

I have a simple workflow:

  • Http Inbound Gateway - which mapped to URL in order to retrieve a resource from the server.
  • Request Channel - Where all request messages are sent.
  • Service Activator - Receives all messages from the request channel and calls my 'persistence service'.
  • Persistence Service - Resolves 'some resource' and returns an InputStream in order to be consumed.
  • Response Channel - Where the resource is send for the gateway to generate a HTTP response and send it back to the client.


Here are my questions:

  1. Not sure if I can send an InputStream as a message payload to the response channel and the gateway will read the input stream and write the response. Would it work?
  2. I could read the stream to a byte array and send that to the response channel. But what happens with BIG files?


Is there any recommendation you could share?

Thanks.