camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-713) FileProducer - consumes file instead of producing!
Date Sun, 13 Jul 2008 12:27:00 GMT


Claus Ibsen commented on CAMEL-713:

Added new header on the in message

        // lets store the name we really used in the header, so end-users can retrieve it
        message.setHeader(FileComponent.HEADER_FILE_NAME_PRODUCED, answer.getAbsolutePath());

Remember to add this to wiki

> FileProducer - consumes file instead of producing!
> --------------------------------------------------
>                 Key: CAMEL-713
>                 URL:
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
> The strange code in the FileProducer that if the exchange is out capable it will poll
the file instead bites us big time.
> James must have had a beer and a fancy moment when he created the code. Something with
a dynamic receipentlist where the endpoints should be polled from a file but the expression
uses a Producer when the endpoints is created. For the file it should consume instead but
it doesn't. Any basically it should consume instead.
> It also bites us when we send an InOut exchange to the FileProducer it will *not* produce
the file but consume it and there is no file so nothing happens.
> This code
> {code}
> public class FileBackupTest extends ContextTestSupport {
>     public void testMailGeneration() throws Exception {
>         MockEndpoint mock = getMockEndpoint("mock:result");
>         mock.expectedMessageCount(1);
>         template.requestBody("seda:mails", "Hello World");
>         mock.assertIsSatisfied();
>     }
>     protected RouteBuilder createRouteBuilder() throws Exception {
>         return new RouteBuilder() {
>             public void configure() throws Exception {
>                 from("seda:mails")
>                     .to("file:target/mails")
>                     .to("mock:result");
>             }
>         };
>     }
> {code}
> Would not create a file in target/mails folder as we are using template.*request* that
is an InOut MEP.
> I will fix it by removing the strange consumer code in the FileProducer and change the
fancy dynamic recepientlist test (SimulatorTest), to not use file based endpoints.
> It could be a blocker for the 1.4 release and we should consider creating a new RC!

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message