【问题标题】:Camel Stored Procedure Component SyntaxCamel 存储过程组件语法
【发布时间】:2016-05-18 14:16:25
【问题描述】:

我正在使用骆驼存储过程来调用我们数据库中的过程。调用表达式是这样的:

<camel:to uri="sql-stored:check_data(VARCHAR ${headers.id1},VARCHAR ${headers.id1},OUT INTEGER ${headers.response})?dataSource=ds" />

程序是这样的:

check_data
@id1 varchar(50),
@bid2 varchar(50),
@response int output

经过试用,组件抛出了这个:

org.apache.camel.component.sql.stored.template.ast.ParseRuntimeException: org.apache.camel.component.sql.stored.template.generated.ParseException: Encountered " <SIMPLE_EXP_TOKEN> "${headers.response} "" at line 1, column 80.
Was expecting:
    <IDENTIFIER> ...

我检查了骆驼网站上的语法示例,似乎是真的,但我没有发现这个定义有什么问题。我错过了什么?

谢谢

【问题讨论】:

    标签: stored-procedures apache-camel


    【解决方案1】:

    您不能在 OUT 参数中使用 ${header.xxx} 语法来引用标头。当前实现将输出存储为 Map,您可以在其中定义映射中的键以在纯文本中使用,例如 OUT 响应。

    我们可以考虑向 Camel 组件添加一个新功能,以便您可以告诉它将 OUT 存储在标头而不是消息正文中。

    欢迎您在问题跟踪器中记录 JIRA 票证:http://camel.apache.org/support.html

    【讨论】:

      猜你喜欢
      • 2017-07-25
      • 1970-01-01
      • 2015-12-28
      • 2019-06-09
      • 2018-05-12
      • 2015-08-01
      • 2016-10-28
      • 2020-03-08
      相关资源
      最近更新 更多