restapache-camelmarklogicspring-dsl

Camel+marklogic without using Marklogic Content Pump


I am trying out to pick up a JSON file from filesystem and am trying to insert the file to MarkLogic database.

<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>

Username and password is : admin/admin for MarkLogic REST instance running on 8005


Solution

  • There are examples of Camel/MarkLogic integration at https://github.com/rjrudin/ml-camel-client . Those just use mlcp (as an embedded library) and XCC - I'll add a REST API example right now and reply back.

    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