FAQ
Hello,

I have a problem using Camel Mail. I can get emails with attachments without
any problem.
But when I send an email with attachment, the attachment gets truncated and
I see only the last 3KB of it.
I have to add that I construct my attachment from converting the route
content(String) into attachment, if this makes any difference, but I tested
the "conversion" and nothing disappears in there because using Servicemix
Mail does the trick...

Has anyone any idea about this?

--
Laurentiu Trica
Software Developer Mobile: (+40) 722 329318
S.C MoreDevs S.R.L. Email: laurentiu.trica@finalfolder.biz

This message can contain privileged or confidential information and it is
intended only for addressee. Any unauthorized disclosure is strictly
prohibited.

Search Discussions

  • Willem Jiang at Apr 15, 2011 at 2:06 am
    Hi,

    How do you setup the attachment?
    I don't think converting the message body into attachment will lost the
    date.

    On 4/14/11 10:08 PM, Laurentiu Trica wrote:
    Hello,

    I have a problem using Camel Mail. I can get emails with attachments without
    any problem.
    But when I send an email with attachment, the attachment gets truncated and
    I see only the last 3KB of it.
    I have to add that I construct my attachment from converting the route
    content(String) into attachment, if this makes any difference, but I tested
    the "conversion" and nothing disappears in there because using Servicemix
    Mail does the trick...

    Has anyone any idea about this?

    --
    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
  • Laurentiu Trica at Apr 22, 2011 at 1:10 pm
    Hello,

    I use this code:

    public class ContentToAttachment extends AbstractTransparentProcessor {

    private String contentType = "application/octet-stream";

    public void process(Exchange exchange) throws Exception {
    Message msg = transferData(exchange);

    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("");
    }
    }

    Shouldn't this work ok with Camel?
    Are there some default length limits for attachments?

    On Fri, Apr 15, 2011 at 5:06 AM, Willem Jiang wrote:

    Hi,

    How do you setup the attachment?
    I don't think converting the message body into attachment will lost the
    date.


    On 4/14/11 10:08 PM, Laurentiu Trica wrote:

    Hello,

    I have a problem using Camel Mail. I can get emails with attachments
    without
    any problem.
    But when I send an email with attachment, the attachment gets truncated
    and
    I see only the last 3KB of it.
    I have to add that I construct my attachment from converting the route
    content(String) into attachment, if this makes any difference, but I
    tested
    the "conversion" and nothing disappears in there because using Servicemix
    Mail does the trick...

    Has anyone any idea about this?
    --
    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


    --
    Laurentiu Trica
    Software Developer Mobile: (+40) 722 329318
    S.C MoreDevs S.R.L. Email: laurentiu.trica@finalfolder.biz

    This message can contain privileged or confidential information and it is
    intended only for addressee. Any unauthorized disclosure is strictly
    prohibited.
  • Willem Jiang at Apr 22, 2011 at 2:02 pm
    The code looks good to me.
    Can you check if the stream is right?
    Can you dump the stream to see if it is truncated?

    Willem
    On 4/22/11 9:10 PM, Laurentiu Trica wrote:
    Hello,

    I use this code:

    public class ContentToAttachment extends AbstractTransparentProcessor {

    private String contentType = "application/octet-stream";

    public void process(Exchange exchange) throws Exception {
    Message msg = transferData(exchange);

    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("");
    }
    }

    Shouldn't this work ok with Camel?
    Are there some default length limits for attachments?


    On Fri, Apr 15, 2011 at 5:06 AM, Willem Jiangwrote:
    Hi,

    How do you setup the attachment?
    I don't think converting the message body into attachment will lost the
    date.


    On 4/14/11 10:08 PM, Laurentiu Trica wrote:

    Hello,

    I have a problem using Camel Mail. I can get emails with attachments
    without
    any problem.
    But when I send an email with attachment, the attachment gets truncated
    and
    I see only the last 3KB of it.
    I have to add that I construct my attachment from converting the route
    content(String) into attachment, if this makes any difference, but I
    tested
    the "conversion" and nothing disappears in there because using Servicemix
    Mail does the trick...

    Has anyone any idea about this?
    --
    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

    --
    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
  • Laurentiu Trica at Apr 27, 2011 at 9:15 am
    Hello,

    We solved the problem. We don't use StreamDataSource anymore, we use
    ByteArrayDataSource.
    It seems to be a problem while using the StreamDataSource, although the
    stream was ok, because we wiretapped it before and the resulted file was
    good.

    Thanks for helping, anyway.

    Laurentiu
    On Fri, Apr 22, 2011 at 5:01 PM, Willem Jiang wrote:

    The code looks good to me.
    Can you check if the stream is right?
    Can you dump the stream to see if it is truncated?

    Willem

    On 4/22/11 9:10 PM, Laurentiu Trica wrote:

    Hello,

    I use this code:

    public class ContentToAttachment extends AbstractTransparentProcessor {

    private String contentType = "application/octet-stream";

    public void process(Exchange exchange) throws Exception {
    Message msg = transferData(exchange);

    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("");
    }
    }

    Shouldn't this work ok with Camel?
    Are there some default length limits for attachments?


    On Fri, Apr 15, 2011 at 5:06 AM, Willem Jiang<willem.jiang@gmail.com
    wrote: Hi,
    How do you setup the attachment?
    I don't think converting the message body into attachment will lost the
    date.



    On 4/14/11 10:08 PM, Laurentiu Trica wrote:

    Hello,
    I have a problem using Camel Mail. I can get emails with attachments
    without
    any problem.
    But when I send an email with attachment, the attachment gets truncated
    and
    I see only the last 3KB of it.
    I have to add that I construct my attachment from converting the route
    content(String) into attachment, if this makes any difference, but I
    tested
    the "conversion" and nothing disappears in there because using
    Servicemix
    Mail does the trick...

    Has anyone any idea about this?

    --
    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
    --
    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


    --
    Laurentiu Trica
    Software Developer Mobile: (+40) 722 329318
    S.C MoreDevs S.R.L. Email: laurentiu.trica@finalfolder.biz

    This message can contain privileged or confidential information and it is
    intended only for addressee. Any unauthorized disclosure is strictly
    prohibited.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedApr 14, '11 at 2:09p
activeApr 27, '11 at 9:15a
posts5
users2
websitecamel.apache.org

2 users in discussion

Laurentiu Trica: 3 posts Willem Jiang: 2 posts

People

Translate

site design / logo © 2022 Grokbase