Apache Camel是一个功能强大的开源集成框架,基于已知的企业集成模式和强大的Bean集成
您何时会在 Apache Camel 中替换 Exchange 的消息而不是消息正文?
我正在使用 Apache Camel,通常仅在转换后替换消息正文或设置一些标头和属性。 替换整个消息的有效用例是什么...
升级到 Camel 4.1 后,Exchange 上不存在计时器属性
我正在尝试从 Camel 4.0 升级到 4.1,并且没有任何计时器属性出现在交易所上。这些东西被转移到其他地方了吗?时间似乎运行正常。 这些是
我正在使用Camel serviceCall 来呼叫我的eureka VIP。主机和端口已按预期解析。但响应是 400 并且抛出错误。我的 serviceCall 如下所示: 来自(“
我在网络服务器上运行两个不同的服务。这两个服务都有一个名为“xyz”的操作,具有以下参数。 服务一: 公共字符串xyx(学生对象){} 服务二: ...
在 OSGi 蓝图中使用 Camel JCachePolicy 和 Caffeine
我想在 OSGi Blueprint 中为 Caffeine 缓存应用camel-jcache 路由策略。 当我向蓝图中添加缓存配置时,如下所示: 我想在 OSGi 蓝图中为咖啡因缓存应用 camel-jcache 路由策略。 当我向蓝图中添加缓存配置时,如下所示: <reference id="cachingProvider" interface="javax.cache.spi.CachingProvider"/> <bean id="caffeineCacheManager" factory-ref="cachingProvider" factory-method="getCacheManager"/> <bean id="caffeineCache" factory-ref="caffeineCacheManager" factory-method="getCache"> <!-- see src/main/resources/application.conf for cache expiration policy --> <argument value="konfig-cache"/> </bean> <bean id="jCachePolicy" class="org.apache.camel.component.jcache.policy.JCachePolicy"> <property name="cache" ref="caffeineCache"/> <property name="keyExpression"> <bean class="org.apache.camel.model.language.SimpleExpression"> <property name="expression" value="${exchangeProperty.typNr}"/> </bean> </property> </bean> 然后蓝图包无法在 NullPointerException 处以 BeanRecipe.setProperties 开头。 我能够将其追溯到类加载器问题。我要求一个名为 konfig-cache 的缓存,但该缓存的配置位于捆绑资源中的文件 application.conf 中(Typesafe Config 中自定义配置的默认位置)。 OSGi 运行时无法使用默认类加载器加载该文件。 如何定义 Caffeine 底层 Typesafe Config 应该使用的类加载器来在 Blueprint 包的资源中定位配置文件? pom.xml中相关依赖: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jsonpath</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jcache</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-caffeine</artifactId> <version>${camel.version}</version> </dependency> <dependency> <groupId>com.github.ben-manes.caffeine</g <artifactId>jcache</artifactId> <version>2.9.2</version> </dependency> 在我的 Karaf feature.xml: <feature version="${camel.version}">camel-jcache</feature> <feature version="${camel.version}">camel-caffeine</feature> <bundle>mvn:com.github.ben-manes.caffeine/jcache/2.9.2</bundle> <bundle>mvn:com.typesafe/config/1.4.2</bundle> 最后,我的src/main/resources/application.conf: # Configuration for camel-caffeine in HOCON format # see https://github.com/lightbend/config/blob/master/HOCON.md#hocon-human-optimized-config-object-notation # see https://github.com/lightbend/config#standard-behavior # see https://github.com/ben-manes/caffeine/blob/master/jcache/src/main/resources/reference.conf # see example https://github.com/ben-manes/caffeine/blob/master/jcache/src/test/resources/application.conf caffeine.jcache { konfig-cache { key-type = java.lang.String value-type = java.lang.Object # The eviction policy for automatically removing entries from the cache policy { # The expiration threshold before lazily evicting an entry. This single threshold is reset on # every operation where a duration is specified. As expected by the specification, if an entry # expires but is not accessed and no resource constraints force eviction, then the expired # entry remains in place. lazy-expiration { # The duration before a newly created entry is considered expired. If set to 0 then the # entry is considered to be already expired and will not be added to the cache. May be # a time duration or "eternal" to indicate no expiration. creation = 60m # The duration before a updated entry is considered expired. If set to 0 then the entry is # considered immediately expired. May be a time duration, null to indicate no change, or # "eternal" to indicate no expiration. update = 60m # The duration before a read of an entry is considered expired. If set to 0 then the entry # is considered immediately expired. May be a time duration, null to indicate no change, or # "eternal" to indicate no expiration. access = null } # The expiration thresholds before eagerly evicting an entry. These settings correspond to the # expiration supported natively by Caffeine where expired entries are collected during # maintenance operations. #eager-expiration { # Specifies that each entry should be automatically removed from the cache once a fixed # duration has elapsed after the entry's creation, or the most recent replacement of its # value. This setting cannot be combined with the variable configuration. #after-write = null # Specifies that each entry should be automatically removed from the cache once a fixed # duration has elapsed after the entry's creation, the most recent replacement of its value, # or its last read. Access time is reset by all cache read and write operation. This setting # cannot be combined with the variable configuration. #after-access = null # The expiry class to use when calculating the expiration time of cache entries. This # setting cannot be combined with after-write or after-access configurations. #variable = null } # The threshold before an entry is eligible to be automatically refreshed when the first stale # request for an entry occurs. This setting is honored only when combined with the # read-through configuration. #refresh { # Specifies that active entries are eligible for automatic refresh once a fixed duration has # elapsed after the entry's creation or the most recent replacement of its value. #after-write = 30s #} # The maximum bounding of the cache based upon its logical size maximum { # The maximum number of entries that can be held by the cache. This setting cannot be # combined with the weight configuration. size = 10 } } } CaffeineCachingProvider 允许将类加载器传递给 CachingProvider.getCacheManager(URI uri, ClassLoader classLoader)。 预期的 URI 只是 CaffeineCachingProvider 的 FQCN。 现在是类加载器。在 OSGi 蓝图中,我们可以确定蓝图包的类加载器并将其传递给 getCacheManager。蓝图规范定义了许多具有预定义参考名称的环境管理器,其中包括蓝图包本身,其名称为blueprintBundle。 因为无论如何我们都在使用 Camel,所以我们可以使用 Camel 的 BundleDelegatingClassLoader 来简化对包的类加载器的访问: <bean id="caffeineCacheManager" factory-ref="cachingProvider" factory-method="getCacheManager"> <argument value="com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider"/> <argument> <bean class="org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader"> <argument ref="blueprintBundle"/> </bean> </argument> </bean>
Apache Camel 和 Springboot - 404 状态 - 当客户尝试到达无效/未定义的端点时,响应正文为空白
我正在尝试让自定义 json 响应正文向客户表明他们尝试到达无效路由。当他们在请求 ex 时缺少参数时。本地主机:8080/你好//...
Apache Camel 中的微米组件 - 公制未显示在 /actuator/prometheus 中
我目前正在使用 Apache Camel 并使用 Micrometer 组件来获取指标。我已经添加了必要的依赖项,但我面临一个问题,即指标未显示在 /
在 Apache Camel 和 Spring Boot 中拆分主体
我有一个像这样的流程,可以按正文将一些查询发送到下一个流程: .process(交换-> { List 词汇表 = Exchange.getIn().getBody(List.class); ...
Apache Camel Adapt() 方法在版本 4 中被删除
从 Apache Camel 3 迁移到版本 4 时,我遇到了这样一个事实:adapt() 方法已从 Camel 上下文中删除,并且不再可能适应 ModelCamelContext
Camel Rest DSL 检索 HTTP POST 多部分文件
我的路由器类如下所示,我正在尝试上传视频文件并将其存储到文件位置。 SpringBootRouter.java 包 com.camelrest; 导入java.util.HashMap; 导入 java.util.M...
我正在使用 Apache Camel 连接和订阅 ActiveMQ Artemis 源并转发到 Kafka 主题。 它运行良好一段时间,但随后因异常而停止: jakarta.jms.JMSSecurityException:
camelrabbitmq v 4.x 的 Spring 启动启动器
新的 Apache Camel LTS 4.0 似乎没有为 org.apache.camel.springboot:camel-rabbitmq-starter 提供最新版本 看来最新版本是 3.21.2 https://mvnrepository.com/
文本数据文件,它显示?在那里做标记 在第 1 行固定长度记录末尾发现意外/未映射的字符 文本文件包含每个长度为 1288 的正文项目列表,当给出
我正在添加一个缓存(咖啡因)来在camel代码中进行rest api调用。 请考虑下面的代码: @成分 公共类 TenantIdService 扩展 ServiceBaseRouteBuilder { @Value("${平台.
如何使用 Apche Camel 向 WebSphere MQ 发送消息并从 MQ 队列接收消息
我在网络上没有看到足够的使用 apache Camel 和 websphere mq 来发送和接收消息的示例。我有一个示例代码,但我在代码中间遇到了困难。任何人都可以帮忙解决这个问题吗.. 重要...
Apache Camel 的 Spring RabbitMQ 的 RabbitMQ 队列中没有可用消息
当我尝试使用 Apache Camel 组件的 Spring RabbitMQ 将消息从一个队列发布到另一个队列时,目标队列没有收到任何消息。 @成分 公开课 WeatherRoute
我正在尝试使用 Apache Camel 来使用包含 JSON 数组形式记录的大型 JSON 文件。我使用 split() 和 jsonpath("$") 来分割返回 Map 的记录,并且可以正常工作...
我们可以使用 apache Camel 端点将文件从 FTP 服务器移动到本地目录吗?
我想知道是否可以使用 apache Camel 端点属性将文件从 FTP 服务器移动或下载到本地目录? 我已经搜索过这个主题但找不到任何内容...
Apache Camel 是否会替代或补充使用 Spring Boot 创建微服务?
我已经使用 Spring 微服务工作了一段时间,但没有遇到过 Apache Camel 作为构建微服务的工具。我不清楚——Apache Camel 是否可以替代创建 micro-
使用 Camel 连接到 Azure Blob 时出现身份验证问题
我的目标是监视 hello 目录中是否有任何新文件创建。创建新文件后,它应该触发 API 并将在 hello 目录中创建的文件上传到 azure。我明白了...