rest - 不使用 Marklogic 内容泵的 Camel+marklogic

标签 rest apache-camel marklogic spring-dsl

我试图从文件系统中获取一个 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 实例

最佳答案

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 header 和查询字符串需要如何作为 Camel header 传入,而不是作为 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

关于rest - 不使用 Marklogic 内容泵的 Camel+marklogic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38728114/

相关文章:

java - 使用 @Stateless 注释 Java REST 资源有哪些好处/区别?

python - Django Rest Framework 路由器 URL 中的多个整数参数

java - ChannelInboundHandlerAdapter和ChannelOutboundHandlerAdapter是否影响netty4中编码器和解码器的运行顺序?

marklogic - 尽管在 8001 和 8002 上成功,但无法连接到查询控制台 (8000)

marklogic - 是否可以在没有管理员角色的情况下在 MarkLogic 9 上使用 ml-gradle?

json - Go Lang RESTful API 不工作 JSON

java - 如何使用 java 中的其余 api 在集会中为特定工作区、项目和测试用例 ID 创建缺陷

java - Apache Camel 与 RabbitMQ : messages in temp reply queue not being acked when autoAck=false on endpoint configuration

java - 在apache camel spring dsl xml中调用两个toD

xml - 查找 xml 之间的增量差异并在 Xquery 中列出差异