【问题标题】:What is the Camel endpoint for marshalling using bindy dataformat?使用 bindy 数据格式编组的 Camel 端点是什么?
【发布时间】:2017-01-10 13:28:55
【问题描述】:

我需要动态创建camel-bindy 端点来编组输入。下面是示例代码:

<dataFormats>
  <bindy id="bookModel" type="Csv" classType="org.camelcookbook.transformation.csv.model.BookModel"/>
</dataFormats>
<route>
  <from uri="direct:unmarshal"/>
  <!-- <unmarshal ref="bookModel"/> -->
  <to uri="dataformat:bindy:unmarshal?ref=bookModel"/>      
</route>

我需要将交换传递到等效端点,而不是解组标签,但出现错误“找不到名称为 bindy 的数据格式”

【问题讨论】:

  • 我将使用“recipientList”将消息动态路由到适当的绑定编组器。
  • 您是否将 camel-bindy 作为依赖项添加到您的类路径中。
  • 是的,克劳斯。已添加
  • 下面的工作正常:
  • 所以,你是说 unmarshal 有效,但 marshal 无效?

标签: java apache-camel bindy


【解决方案1】:

有多种绑定数据格式:csv、定长、键值对。

它们各自与“dataformat:”端点uri一起使用的数据格式名称是:

  • bindy-csv,
  • 绑定固定,
  • bindy-kvp

所以在你的情况下,你应该像这样指定解组:

<to uri="dataformat:bindy-csv:unmarshal?ref=bookModel"/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-23
    • 1970-01-01
    • 1970-01-01
    • 2012-03-27
    • 2022-01-12
    相关资源
    最近更新 更多