不使用 Marklogic Content Pump 的 Camel+marklogic

Camel+marklogic without using Marklogic Content Pump

我正在尝试从文件系统中获取一个 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 MarkLogic REST 实例 运行 on 8005

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

https://github.com/rjrudin/marklogic-camel-demo shows further integration, though the config is in Java instead of XML (I find Java to be easier to work with in Camel) - note how the HTTP headers and querystring need to be passed in as Camel headers, not as part of the URI - https://github.com/rjrudin/marklogic-camel-demo/blob/master/src/main/java/org/example/util/RunCamel.java#L76 . That's documented in the Camel http4 page as well - http://camel.apache.org/http4.html