Hi - a very quick question as I have been struggling with this for a while now. I have an Interface with a single method that takes a single parameter and has no return value. The parameter for this method is serializable but my implementation is wrappering an OutputStream - this is the key to this method, as the Object does all the work and writes the output directly to the stream - hiding the complexity from the client who uses this Object. Also, the fact it streams the data is key, as I do not want to hold all the information in memory.
Ideally I would like to call this method over a message channel using Spring Integration. I'm not sure this is even possible? I have experimented with different ideas, but am not sure what the best approach is to solve this problem - surely my use case is not unique, so I guess my question is are there any design patterns that solve this problem?
I guess one approach is to extend OutputStream with a Serializeable object whose implementation passes byte arrays back to the message channel...would this work/how would this work? Any ideas or suggestions? Or am I trying to do something totally weird and impossible....


Reply With Quote