Apache Camel - Spring DSL - 将字符串参数传递给 bean 方法 [英] Apache Camel - Spring DSL - Pass String argument to bean method

查看:30
本文介绍了Apache Camel - Spring DSL - 将字符串参数传递给 bean 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Camel 2.10.1 上,以下操作有效:

On Camel 2.10.1, the following worked:

<camel:bean ref="profilingBean" method="addProfilingContext('TEST')"/>

有问题的方法需要一个字符串参数

The method in question takes a String parameter

迁移到 2.10.6 ,这不再起作用,它尝试将 TEST 作为另一个类调用.我尝试用 ${} 包装,尝试使用& quot;"的奇特组合等等...

Migrating to 2.10.6 , this does not work anymore, it tries to call TEST as another class. I have tried wrapping with ${} , trying to use exotic combinations of "& quot;" etc...

我发现的唯一解决方案是使用常量语言将值放入标头中,然后使用 simple 调用标头.显然,这不是很干净...

The only solution I found was to put the value in a header using constant language then call the header using simple. Obviously, this isn't very clean...

您对如何执行此操作有任何想法吗?

Do you have any ideas how to do this?

干杯

推荐答案

带有标题的解决方案很好.你说的bug应该在2.10.7或者2.11.1等版本修复

Your solution with the header is fine. The bug you talk about should be fixed in 2.10.7, or 2.11.1 etc.

这篇关于Apache Camel - Spring DSL - 将字符串参数传递给 bean 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆