Actually it seems that all the files I send get truncated. It's just that some of them get truncated all the way to nothing, but if I send one file multiple times the result is the same.
On Fri, Apr 22, 2011 at 4:09 PM, Willem Jiang <willem.ji...@gmail.com>wrote: > On 4/22/11 6:43 PM, Sorin Silaghi wrote: > >> Hi, >> >> >> I'm using FUSE ESB 4.3.1-fuse-01-09 and the camel version is 2.6.0. >> I >> just downloaded the 2.6.0 tag from the repo because I was trying to debug >> using trunk and I think there were some differences. I'll have a look at >> the >> unit tests also. >> >> > You can download the source jar from Fuse maven repository[1]. > As FuseSource is keep merge the bug fix from the trunk to 2.6.x fuse > branch, the source code is not exactly as the Apache camel 2.6.0. > > The camel version should be 2.6.0-fuse-01-09 > > [1]http://repo.fusesource.com/nexus/content/groups/public > > > >> Sorin. >> >> On Fri, Apr 22, 2011 at 11:49 AM, Claus Ibsen<claus.ib...@gmail.com> >> wrote: >> >> On Fri, Apr 22, 2011 at 9:33 AM, Sorin Silaghi<sorin7...@gmail.com> >>> wrote: >>> >>>> Hi all, >>>> >>>> >>>> >>>> I'm trying to send an e-mail using camel-mail and I have a >>>> problem with the attachments: they always arive empty. >>>> >>>> >>> Have you seen some of the unit tests in camel-mail which tests with >>> attachments? >>> >>> Also what version of Camel do you use? And what server/runtime do you >>> use? >>> >>> >>> To generate the attachment I wrote a processor (code below). I >>>> generate the stream in the route using "convertBodyTo". I also tried to >>>> >>> do >>> >>>> some debugging in the camel-mail component and the exchange message >>>> seems >>>> >>> to >>> >>>> be fine when it gets there. Any ideas ? >>>> >>>> >>>> InputStream stream = (InputStream) msg.getBody(); >>>> >>>> String attachmentId = (String) >>>> msg.getHeader(UtilConstants.CAMEL_FILENAME_KEY); >>>> if (attachmentId == null){ >>>> attachmentId = UtilConstants.CAMEL_FILENAME_KEY; >>>> } >>>> >>>> DataHandler handler = new DataHandler(new StreamDataSource(stream, >>>> contentType, attachmentId)); >>>> >>>> msg.addAttachment(attachmentId, handler); >>>> msg.setBody(""); >>>> >>>> >>> >>> >>> -- >>> Claus Ibsen >>> ----------------- >>> FuseSource >>> Email: cib...@fusesource.com >>> Web: http://fusesource.com >>> CamelOne 2011: http://fusesource.com/camelone2011/ >>> Twitter: davsclaus >>> Blog: http://davsclaus.blogspot.com/ >>> Author of Camel in Action: http://www.manning.com/ibsen/ >>> >>> >> > > -- > Willem > ---------------------------------- > FuseSource > Web: http://www.fusesource.com > Blog: http://willemjiang.blogspot.com (English) > http://jnn.javaeye.com (Chinese) > Twitter: willemjiang > > Connect at CamelOne May 24-26 > The Open Source Integration Conference > http://camelone.com >