atom feed3 messages in org.apache.servicemix.usersRe: Servicemix and streaming...
FromSent OnAttachments
Ryan MoquinDec 15, 2007 9:11 pm 
Gert VanthienenDec 18, 2007 12:44 pm 
Ryan MoquinDec 21, 2007 6:14 am 
Subject:Re: Servicemix and streaming...
From:Gert Vanthienen (
Date:Dec 18, 2007 12:44:31 pm


What exactly do you mean with streaming content? If you're looking for a way to stream multimedia content (like a shoutcast server would), an ESB is probably not your best choice.

There are a few possibilities to use streaming content inside ServiceMix though. Currently, the normalized message contains an XML body and (optionally) attachments. The XML in the body can be represented by e.g. a StreamSource and in fact this happens in ServiceMix all the time (e.g. when servicemix-file reads a file, it will actually send out a StreamSource). It allows us to transfer really large XML document without having to load them entirely into memory. The drawback of this approach is that the stream can only be read once.

As far as the attachments are concerned, these are transferred using the Java Activation Framework. If you can create a DataSource implementation to hold the stream you want to transfer, you should be able to use streaming for attachments as well. In fact, ServiceMix already has a StreamDataSource class that allows you to send an InputStream in the attachments. If you want a code example for that, just take a look at the BinaryFileMarshaler class.


Ryan Moquin wrote:

I'm not sure how valid of a question this is... but I was wondering about streaming resources and SOAs, in particular servicemix. Has anyone tried to implement any sort of streaming content with servicemix? I'm wondering about the suitability of SOAs for that sort of task, or if that is something that you wouldn't want to do, or really isn't applicable for whatever reason. Has anyone tried or has any thoughts one way or other on the topic? I didn't seem to find anything that addressed this when I search on google, but I may not be searching correctly.