此内容没有您所选择的语言版本。

Chapter 137. HeadersMap


Available as of Camel 2.20

The camel-headersmap is a faster implementation of a case-insenstive map which can be plugged in and used by Camel at runtime to have slight faster performance in the Camel Message headers.

137.1. Auto detection from classpath

To use this implementation all you need to do is to add the camel-headersmap dependency to the classpath, and Camel should auto-detect this on startup and log as follows:

Detected and using custom HeadersMapFactory: org.apache.camel.component.headersmap.FastHeadersMapFactory@71e9ebae

For spring-boot there is a camel-headersmap-starter dependency you should use.

137.2. Manual enabling

If you use OSGi or the implementation is not added to the classpath, you need to enable this explict such .Title

CamelContext camel = ...

camel.setHeadersMapFactory(new FastHeadersMapFactory());

Or in XML DSL (spring or blueprint XML file) you can declare the factory as a <bean>

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

and then Camel should detect the bean and use the factory, which is logged:

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.