FileProducer - consumes file instead of producing!
--------------------------------------------------

                 Key: CAMEL-713
                 URL: https://issues.apache.org/activemq/browse/CAMEL-713
             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.

Reply via email to