Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-14638

Camel Property Placeholder - prop prefix not working in threadpool

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • fuse-7.6-GA
    • Camel
    • None
    • % %
    • Hide

      1. Create a properties file "redhatexample.cfg" in the ${fuse_home}/etc folder with the following content:

      camel.test = Test
      thread.pool.keepalivetime = 60
      thread.pool.maxpoolsize = 50
      thread.pool.maxqueuesize = -1
      thread.pool.poolsize = 20
      thread.pool.rejectedpolicy = Abort
      stop=true
      

      2. Create a "camel-context.xml" file in the ${fuse_home}/deploy folder with the following content:

      <?xml version="1.0" encoding="UTF-8"?>
      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
          xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
          xmlns:prop="http://camel.apache.org/schema/placeholder"
      xsi:schemaLocation="              http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd              http://camel.apache.org/schema/blueprint https://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
          
      <cm:property-placeholder id="redhatexample" persistent-id="redhatexample" update-strategy="reload"/> 
          
          <camelContext id="example-context" xmlns="http://camel.apache.org/schema/blueprint"><threadPoolProfile
              defaultProfile="false" id="getstatementinformation-pool"
                  keepAliveTime="{{thread.pool.keepalivetime}}"
                  maxPoolSize="{{thread.pool.maxpoolsize}}"
                  maxQueueSize="{{thread.pool.maxqueuesize}}"
                  poolSize="{{thread.pool.poolsize}}"
                  prop:rejectedPolicy="thread.pool.rejectedpolicy"/>        
      <route id="_example">
                  <from uri="timer://foo?fixedRate=true&amp;period=60000"/>
                  <log id="_log1" message="Hello Camel: {{camel.test}}"/>
              </route>
          </camelContext>
      </blueprint>
      

      3. Log will throw:

      org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
      	at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:349) ~[!/:1.10.2]
      	at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:336) ~[!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:365) [!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:311) [!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:280) [!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) [!/:1.10.2]
      	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:266) [!/:1.10.2]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) [!/:1.10.2]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) [!/:1.10.2]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) [!/:1.10.2]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) [!/:1.10.2]
      	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) [!/:1.10.2]
      	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) [org.apache.felix.framework-5.6.12.jar:?]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [!/:3.6.4]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [!/:3.6.4]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [!/:3.6.4]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [!/:3.6.4]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [!/:3.6.4]
      	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [!/:3.6.4]
      Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'prop:rejectedPolicy' is not allowed to appear in element 'threadPoolProfile'.
      	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[?:?]
      	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) ~[?:?]
      	at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) ~[?:?]
      	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source) ~[?:?]
      	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[?:?]
      	at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[?:?]
      	at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) ~[?:?]
      	at javax.xml.validation.Validator.validate(Unknown Source) ~[?:2.9.0]
      	at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:346) ~[!/:1.10.2]
      	... 24 more
      

      According to https://camel.apache.org/manual/latest/using-propertyplaceholder.html, this element should work for any kind of attribute in the XML DSL.

      Show
      1. Create a properties file "redhatexample.cfg" in the ${fuse_home}/etc folder with the following content: camel.test = Test thread.pool.keepalivetime = 60 thread.pool.maxpoolsize = 50 thread.pool.maxqueuesize = -1 thread.pool.poolsize = 20 thread.pool.rejectedpolicy = Abort stop= true 2. Create a "camel-context.xml" file in the ${fuse_home}/deploy folder with the following content: <?xml version= "1.0" encoding= "UTF-8" ?> <blueprint xmlns= "http: //www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:cxf= "http: //camel.apache.org/schema/blueprint/cxf" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" xmlns:cm= "http: //aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" xmlns:prop= "http: //camel.apache.org/schema/placeholder" xsi:schemaLocation= " http: //www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint https://camel.apache.org/schema/blueprint/camel-blueprint.xsd" > <cm:property-placeholder id= "redhatexample" persistent-id= "redhatexample" update-strategy= "reload" /> <camelContext id= "example-context" xmlns= "http: //camel.apache.org/schema/blueprint" ><threadPoolProfile defaultProfile= " false " id= "getstatementinformation-pool" keepAliveTime= "{{thread.pool.keepalivetime}}" maxPoolSize= "{{thread.pool.maxpoolsize}}" maxQueueSize= "{{thread.pool.maxqueuesize}}" poolSize= "{{thread.pool.poolsize}}" prop:rejectedPolicy= "thread.pool.rejectedpolicy" /> <route id= "_example" > <from uri= "timer: //foo?fixedRate= true &amp;period=60000" /> <log id= "_log1" message= "Hello Camel: {{camel.test}}" /> </route> </camelContext> </blueprint> 3. Log will throw: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:349) ~[!/:1.10.2] at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:336) ~[!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:365) [!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:311) [!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:280) [!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) [!/:1.10.2] at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:266) [!/:1.10.2] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) [!/:1.10.2] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) [!/:1.10.2] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) [!/:1.10.2] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) [!/:1.10.2] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) [!/:1.10.2] at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) [org.apache.felix.framework-5.6.12.jar:?] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [!/:3.6.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [!/:3.6.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [!/:3.6.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [!/:3.6.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [!/:3.6.4] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [!/:3.6.4] Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'prop:rejectedPolicy' is not allowed to appear in element 'threadPoolProfile' . at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[?:?] at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[?:?] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?] at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) ~[?:?] at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) ~[?:?] at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source) ~[?:?] at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) ~[?:?] at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) ~[?:?] at org.apache.xerces.jaxp.validation.DOMValidatorHelper.beginNode(Unknown Source) ~[?:?] at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[?:?] at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source) ~[?:?] at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) ~[?:?] at javax.xml.validation.Validator.validate(Unknown Source) ~[?:2.9.0] at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:346) ~[!/:1.10.2] ... 24 more According to https://camel.apache.org/manual/latest/using-propertyplaceholder.html, this element should work for any kind of attribute in the XML DSL.

    Description

      Using Fuse 7.6, prop prefix is not working in threadpool.

      Attachments

        Activity

          People

            emunoz@redhat.com Elkin Dario Munoz Duarte
            emunoz@redhat.com Elkin Dario Munoz Duarte
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: