4

我正在尝试从文件系统中获取 JSON 文件,并尝试将文件插入 MarkLogic 数据库。

<route id="file_upload">
  <!-- incoming requests from the file is routed -->
  <from uri="file:/E:/camel/input"/>
  <to uri="http://localhost:8005/v1/documents?uri/patents/test.json"/>
</route>

用户名和密码为:admin/admin 用于在 8005 上运行的 MarkLogic REST 实例

4

1 回答 1

5

在https://github.com/rjrudin/ml-camel-client上有 Camel/MarkLogic 集成的示例。那些只是使用 mlcp(作为嵌入式库)和 XCC - 我现在将添加一个 REST API 示例并回复。

https://github.com/rjrudin/marklogic-camel-demo显示了进一步的集成,尽管配置是 Java 而不是 XML(我发现 Java 在 Camel 中更容易使用) - 请注意 HTTP 标头和查询字符串的需要作为 Camel 标头传递,而不是作为 URI 的一部分 - https://github.com/rjrudin/marklogic-camel-demo/blob/master/src/main/java/org/example/util/RunCamel.java #L76。这也记录在 Camel http4 页面中 - http://camel.apache.org/http4.html

于 2016-08-03T12:30:15.063 回答