在骆驼蓝图中使用 "prop" 命名空间来解析 属性
Using "prop" namespace in camel blueprint to resolve a property
当我尝试使用 prop 命名空间 (http://camel.apache.org/schema/placeholder) as explained in camel documentation (http://camel.apache.org/using-propertyplaceholder.html) 将一些属性解析为 xs:int 值时,我面临以下问题,其中捆绑包转到“GRACEPERIOD" 尝试解析命名空间时。
09:08:35,325 | DEBUG | e-1.1.0-thread-1 | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Running blueprint container for bundle MyBundle
in state WaitForNamespaceHandlers
09:08:35,325 | INFO | e-1.1.0-thread-1 | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Bundle MyBundle is waiting for namespace hand
lers [http://camel.apache.org/schema/placeholder]
09:08:35,325 | DEBUG | e-1.1.0-thread-1 | BlueprintEventDispatcher | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Sending blueprint container event BlueprintEvent[type=GRACE_
PERIOD, dependencies=[(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/placeholder))]] for bundle MyBundle
09:08:35,325 | DEBUG | nt Dispatcher: 1 | BlueprintListener | 48 - org.apache.karaf.shell.osgi - 2.3.0.redhat-60024 | Blueprint app state changed to GracePeriod for bundle 284
下面是我正在使用的蓝图xml
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:prop="http://camel.apache.org/schema/placeholder"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<cm:property-placeholder id="id2" persistent-id="protectedproperties"
placeholder-prefix="$(" placeholder-suffix=")"/>
<cm:property-placeholder id="id1" persistent-id="instance" placeholder-prefix="${" placeholder-suffix="}"/>
<camel:camelContext id="blueprintContext" trace="false"
xmlns="http://camel.apache.org/schema/blueprint" streamCache="true"
handleFault="false" useBreadcrumb="false" useBlueprintPropertyResolver="false">
<!-- Disable jmxAgent to improve performance. This needs to be enabled
only when the flow needs to be seen via hawtio -->
<camel:jmxAgent disabled="true" />
<camel:threadPoolProfile
id="changedProfile"
defaultProfile="true"
prop:poolSize="camel.thread.poolSize"
prop:maxPoolSize="camel.thread.maxPoolSize"
prop:maxQueueSize="camel.thread.maxQueueSize"/>
</camel:camelContext>
请帮我看看如何解析蓝图中的命名空间。
Versions used:
Camel Core : 2.10.0.redhat-60024
Camel Blueprint : 2.10.0.redhat-60024
Jboss Fuse : 6.0.0.redhat-024
我认为它永远不会在您的设置中起作用。
您链接的页面 using propertyplaceholder 明确指出:
Using Property Placeholders for Any Kind of Attribute in the XML DSL
Available as of Camel 2.7
If you use OSGi Blueprint then this only works from 2.11.1 or 2.10.5 on.
您的旧版本 JBoss Fuse 提供 2.10.0
您应该升级到最新的 JBoss Fuse。
目前最新版本是 6.3.0 和 Camel 2.17.0
当我尝试使用 prop 命名空间 (http://camel.apache.org/schema/placeholder) as explained in camel documentation (http://camel.apache.org/using-propertyplaceholder.html) 将一些属性解析为 xs:int 值时,我面临以下问题,其中捆绑包转到“GRACEPERIOD" 尝试解析命名空间时。
09:08:35,325 | DEBUG | e-1.1.0-thread-1 | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Running blueprint container for bundle MyBundle
in state WaitForNamespaceHandlers
09:08:35,325 | INFO | e-1.1.0-thread-1 | BlueprintContainerImpl | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Bundle MyBundle is waiting for namespace hand
lers [http://camel.apache.org/schema/placeholder]
09:08:35,325 | DEBUG | e-1.1.0-thread-1 | BlueprintEventDispatcher | 15 - org.apache.aries.blueprint.core - 1.0.1.redhat-60024 | Sending blueprint container event BlueprintEvent[type=GRACE_
PERIOD, dependencies=[(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/placeholder))]] for bundle MyBundle
09:08:35,325 | DEBUG | nt Dispatcher: 1 | BlueprintListener | 48 - org.apache.karaf.shell.osgi - 2.3.0.redhat-60024 | Blueprint app state changed to GracePeriod for bundle 284
下面是我正在使用的蓝图xml
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:prop="http://camel.apache.org/schema/placeholder"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<cm:property-placeholder id="id2" persistent-id="protectedproperties"
placeholder-prefix="$(" placeholder-suffix=")"/>
<cm:property-placeholder id="id1" persistent-id="instance" placeholder-prefix="${" placeholder-suffix="}"/>
<camel:camelContext id="blueprintContext" trace="false"
xmlns="http://camel.apache.org/schema/blueprint" streamCache="true"
handleFault="false" useBreadcrumb="false" useBlueprintPropertyResolver="false">
<!-- Disable jmxAgent to improve performance. This needs to be enabled
only when the flow needs to be seen via hawtio -->
<camel:jmxAgent disabled="true" />
<camel:threadPoolProfile
id="changedProfile"
defaultProfile="true"
prop:poolSize="camel.thread.poolSize"
prop:maxPoolSize="camel.thread.maxPoolSize"
prop:maxQueueSize="camel.thread.maxQueueSize"/>
</camel:camelContext>
请帮我看看如何解析蓝图中的命名空间。
Versions used:
Camel Core : 2.10.0.redhat-60024
Camel Blueprint : 2.10.0.redhat-60024
Jboss Fuse : 6.0.0.redhat-024
我认为它永远不会在您的设置中起作用。
您链接的页面 using propertyplaceholder 明确指出:
Using Property Placeholders for Any Kind of Attribute in the XML DSL
Available as of Camel 2.7
If you use OSGi Blueprint then this only works from 2.11.1 or 2.10.5 on.
您的旧版本 JBoss Fuse 提供 2.10.0
您应该升级到最新的 JBoss Fuse。
目前最新版本是 6.3.0 和 Camel 2.17.0