145.2. 手动启用

如果您使用 OSGi 或实现没有添加到类路径中,您需要启用这个到期情况:

CamelContext camel = ...

camel.setHeadersMapFactory(new FastHeadersMapFactory());

或者在 XML DSL (spring 或 blueprint XML 文件)中,您可以将工厂声明为 < bean>

<bean id="fastMapFactory" class="org.apache.camel.component.headersmap.FastHeadersMapFactory"/>

然后,Camel 应该检测 bean 并使用工厂。