3

Does mlcp necessarily need a XDBC server or does it work with a HTTP server as well ?

Yash
  • 510
  • 2
  • 6
  • 14

2 Answers2

5

It depends on the MarkLogic version you use - as of MarkLogic 8 (and of course in 9 as well) you can work with a REST API instance as well, there's no need to setup a separate XDBC application server. You can read more about these enhancements in the MarkLogic 8 release notes: https://docs.marklogic.com/8.0/guide/relnotes/chap3#id_46078

Tamas
  • 10,953
  • 13
  • 47
  • 77
  • 2
    Might be worth noting that while it is no longer a requirements with ML8+, there might be other reasons to need a separate app-server after all, like security settings, or connected modules database, and such.. – grtjn Jul 26 '17 at 11:30
3

The documentation states "REST API instance". This refers specifically to 'servers' created by MarkLogic's REST API. Implied is also "not modified".

"Under the hood", in V8 all "HTTP" servers support the http 1.1 compliant variant of the XCC protocol (https://docs.marklogic.com/guide/xcc.pdf sec 2.12.1). But the HTTP servers "support" features that break this as well, such as use of rewriters (which the REST API utilizes heavily). In part to resolve this issue, the declarative rewriter ("XML Rewriter") was introduced which allows for routing of requests very early in processing pipeline. The XML rewriter supports an 'xdbc passthrough' syntax, which if placed at the top of the document catches XDBC requests and handles them properly.

This is documented in https://docs.marklogic.com/guide/app-dev/XMLrewriter Port 8000 and newly generated REST servers include something like this:

 <match-path any-of="/eval /invoke /spawn /insert">
    <set-error-format>compatible</set-error-format>
    <dispatch xdbc="true">$0</dispatch>
  </match-path>

Port 8002 does not support xcc. Mixing REST, non-REST applications and xdbc is very useful, particularly as a 'out of the box' bootstrap on port 8000. As grtjn mentions, it's not necessarily recommended. Given a choice, I would avoid it and make seperate servers for many reasons. Same with mixing REST use and "application" HTTP on the same server/port. There are a lot of 'moving parts' that have to be just right for this to work well, and it does open potential security holes and unexpected behaviour if you don't fully understand what's going on. Since REST, application HTTP and XDBC are all built on the same technology and underlying protocol (HTTP 1.1) -- mistaken or well crafted code can create requests that appear to be any of these.

-D

DALDEI
  • 3,722
  • 13
  • 9