Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-713

FileProducer - consumes file instead of producing!

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.3.0, 1.4.0
    • 1.4.0
    • camel-core
    • None

    Description

      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

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

      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!

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: