Re: GenericFileMessage creates body from file multiples times

2015-04-29 Thread A.Light
Claus,
I gave it a thought but... if what you say is true, why when the body type
is String then - after the bean call - the body does atually change to null?
It seems to be a problem of consistency or maybe there's a bug in the "noop"
implementation, I don't know.

Anyway, I debugged the code and the issue is that the File component
actively reads the file AGAIN, every time it's invoked a getBody on a body =
null. So the body WAS actually null but it got overwritten. And it will do
that every time.

To me this is not right, as I explained in my previous messages.
Do you see my point?






--
View this message in context: 
http://camel.465427.n5.nabble.com/GenericFileMessage-creates-body-from-file-multiples-times-tp5765116p5766511.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: GenericFileMessage creates body from file multiples times

2015-04-29 Thread A.Light
Hi Willem,
thanks for your reply.

The more I think about this, the more I get convinced that this isn't right.
Whatever the case is, the file should be read only once. I cannot find a
scenario where reading the file more than once is different than exploiting
a loose side effect.

Maybe it's stupid, but couldn't the file component simply have an internal
property that remembers if the file has been already read or not? Or
something alike, that basically leaves the lazy reading in place, but avoids
multiple readings of the file?

Kind regards,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/GenericFileMessage-creates-body-from-file-multiples-times-tp5765116p5766473.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: GenericFileMessage creates body from file multiples times

2015-04-29 Thread A.Light
In case the answers to my questions are no, considering the serious issue of
having a supposedly empty body suddenly filled with the whole file, I would
then consider the extreme solution of giving up lazy reading (or at least
having it optional, with clear explanations of the consecuencies).

Thanks,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/GenericFileMessage-creates-body-from-file-multiples-times-tp5765116p5766474.html
Sent from the Camel - Users mailing list archive at Nabble.com.


GenericFileMessage creates body from file multiples times

2015-04-01 Thread A.Light
Hi all,
using the file component I encountered a behaviour that doesn't seem right
to me... but maybe it's an intended behaviour.

Basically the issue shows when I have a route that reads the contents of a
file using the file component and then the message body goes to null. At
this point, any subsequent call to "getBody" (for instance a log("${body})
will cause the file to be read again, and put in the body.

This behaviour is caused by the GenericFileMessage method "createBody()"
(invoked by the MessageSupport.getBody() when the body is null) that, for
the sake of lazy file loading, loads the file again every time it is
invoked.

This means that I cannot have an empty body, for any reason, in a route
initiated by a file component. This seems wrong to me as null body can have
valid meaning in a camel route. 
It this an intended behaviour?

I created a test class for this issue that you can get here: 
TestGhostFileBody.java
  .
Let me know if you have problems getting it.

Thanks,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/GenericFileMessage-creates-body-from-file-multiples-times-tp5765116.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Mail - copyTo not working and MailBoxPostProcessAction not found

2015-02-05 Thread A.Light
Ok, at the end, I found what my problem was. I'm ashamed to admit, the
problem was between the keyboard and the chair, thus me.

This are the gotchas:
- I created the folder "process" under inbox, but with the command
"copyTo=process" I'm actually referring to a folder at the root of the email
folder hierarchy, which means at the same level of inbox, so emails were not
going to appear where I expected under "/inbox/processed" but instead under
"/processed";
- During my tests, the mail component created a new folder called "process"
at the root of the hierarchy and diligently copied all my emails there...
only I coudn't see it because Thunderbird/Outlook default server setting is
"Show only subscribed folder" so that folder never showed up.

So the feature works also for me! :)

Thanks for your help,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Mail-copyTo-not-working-and-MailBoxPostProcessAction-not-found-tp5759776p5762417.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Simple email forward route

2014-11-18 Thread A.Light
Hi all,
I'm going to post a question that has already been posted  here
  
and  here

 
, without resolution. Since the previous posts are 1 or 2 years old, I
thought the better thing was to make a new post. We can then point those
posts to here if we get a solution.

Said that, I'm trying to implement a complex route that involves reading and
writing emails, but I'm getting consistently a "Missing start boundary"
exception for which I'm asking for help here. After stripping out from the
route everything not related to the exception, I ended up with this simple
spring route:

  

recei...@foodomain.com
forwar...@foodomain.com

  

My camel version is 2.14.0, java is 1.7. 
Here is the email writeTo format, as taken from
MimeMultipart.writeTo(FileOutputStream):  emailWriteTo.txt
  
Here is the stacktrace of the error:  Stacktrace02.txt
  

What is causing the exception?
Let me know if there's anything else I can provide to help identify the
problem which most surely is somewhere in my configuration.

Thanks for any suggestion,
A.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Simple-email-forward-route-tp5759253.html
Sent from the Camel - Users mailing list archive at Nabble.com.