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

Endpoint DSL - File never consumed using delay

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Is not about camel-file-watch but camel-file it doesn't appear in components list...

      1. When using file component with delay option the files will never be consummated if timeUnit != milliseconds
      2. Il also see that using delay with string (.delay("2s")) is not accepted anymore i got an exception even if the method still accept string...

      Some code

      org.apache.camel.FailedToCreateRouteException: Failed to create route input-directory-route: Route(input-directory-route)[From[file:D:/2411/_data/l... because of Failed to resolve endpoint: file:D:/2411/_data/load/input?delay=2s&move=D%3A%2F2411%2F_data%2Fload%2Fsuccess&moveFailed=D%3A%2F2411%2F_data%2Fload%2Ffailure due to: Error binding property (delay=2s) with name: delay on bean: file:D:/2411/_data/load/input?delay=2s&move=D%3A%2F2411%2F_data%2Fload%2Fsuccess&moveFailed=D%3A%2F2411%2F_data%2Fload%2Ffailure with value: 2s
      	at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:123) ~[camel-core-engine-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:353) ~[camel-core-engine-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:327) ~[camel-core-engine-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2598) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[camel-api-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2431) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[camel-api-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2448) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:121) ~[camel-spring-3.2.0.jar:3.2.0]
      	at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:157) ~[camel-spring-3.2.0.jar:3.2.0]
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
      	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
      	at fr.aphp.referential.load.LoadMain.main(LoadMain.java:9) ~[classes/:na]
      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:D:/2411/_data/load/input?delay=2s&move=D%3A%2F2411%2F_data%2Fload%2Fsuccess&moveFailed=D%3A%2F2411%2F_data%2Fload%2Ffailure due to: Error binding property (delay=2s) with name: delay on bean: file:D:/2411/_data/load/input?delay=2s&move=D%3A%2F2411%2F_data%2Fload%2Fsuccess&moveFailed=D%3A%2F2411%2F_data%2Fload%2Ffailure with value: 2s
      	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:971) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:893) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.builder.endpoint.AbstractEndpointBuilder.resolve(AbstractEndpointBuilder.java:55) ~[camel-endpointdsl-3.2.0.jar:3.2.0]
      	at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:257) ~[camel-core-engine-3.2.0.jar:3.2.0]
      	at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:117) ~[camel-core-engine-3.2.0.jar:3.2.0]
      	... 24 common frames omitted
      Caused by: org.apache.camel.PropertyBindingException: Error binding property (delay=2s) with name: delay on bean: file:D:/2411/_data/load/input?delay=2s&move=D%3A%2F2411%2F_data%2Fload%2Fsuccess&moveFailed=D%3A%2F2411%2F_data%2Fload%2Ffailure with value: 2s
      	at org.apache.camel.support.PropertyBindingSupport.doBindProperties(PropertyBindingSupport.java:555) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.PropertyBindingSupport.access$000(PropertyBindingSupport.java:71) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.PropertyBindingSupport$Builder.bind(PropertyBindingSupport.java:255) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.DefaultEndpoint.setProperties(DefaultEndpoint.java:433) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.DefaultEndpoint.configureProperties(DefaultEndpoint.java:401) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.ScheduledPollEndpoint.configureProperties(ScheduledPollEndpoint.java:111) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.DefaultComponent.setProperties(DefaultComponent.java:449) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:68) ~[camel-file-3.2.0.jar:3.2.0]
      	at org.apache.camel.component.file.GenericFileComponent.createEndpoint(GenericFileComponent.java:38) ~[camel-file-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:148) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:952) ~[camel-base-3.2.0.jar:3.2.0]
      	... 28 common frames omitted
      Caused by: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: long with value 2s due to org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Long with value 2s due to java.lang.NumberFormatException: For input string: "2s"
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.createTypeConversionException(CoreTypeConverterRegistry.java:563) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo(CoreTypeConverterRegistry.java:251) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.convertTo(CoreTypeConverterRegistry.java:164) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.convertTo(CoreTypeConverterRegistry.java:119) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.component.PropertyConfigurerSupport.property(PropertyConfigurerSupport.java:73) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.component.file.FileEndpointConfigurer.configure(FileEndpointConfigurer.java:52) ~[camel-file-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.PropertyBindingSupport.doBindProperties(PropertyBindingSupport.java:550) ~[camel-support-3.2.0.jar:3.2.0]
      	... 38 common frames omitted
      Caused by: org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: java.lang.Long with value 2s due to java.lang.NumberFormatException: For input string: "2s"
      	at org.apache.camel.support.SimpleTypeConverter.convertTo(SimpleTypeConverter.java:103) ~[camel-support-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo(CoreTypeConverterRegistry.java:360) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.impl.converter.CoreTypeConverterRegistry.doConvertTo(CoreTypeConverterRegistry.java:234) ~[camel-base-3.2.0.jar:3.2.0]
      	... 43 common frames omitted
      Caused by: java.lang.NumberFormatException: For input string: "2s"
      	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:na]
      	at java.base/java.lang.Long.parseLong(Long.java:692) ~[na:na]
      	at java.base/java.lang.Long.valueOf(Long.java:1144) ~[na:na]
      	at org.apache.camel.converter.ObjectConverter.toLong(ObjectConverter.java:177) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.converter.ObjectConverterLoader.lambda$registerConverters$17(ObjectConverterLoader.java:63) ~[camel-base-3.2.0.jar:3.2.0]
      	at org.apache.camel.support.SimpleTypeConverter.convertTo(SimpleTypeConverter.java:99) ~[camel-support-3.2.0.jar:3.2.0]
      	... 45 common frames omitted
      
        @Override
        public void configure() throws Exception {
              from(fileEndpoint("myDir"))
                      // route...
              ;
          }
      
         private EndpointConsumerBuilder fileEndpoint(String directory) {
              return file(directory)
                      .delay(2)
                      .timeUnit(TimeUnit.SECONDS);
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                michael992 michael elbaz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: