-
1. Re: Handling Large Files in JBossESB FileGateway
tfennelly Mar 14, 2008 7:15 AM (in response to mussab.sharif)You should be able to do this by writing a custom MessageComposer (org.jboss.soa.esb.listeners.message.MessageComposer). e.g. a "FileInputStreamMessageComposer" that simply opens the file InputStream on the compose() call, attaches the stream as the message payload for processing by the action pipeline, and closes the InputStream on the decompose() call.
We'd be happy to receive this back as a contribution :-) -
2. Re: Handling Large Files in JBossESB FileGateway
tfennelly Mar 14, 2008 7:17 AM (in response to mussab.sharif)Forgot to mention... you configure your new composer impl on the FileGateway via the "composer-class" property.
-
3. Re: Handling Large Files in JBossESB FileGateway
mussab.sharif Mar 15, 2008 2:24 AM (in response to mussab.sharif)Thanks,
I will try to do and share the result.
Thank you again -
4. Re: Handling Large Files in JBossESB FileGateway
jmorgan Mar 28, 2008 3:53 PM (in response to mussab.sharif)I tried doing this exact thing but ran into serialization/marshalling issues with the FileInputStream. I ended up writing the message composer to just pass the path to the file and let the consumers open it.
Any suggestions on how to marshall the FileInputStream or how that'd work? -
5. Re: Handling Large Files in JBossESB FileGateway
tfennelly Mar 28, 2008 4:16 PM (in response to mussab.sharif)Not sure which version of the ESB you're using, but Daniel Bevenius has just added a new quickstart to the SVN trunk that demonstrates how you could do this. I think he had to do something similar to you in that he had to pass the file name instead of a stream (which was a bit of a pain - will be sorted in v4.3 I hope). This quickstart is still a work in progress I think (correct me if I'm wrong Dan). It uses Smooks v1.0, which has added SAX support as well as some new routing features and more...
Please try this stuff out and let us know what you think! -
6. Re: Handling Large Files in JBossESB FileGateway
tfennelly Mar 28, 2008 4:18 PM (in response to mussab.sharif)BTW... I think Daniel has successfully tested this Quickstart using a 2Gb+ file as the input message.
-
7. Re: Handling Large Files in JBossESB FileGateway
kconner Mar 31, 2008 4:58 AM (in response to mussab.sharif)"jmorgan" wrote:
Any suggestions on how to marshall the FileInputStream or how that'd work?
This is not possible in the current architecture as FileInputStreams are not serializable and will therefore fail as soon as the message needs to be marshalled.
At present the only solutions are to pass the contents through an out of band mechanism (such as including the filename or storing in a database) or to split up the content into small messages at the gateway.
Transparent handling of streams is on the roadmap for a future release.