{"id":38674136,"url":"https://github.com/marklogic-community/corb2","last_synced_at":"2026-04-21T01:04:59.105Z","repository":{"id":18282386,"uuid":"21449787","full_name":"marklogic-community/corb2","owner":"marklogic-community","description":"MarkLogic tool for bulk loading, processing, and reporting on content.","archived":false,"fork":false,"pushed_at":"2025-08-04T02:38:14.000Z","size":7931,"stargazers_count":23,"open_issues_count":3,"forks_count":16,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-08-21T05:08:41.180Z","etag":null,"topics":["batch-job","batch-processing","corb","corb-jobs","java","javascript-modules","marklogic","xcc","xquery"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marklogic-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-07-03T04:32:27.000Z","updated_at":"2025-08-13T11:12:08.000Z","dependencies_parsed_at":"2023-10-02T23:09:13.880Z","dependency_job_id":"e8036077-3044-40b9-9d39-44303b1bd21d","html_url":"https://github.com/marklogic-community/corb2","commit_stats":null,"previous_names":["marklogic/corb2"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/marklogic-community/corb2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic-community%2Fcorb2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic-community%2Fcorb2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic-community%2Fcorb2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic-community%2Fcorb2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marklogic-community","download_url":"https://codeload.github.com/marklogic-community/corb2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marklogic-community%2Fcorb2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch-job","batch-processing","corb","corb-jobs","java","javascript-modules","marklogic","xcc","xquery"],"created_at":"2026-01-17T10:00:23.000Z","updated_at":"2026-01-17T10:00:43.831Z","avatar_url":"https://github.com/marklogic-community.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central - download the latest version](https://maven-badges.herokuapp.com/maven-central/com.marklogic/marklogic-corb/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.marklogic/marklogic-corb)\n[![Codecov code coverage](https://codecov.io/gh/marklogic-community/corb2/branch/development/graph/badge.svg)](https://codecov.io/gh/marklogic-community/corb2/branch/development)\n[![Snyk Known Vulnerabilities Badge](https://snyk.io/test/github/marklogic-community/corb2/badge.svg)](https://snyk.io/test/github/marklogic-community/corb2)\n\n### [What is CoRB?](https://github.com/marklogic-community/corb2/wiki#what-is-corb)\nCoRB is a Java tool designed for bulk content-reprocessing of documents stored in [MarkLogic](http://www.marklogic.com/). \nCoRB stands for **Co**ntent **R**eprocessing in **B**ulk and is a multi-threaded workhorse tool at your disposal.\nIn a nutshell, CoRB works off a list of documents in a database and performs operations against those documents. \nCoRB operations can include generating a report across all documents, manipulating the individual documents, or a combination thereof. \n\n### User Guide\nThis document and the [wiki](https://github.com/marklogic-community/corb2/wiki) provide a comprehensive overview of CoRB and the options available to customize the execution of a CoRB job, as well as the [ModuleExecutor Tool](#moduleexecutor-tool), which can be used to execute a single (XQuery or JavaScript) module in MarkLogic.\n\nFor additional information, refer to the [CoRB Wiki](https://github.com/marklogic-community/corb2/wiki).\n\n### Downloads\nDownload the latest release directly from https://github.com/marklogic-community/corb2/releases or resolve dependencies through [Maven Central](http://mvnrepository.com/artifact/com.marklogic/marklogic-corb).\n\n### Compatability \n-  [CoRB v2.4.0](https://github.com/marklogic-community/corb2/releases/tag/2.4.0) (or later) requires Java 8 (or later) to run.\n-  [CoRB v2.3.2](https://github.com/marklogic-community/corb2/releases/tag/2.3.2) is the last release compatable with Java 7 and 6.\n-  [CoRB v2.2.0](https://github.com/marklogic-community/corb2/releases/tag/2.2.0) (or later) requires [marklogic-xcc 8.0.* (or later)](https://developer.marklogic.com/products/xcc) to run.\n  \u003e Note: marklogic-xcc 8 is backwards compatible to MarkLogic 5 and runs on Java 1.6 or later.\n\n### Getting Help\nTo get help with CoRB\n- [Post a question to Stack Overflow](http://stackoverflow.com/questions/ask?tags=marklogic+corb) with the [\u003ccode\u003emarkogic\u003c/code\u003e](https://stackoverflow.com/questions/tagged/marklogic) and [\u003ccode\u003ecorb\u003c/code\u003e](https://stackoverflow.com/questions/tagged/corb) tags.  \n- Submit issues or feature requests at https://github.com/marklogic-community/corb2/issues\n\n### [Running CoRB](https://github.com/marklogic-community/corb2/wiki/Running-CoRB)\nThe entry point is the main method in the `com.marklogic.developer.corb.Manager` class. CoRB requires the MarkLogic XCC JAR in the classpath,\npreferably the version that corresponds to the MarkLogic server version, which can be downloaded from https://developer.marklogic.com/products/xcc.\n Use Java 1.8 or later.\n\nCoRB needs options specified through one or more of the following mechanisms:\n\n1. command-line parameters\n2. Java system properties ex: `-DXCC-CONNECTION-URI=xcc://user:password@localhost:8202`\n3. As properties file in the class path specified using `-DOPTIONS-FILE=myjob.properties`. Relative and full file system paths are also supported.\n\nIf specified in more than one place, a command line parameter takes precedence over a Java system property, which take precedence over a property from the **OPTIONS-FILE** properties file.\n\n\u003e Note: Any or all of the properties can be specified as Java system properties or key value pairs in properties file.\n\n\u003e Note: CoRB exit codes `0` - successful, `0` - nothing to process (ref: EXIT-CODE-NO-URIS), `1` - initialization or connection error and `2` - execution error\n\n\u003e Note: CoRB now supports [Logging Job Metrics](METRICS.md) back to the MarkLogic database log and/or as document in the database.\n\n### Options\nOption | Description\n---|---\n**\u003ca name=\"INIT-MODULE\"\u003e\u003c/a\u003eINIT-MODULE** | An XQuery or JavaScript module which, if specified, will be invoked prior to **URIS-MODULE**. XQuery and JavaScript modules need to have `.xqy` and `.sjs` extensions respectively.\n**\u003ca name=\"INIT-TASK\"\u003e\u003c/a\u003eINIT-TASK** | Java Task which, if specified, will be called prior to **URIS-MODULE**. This can be used addition to **INIT-MODULE** for custom implementations.\n**\u003ca name=\"OPTIONS-FILE\"\u003e\u003c/a\u003eOPTIONS-FILE** | A properties file containing any of the CoRB options. Relative and full file system paths are supported.\n**\u003ca name=\"OPTIONS-FILE-ENCODING\"\u003e\u003c/a\u003eOPTIONS-FILE-ENCODING** | Specifies the character encoding of the **OPTIONS-FILE**. Otherwise, the system default will be used.\n**\u003ca name=\"PROCESS-MODULE\"\u003e\u003c/a\u003ePROCESS-MODULE** | XQuery or JavaScript to be executed in a batch for each URI from the **URIS-MODULE** or **URIS-FILE**. Module is expected to have at least one external or global variable with name URI. XQuery and JavaScript modules need to have `.xqy` and `.sjs` extensions respectively. If returning multiple values from a JavaScript module, values must be returned as Sequence.\n**\u003ca name=\"PROCESS-TASK\"\u003e\u003c/a\u003ePROCESS-TASK** | \u003cdiv\u003eJava Class that implements `com.marklogic.developer.corb.Task` or extends `com.marklogic.developer.corb.AbstractTask`. Typically, it can talk to **PROCESS-MODULE** and the do additional processing locally such save a returned value.  \u003cul\u003e\u003cli\u003e `com.marklogic.developer.corb.ExportBatchToFileTask` Generates _**a single file**_, typically used for reports. Writes the data returned by the **PROCESS-MODULE** to a single file specified by **EXPORT-FILE-NAME**. All returned values from entire CoRB will be streamed into the single file. If **EXPORT-FILE-NAME** is not specified, CoRB uses **URIS\\_BATCH\\_REF** returned by **URIS-MODULE** as the file name.  \u003cli\u003e `com.marklogic.developer.corb.ExportToFileTask` Generates _**multiple files**_. Saves the documents returned by each invocation of **PROCESS-MODULE** to a separate local file within **EXPORT-FILE-DIR** where the file name for each document will be the based on the URI.\u003c/ul\u003e\n**\u003ca name=\"PRE-BATCH-MODULE\"\u003e\u003c/a\u003ePRE-BATCH-MODULE** | An XQuery or JavaScript module which, if specified, will be run before batch processing starts. XQuery and JavaScript modules need to have `.xqy` and `.sjs` extensions respectively.\n**\u003ca name=\"PRE-BATCH-TASK\"\u003e\u003c/a\u003ePRE-BATCH-TASK** | Java Class that implements `com.marklogic.developer.corb.Task` or extends `com.marklogic.developer.corb.AbstractTask`. If **PRE-BATCH-MODULE** is also specified, the implementation is expected to invoke the XQuery and process the result if any. It can also be specified without **PRE-BATCH-MODULE** and an example of this is to add a static header to a report. \u003cul\u003e\u003cli\u003e `com.marklogic.developer.corb.PreBatchUpdateFileTask` included - Writes the data returned by the **PRE-BATCH-MODULE** to **EXPORT-FILE-NAME**, which can particularly be used to to write dynamic headers for CSV output. Also, if **EXPORT-FILE-TOP-CONTENT** is specified, this task will write this value to the **EXPORT-FILE-NAME** - this option is especially useful for writing fixed headers to reports. If **EXPORT-FILE-NAME** is not specified, CoRB uses **URIS\\_BATCH\\_REF** returned by **URIS-MODULE** as the file name.\u003c/li\u003e\u003cul\u003e\n**\u003ca name=\"POST-BATCH-MODULE\"\u003e\u003c/a\u003ePOST-BATCH-MODULE** | An XQuery or JavaScript module which, if specified, will be run after batch processing is completed. XQuery and JavaScript modules need to have `.xqy` and `.sjs` extensions respectively.\n**\u003ca name=\"POST-BATCH-TASK\"\u003e\u003c/a\u003ePOST-BATCH-TASK** | Java Class that implements `com.marklogic.developer.corb.Task` or extends `com.marklogic.developer.corb.AbstractTask`. If **POST-BATCH-MODULE** is also specified, the implementation is expected to invoke the XQuery and process the result if any. It can also be specified without **POST-BATCH-MODULE** and an example of this is to add static content to the bottom of the report. \u003cul\u003e\u003cli\u003e `com.marklogic.developer.corb.PostBatchUpdateFileTask` included - Writes the data returned by the **POST-BATCH-MODULE** to **EXPORT-FILE-NAME**. Also, if **EXPORT-FILE-BOTTOM-CONTENT** is specified, this task will write this value to the **EXPORT-FILE-NAME**. If **EXPORT-FILE-NAME** is not specified, CoRB uses **URIS\\_BATCH\\_REF** returned by **URIS-MODULE** as the file name.\u003c/li\u003e\u003c/ul\u003e\n**\u003ca name=\"THREAD-COUNT\"\u003e\u003c/a\u003eTHREAD-COUNT** | The number of worker threads. Default is `1`.\n**\u003ca name=\"URIS-MODULE\"\u003e\u003c/a\u003eURIS-MODULE** | URI selector module written in XQuery or JavaScript. Expected to return a sequence containing the uris count, followed by all the uris. Optionally, it can also return an arbitrary string as a first item in this sequence - refer to **URIS\\_BATCH\\_REF** section below. XQuery and JavaScript modules need to have .xqy and .sjs extensions respectively. JavaScript modules must return a [Sequence](https://docs.marklogic.com/js/Sequence).\n**\u003ca name=\"URIS-FILE\"\u003e\u003c/a\u003eURIS-FILE** | If defined instead of **URIS-MODULE**, URIs will be loaded from the file located on the client. There should only be one URI per line. This path may be relative or absolute. For example, a file containing a list of document identifiers can be used as a **URIS-FILE** and the **PROCESS-MODULE** can query for the document based on this document identifier.\n**\u003ca name=\"XCC-CONNECTION-URI\"\u003e\u003c/a\u003eXCC-CONNECTION-URI** | Connection string to MarkLogic XDBC Server. Multiple connection strings can be specified with comma as a separator. \n\n### Additional options\nOption | Description\n---|---\n**\u003ca name=\"BATCH-SIZE\"\u003e\u003c/a\u003eBATCH-SIZE** | The number of URIs to be executed in single transform. Default is `1`. If more than 1, **PROCESS-MODULE** will receive a delimited string as the `$URI` variable, which needs to be tokenized to get individual URIs. The default delimiter is `;`, which can be overridden with the option **BATCH-URI-DELIM** described below. \u003cbr/\u003e**Sample code for transform:**\u003cbr/\u003e`declare variable URI as xs:string external;`\u003cbr/\u003e`let $all-uris := fn:tokenize($URI,\";\")`  \n**\u003ca name=\"BATCH-URI-DELIM\"\u003e\u003c/a\u003eBATCH-URI-DELIM** | Use if the default delimiter `';'` cannot be used to join multiple URIS when **BATCH-SIZE** is greater than 1. Default is `;`.\n**\u003ca name=\"DECRYPTER\"\u003e\u003c/a\u003eDECRYPTER** | The class name of the options value dycrypter, which must implement `com.marklogic.developer.corb.Decrypter`. Encryptable options include **XCC-CONNECTION-URI**, **XCC-USERNAME**, **XCC-PASSWORD**, **XCC-HOSTNAME**, **XCC-PORT**, and **XCC-DBNAME**.\n**\u003ca name=\"COLLECTION-NAME\"\u003e\u003c/a\u003eCOLLECTION-NAME** | Value of this parameter will be passed into the URIS-MODULE via external or global variable with the name URIS.\n**\u003ca name=\"COMMAND\"\u003e\u003c/a\u003eCOMMAND** | Pause, resume, and stop the execution of CoRB. Possible commands include: PAUSE, RESUME, and STOP. If the **COMMAND-FILE** is modified and either there is no **COMMAND** or an invalid value is specified, then execution will RESUME.\n**\u003ca name=\"COMMAND-FILE\"\u003e\u003c/a\u003eCOMMAND-FILE** | A properties file used to configure **COMMAND** and **THREAD-COUNT** while CoRB is running. For instance, to temporarily pause execution, or to lower the number of threads in order to throttle execution.\n**\u003ca name=\"COMMAND-FILE-POLL-INTERVAL\"\u003e\u003c/a\u003eCOMMAND-FILE-POLL-INTERVAL** | The regular interval (seconds) in which the existence of the **COMMAND-FILE** is tested can be controlled by using this property. Default is `1`.\n**\u003ca name=\"CONNECTION-POLICY\"\u003e\u003c/a\u003eCONNECTION-POLICY** | Algorithm for balancing load across multiple hosts used by `com.marklogic.developer.corb.DefaultContentSourcePool`. Options include **ROUND-ROBIN**, **RANDOM** and **LOAD**. Default option is **ROUND-ROBIN**. **LOAD** option returns the ContentSource or Connection with least number of active sessions.  \n**\u003ca name=\"CONTENT-SOURCE-POOL\"\u003e\u003c/a\u003eCONTENT-SOURCE-POOL** | Class that implements `com.marklogic.developer.corb.ContentSourcePool` and used to manage ContentSource instances or connections. Default is `com.marklogic.developer.corb.DefaultContentSourcePool`.\n**\u003ca name=\"CONTENT-SOURCE-RENEW\"\u003e\u003c/a\u003eCONTENT-SOURCE-RENEW** | Boolean value indicating whether to periodically check to see if a ContentSource resolves to a different IP address and create a new ContentSource to add to the resource pool. This can help transparently deal with proxies that have dynamic pools of IP addresses. Default is `true`\n**\u003ca name=\"CONTENT-SOURCE-RENEW-INTERVAL\"\u003e\u003c/a\u003eCONTENT-SOURCE-RENEW-INTERVAL** | The regular interval (seconds) in which to resolve ContentSource IP address and add to the pool. This can help when a DNS entry may return multiple IP addresses and help spread traffic among multiple endpoints. Default is `60`\n**\u003ca name=\"DISK-QUEUE\"\u003e\u003c/a\u003eDISK-QUEUE** | Boolean value indicating whether the CoRB job should spill to disk when a maximum number of URIs have been loaded in memory, in order to control memory consumption and avoid Out of Memory exceptions for extremely large sets of URIs.\n**\u003ca name=\"DISK-QUEUE-MAX-IN-MEMORY-SIZE\"\u003e\u003c/a\u003eDISK-QUEUE-MAX-IN-MEMORY-SIZE** | The maximum number of URIs to hold in memory before spilling over to disk. Default is `1000`.\n**\u003ca name=\"DISK-QUEUE-TEMP-DIR\"\u003e\u003c/a\u003eDISK-QUEUE-TEMP-DIR** | The directory where the URIs queue can write to disk when the maximum in-memory items has been exceeded. If not specified then **TEMP-DIR** value will be used. If neither are specified, then the default behavior is to use java.io.tmpdir.\n**\u003ca name=\"ERROR-FILE-NAME\"\u003e\u003c/a\u003eERROR-FILE-NAME** | Used when FAIL-ON-ERROR is false. If specified true, removes duplicates from the errored URIs along with error messages will be written to this file. Uses BATCH-URI-DELIM or default `';'` to separate URI and error message.\n**\u003ca name=\"EXIT-CODE-IGNORED-ERRORS\"\u003e\u003c/a\u003eEXIT-CODE-IGNORED-ERRORS** | Returns this exit code when there were errors and **FAIL-ON-ERROR**=`false`. Default is `0`.\n**\u003ca name=\"EXIT-CODE-NO-URIS\"\u003e\u003c/a\u003eEXIT-CODE-NO-URIS** | Returns this exit code when there is nothing to process. Default is `0`. \n**\u003ca name=\"XPORT_FILE_AS_ZIP\"\u003e\u003c/a\u003eEXPORT_FILE_AS_ZIP** | If true, PostBatchUpdateFileTask compresses the output file as a zip file.\n**\u003ca name=\"EXPORT-FILE-BOTTOM-CONTENT\"\u003e\u003c/a\u003eEXPORT-FILE-BOTTOM-CONTENT** | Used by `com.marklogic.developer.corb.PostBatchUpdateFileTask` to append content to **EXPORT-FILE-NAME** after batch process is complete.\n**\u003ca name=\"EXPORT-FILE-DIR\"\u003e\u003c/a\u003eEXPORT-FILE-DIR** | Export directory parameter is used by `com.marklogic.developer.corb.ExportBatchToFileTask` or similar custom task implementations. \u003cbr/\u003eOptional: Alternatively, **EXPORT-FILE-NAME** can be specified with a full path.\n**\u003ca name=\"EXPORT-FILE-NAME\"\u003e\u003c/a\u003eEXPORT-FILE-NAME** | Shared file to write output of `com.marklogic.developer.corb.ExportBatchToFileTask` - should be a file name with our without full path. \u003cul\u003e\u003cli\u003e**EXPORT-FILE-DIR** Is not required if a full path is used.\u003c/li\u003e\u003cli\u003eIf **EXPORT-FILE-NAME** is not specified, CoRB attempts to use **URIS\\_BATCH\\_REF** as the file name and this is especially useful in case of automated jobs where file name can only be determined by the **URIS-MODULE** - refer to **URIS\\_BATCH\\_REF** section below.\u003c/li\u003e\u003c/ul\u003e\n**\u003ca name=\"EXPORT-FILE-PART-EXT\"\u003e\u003c/a\u003eEXPORT-FILE-PART-EXT** | The file extension for export files being processed. ex: .tmp - if specified, `com.marklogic.developer.corb.PreBatchUpdateFileTask` adds this temporary extension to the export file name to indicate **EXPORT-FILE-NAME** is being actively modified. To remove this temporary extension after **EXPORT-FILE-NAME** is complete, `com.marklogic.developer.corb.PostBatchUpdateFileTask` must be specified as **POST-BATCH-TASK**.\n**\u003ca name=\"EXPORT-FILE-REQUIRE-PROCESS-MODULE\"\u003e\u003c/a\u003eEXPORT-FILE-REQUIRE-PROCESS-MODULE** | Boolean value indicating whether or not to require a **PROCESS-MODULE** when an Export*ToFile PROCESS-TASK is specified. This can help avoid confusion when the **PROCESS-MODULE** was accidentally not configured and no files are generated. Default is `true`\n**\u003ca name=\"EXPORT-FILE-SORT\"\u003e\u003c/a\u003eEXPORT-FILE-SORT** | If `ascending` or `descending`, lines will be sorted. If \u003ccode\u003e\u0026#124;distinct\u003c/code\u003e is specified after the sort direction, duplicate lines from **EXPORT-FILE-NAME** will be removed. i.e. \u003ccode\u003eascending\u0026#124;distinct\u003c/code\u003e or \u003ccode\u003edescending\u0026#124;distinct\u003c/code\u003e\n**\u003ca name=\"EXPORT-FILE-SORT-COMPARATOR\"\u003e\u003c/a\u003eEXPORT-FILE-SORT-COMPARATOR** | A java class that must implement `java.util.Comparator`. If specified, CoRB will use this class for sorting in place of ascending or descending string comparator even if a value was specified for **EXPORT-FILE-SORT**.\n**\u003ca name=\"EXPORT-FILE-TOP-CONTENT\"\u003e\u003c/a\u003eEXPORT-FILE-TOP-CONTENT** | Used by `com.marklogic.developer.corb.PreBatchUpdateFileTask` to insert content at the top of **EXPORT-FILE-NAME** before batch process starts. If it includes the string `@URIS_BATCH_REF`, it is replaced by the batch reference returned by **URIS-MODULE**.\n**\u003ca name=\"EXPORT-FILE-URI-TO-PATH\"\u003e\u003c/a\u003eEXPORT-FILE-URI-TO-PATH** | Boolean value indicating whether to convert doc URI to a filepath. Default is `true`\n**\u003ca name=\"FAIL-ON-ERROR\"\u003e\u003c/a\u003eFAIL-ON-ERROR** | Boolean value indicating whether the CoRB job should fail and exit if a process module throws an error. Default is `true`. This option will not handle repeated connection failures.\n**\u003ca name=\"INSTALL\"\u003e\u003c/a\u003eINSTALL** | Whether to install the Modules in the Modules database. Specify `true` or `1` for installation. Default is `false`.\n**\u003ca name=\"LOADER-BASE64-ENCODE\"\u003e\u003c/a\u003eLOADER-BASE64-ENCODE** | Boolean option specifying whether the content loaded by FileUrisStreamingXMLLoader or FileUrisXMLLoader (with the option `LOADER-USE-ENVELOPE=true`) should be base64 encoded, or appended as the child of the `/corb-loader/content` element. Default is `false`.\n**\u003ca name=\"LOADER-PATH\"\u003e\u003c/a\u003eLOADER-PATH** | The path to the resource (file or folder) that will be the input source for a loader class that extends AbstractFileUrisLoader, such as FileUrisDirectoryLoader, FileUrisLoader, FileUrisStreamingXmlLoader, FileUrisXmlLoader, and FileUrisZipLoader\n**\u003ca name=\"LOADER-SET-URIS-BATCH-REF\"\u003e\u003c/a\u003eLOADER-SET-URIS-BATCH-REF** | Boolean option indicating whether a file loader should set the [URIS_BATCH_REF](https://github.com/marklogic-community/corb2#uris_batch_ref). Default is `false`.\n**\u003ca name=\"LOADER-USE-ENVELOPE\"\u003e\u003c/a\u003eLOADER-USE-ENVELOPE** | Boolean value indicating whether FileUris loaders should use an XML envelope, in order to send file metadata in addition to the file content.\n**\u003ca name=\"JOB-NAME\"\u003e\u003c/a\u003eJOB-NAME** | Name of the current Job.\n**\u003ca name=\"JOB-SERVER-PORT\"\u003e\u003c/a\u003eJOB-SERVER-PORT** | Optional port number to start a lightweight HTTP server which can be used to monitor, change the number of threads, and pause/resume the CoRB job. Port number must be a valid port(s) or a valid range of ports.  \u003cul\u003e\u003cli\u003eEx: 9080\u003c/li\u003e\u003cli\u003e Ex: 9080,9083,9087\u003c/li\u003e\u003cli\u003e Ex: 9080-9090\u003c/li\u003e\u003cli\u003e Ex: 9080-9083,9085-9090\u003c/li\u003e\u003c/ul\u003e  The job server will bind to a port from the configured port number(s). By default, if the **JOB-SERVER-PORT** option is not specified, a job server is not started. \u003cp\u003e When a port is specified and available, the job server URL will be logged to the console with both the UI `http://\u003chost\u003e:\u003cport\u003e` and metrics URL `http://\u003chost\u003e:\u003cport\u003e/metrics`. (grep for string _com.marklogic.developer.corb.JobServer logUsage_)  \u003cp\u003eThe metrics URL supports the following parameters:\u003cul\u003e\u003cli\u003e**COMMAND**=pause (or resume). \u003c/li\u003e\u003cli\u003e**CONCISE**=true limits the amound of data returned\u003c/li\u003e\u003cli\u003e**FORMAT**=json (or xml) returns job stats in the requested format\u003c/li\u003e\u003cli\u003e**THREAD-COUNT**=\u003c#\u003e will adjust the number of threads for the executing job\u003c/li\u003e\u003c/ul\u003e  \n**\u003ca name=\"MAX-OPTS-FROM-MODULE\"\u003e\u003c/a\u003eMAX-OPTS-FROM-MODULE** | Maximum number of custom inputs from the **URIS-MODULE** to other modules. Default is `10`.\n**\u003ca name=\"METADATA\"\u003e\u003c/a\u003eMETADATA** | The variable name that needs to be defined in the server side query to use the metadata set by the **URIS-LOADER**.\n**\u003ca name=\"METADATA-TO-PROCESS-MODULE\"\u003e\u003c/a\u003eMETADATA-TO-PROCESS-MODULE** | If this option is set to true, **XML-METADATA** is set as an external variable with name **METADATA** to **PROCESS-MODULE** as well. Default is `false`.\n**\u003ca name=\"METRICS-COLLECTIONS\"\u003e\u003c/a\u003eMETRICS-COLLECTIONS** | Adds the metrics document to the specified collection.|\n**\u003ca name=\"METRICS-DATABASE\"\u003e\u003c/a\u003eMETRICS-DATABASE** | Uses the value provided to save the metrics document to the specified Database. The XCC connection specified should have the following privilege `http://marklogic.com/xdmp/privileges/xdmp-invoke`|\n**\u003ca name=\"METRICS-LOG-LEVEL\"\u003e\u003c/a\u003eMETRICS-LOG-LEVEL**|String value indicating the log level that the CoRB job should use to log metrics to ML Server Error log. Possible values are _none, emergency, alert, critical, error, warning, notice, info, config, debug, fine, finer, finest_. Default is `none`, which means metrics are not logged.|\n**\u003ca name=\"METRICS-MODULE\"\u003e\u003c/a\u003eMETRICS-MODULE** | XQuery or JavaScript to be executed at the end of the CoRB Job to save the metrics document to the database. There is an XQuery module ([save-metrics.xqy](src/main/resources/save-metrics.xqy)) and a JavaScript module ([saveMetrics.sjs](src/main/resources/saveMetrics.sjs)) provided. You can use these modules as a template to customize the the metrics document saved to the database. XQuery and JavaScript modules need to have '{@code .xqy}' and{@code .sjs} extensions respectively.|\n**\u003ca name=\"METRICS-NUM-FAILED-TRANSACTIONS\"\u003e\u003c/a\u003eMETRICS-NUM-FAILED-TRANSACTIONS** | Maximum number of failed transaction to be logged in the metrics. Default is `0`.\n**\u003ca name=\"METRICS-NUM-SLOW-TRANSACTIONS\"\u003e\u003c/a\u003eMETRICS-NUM-SLOW-TRANSACTIONS** | Maximum number of slow transaction to be logged in the metrics. Default is `0`.\n**\u003ca name=\"METRICS-ROOT\"\u003e\u003c/a\u003eMETRICS-ROOT** | Uses the value provided to as the URI Root for saving the metrics document.|\n**\u003ca name=\"METRICS-SYC-FREQUENCY\"\u003e\u003c/a\u003eMETRICS-SYNC-FREQUENCY** | Frequency (in seconds) at which the metrics document needs to be updated in the database. By default the metrics document is not periodically updated and is only written once at the end of the job. |\n**\u003ca name=\"MODULE-ROOT\"\u003e\u003c/a\u003eMODULE-ROOT** | Default is `/`.\n**\u003ca name=\"MODULES-DATABASE\"\u003e\u003c/a\u003eMODULES-DATABASE** | Uses the **XCC-CONNECTION-URI** if not provided; use 0 for file system.\n**\u003ca name=\"NUM-TPS-FOR-ETC\"\u003e\u003c/a\u003eNUM-TPS-FOR-ETC** | Number of recent transactions per second (tps) values used to calculate estimated completion time (ETC). Default is `10`.\n**\u003ca name=\"POST-BATCH-MINIMUM-COUNT\"\u003e\u003c/a\u003ePOST-BATCH-MINIMUM-COUNT** | The minimum number of results that must be returned for the **POST-BATCH-MODULE** or **POST-BATCH-TASK** to be executed. Default is `1`.\n**\u003ca name=\"PRE-POST-BATCH-ALWAYS-EXECUTE\"\u003e\u003c/a\u003ePRE-POST-BATCH-ALWAYS-EXECUTE** | Boolean value indicating whether the PRE_BATCH and POST_BATCH module or task should be executed without evaluating how many URIs were returned by the URI selector.\n**\u003ca name=\"PRE-BATCH-MINIMUM-COUNT\"\u003e\u003c/a\u003ePRE-BATCH-MINIMUM-COUNT** | The minimum number of results that must be returned for the **PRE-BATCH-MODULE** or **PRE-BATCH-TASK** to be executed. Default is `1`.\n**\u003ca name=\"QUERY-RETRY-LIMIT\"\u003e\u003c/a\u003eQUERY-RETRY-LIMIT** | Number of re-query attempts before giving up. Default is `2`.\n**\u003ca name=\"QUERY-RETRY-INTERVAL\"\u003e\u003c/a\u003eQUERY-RETRY-INTERVAL** | Time interval, in seconds, between re-query attempts. Default is `20`.\n**\u003ca name=\"QUERY-RETRY-ERROR-CODES\"\u003e\u003c/a\u003eQUERY-RETRY-ERROR-CODES** | A comma separated list of MarkLogic error codes for which a QueryException should be retried.\n**\u003ca name=\"QUERY-RETRY-ERROR-MESSAGE\"\u003e\u003c/a\u003eQUERY-RETRY-ERROR-MESSAGE** | A comma separated list of values that if contained in an exception message a QueryException should be retried.\n**\u003ca name=\"SSL-CONFIG-CLASS\"\u003e\u003c/a\u003eSSL-CONFIG-CLASS** | A java class that must implement `com.marklogic.developer.corb.SSLConfig`. If not specified, CoRB defaults to `com.marklogic.developer.corb.TrustAnyoneSSLConfig` for `xccs` connections.\n**\u003ca name=\"URIS-LOADER\"\u003e\u003c/a\u003eURIS-LOADER** | Java class that implements `com.marklogic.developer.corb.UrisLoader`. A custom class to load URIs instead of built-in loaders for **URIS-MODULE** or **URIS-FILE** options. Example: com.marklogic.developer.corb.FileUrisXMLLoader\n**\u003ca name=\"URIS-REDACTED\"\u003e\u003c/a\u003eURIS-REDACTED** | Optional boolean flag indicating whether URIs should be excluded from logging, console, and JobStats metrics. Default is `false`.\n**\u003ca name=\"URIS-REPLACE-PATTERN\"\u003e\u003c/a\u003eURIS-REPLACE-PATTERN** | One or more replace patterns for URIs - Used by java to truncate the length of URIs on the client side, typically to reduce java heap size in very large batch jobs, as the CoRB java client holds all the URIS in memory while processing is in progress. If truncated, PROCESS-MODULE needs to reconstruct the URI before trying to do `fn:doc()` to fetch the document. \u003cbr/\u003eUsage: `URIS-REPLACE-PATTERN=pattern1,replace1,pattern2,replace2,...)`\u003cbr/\u003e**Example:**\u003cbr/\u003e`URIS-REPLACE-PATTERN=/com/marklogic/sample/,,.xml,` - Replace /com/marklogic/sample/ and .xml with empty strings. So, CoRB client only needs to cache the id '1234' instead of the entire URI /com/marklogic/sample/1234.xml. In the transform **PROCESS-MODULE**, we need to do `let $URI := fn:concat(\"/com/marklogic/sample/\",$URI,\".xml\")`\n**\u003ca name=\"XCC-API-KEY\"\u003e\u003c/a\u003eXCC-API-KEY** | The unique key assigned to a MarkLogic Cloud user.\n**\u003ca name=\"XCC-BASE-PATH\"\u003e\u003c/a\u003eXCC-BASE-PATH** | The base path configured on MarkLogic Cloud which maps to a service hosted by MarkLogic Cloud through which operations run.\n**\u003ca name=\"XCC-CONNECTION-RETRY-LIMIT\"\u003e\u003c/a\u003eXCC-CONNECTION-RETRY-LIMIT** | Number attempts to connect to ML before giving up. Default is `3`.\n**\u003ca name=\"XCC-CONNECTION-RETRY-INTERVAL\"\u003e\u003c/a\u003eXCC-CONNECTION-RETRY-INTERVAL** | Time interval, in seconds, between retry attempts. Default is `60`.\n**\u003ca name=\"XCC-CONNECTION-HOST-RETRY-LIMIT\"\u003e\u003c/a\u003eXCC-CONNECTION-HOST-RETRY-LIMIT** | Number of attempts to connect to ML before giving up on a host. If not specified, it defaults to **XCC-CONNECTION-RETRY-LIMIT**\n**\u003ca name=\"XCC-DBNAME\"\u003e\u003c/a\u003eXCC-DBNAME** | (Optional) Name of the content database to execute against\n**\u003ca name=\"XCC-GRANT-TYPE\"\u003e\u003c/a\u003eXCC-GRANT-TYPE** | MarkLogic Cloud grant type. \n**\u003ca name=\"XCC-HOSTNAME\"\u003e\u003c/a\u003eXCC-HOSTNAME** | Required if **XCC-CONNECTION-URI** is not specified. Multiple host can be specified with comma as a separator. \n**\u003ca name=\"XCC-HTTPCOMPLIANT\"\u003e\u003c/a\u003eXCC-HTTPCOMPLIANT** | Optional boolean flag to indicate whether to enable HTTP 1.1 compliance in XCC. If this option is set, the [`xcc.httpcompliant`](https://docs.marklogic.com/guide/xcc/concepts#id_28335) System property will be set. Default is `true`.\n**\u003ca name=\"XCC-OAUTH-TOKEN\"\u003e\u003c/a\u003eXCC-OAUTH-TOKEN** | OAuth JWT access token.\n**\u003ca name=\"XCC-PASSWORD\"\u003e\u003c/a\u003eXCC-PASSWORD** | Required if **XCC-CONNECTION-URI** is not specified.\n**\u003ca name=\"XCC-PORT\"\u003e\u003c/a\u003eXCC-PORT** | Required if **XCC-CONNECTION-URI** is not specified.\n**\u003ca name=\"XCC-PROTOCOL\"\u003e\u003c/a\u003eXCC-PROTOCOL** | (optional) Used if XCC-CONNECTION-URI is not specified. The XCC scheme to use; either `xcc` or `xccs`. Default is `xcc`.\n**\u003ca name=\"XCC-TIME-ZONE\"\u003e\u003c/a\u003eXCC-TIME-ZONE** | The ID for the TimeZone that should be set on XCC RequestOption. When a value is specified, it is parsed using [`TimeZone.getTimeZone()`](https://docs.oracle.com/javase/8/docs/api/java/util/TimeZone.html#getTimeZone-java.lang.String-) and set on XCC RequestOption for each Task. Invalid ID values will produce the GMT TimeZone. If not specified, XCC uses the JVM default TimeZone.\n**\u003ca name=\"XCC-TOKEN-DURATION\"\u003e\u003c/a\u003eXCC-TOKEN-DURATION** | MarkLogic Cloud token duration.\n**\u003ca name=\"XCC-TOKEN-ENDPOINT\"\u003e\u003c/a\u003eXCC-TOKEN-ENDPOINT** | MarkLogic Cloud token endpoint.\n**\u003ca name=\"XCC-URL-ENCODE-COMPONENTS\"\u003e\u003c/a\u003eXCC-URL-ENCODE-COMPONENTS** | Indicate whether or not the XCC connection string components should be URL encoded. Possible values are `always`, `never`, and `auto`. Default is `auto`.\n**\u003ca name=\"XCC-USERNAME\"\u003e\u003c/a\u003eXCC-USERNAME** | Required if **XCC-CONNECTION-URI** is not specified.\n**\u003ca name=\"XML-FILE\"\u003e\u003c/a\u003eXML-FILE** | In order to use this option a class `com.marklogic.developer.corb.FileUrisXMLLoader` has to be specified in the **URIS-LOADER** option. If defined instead of **URIS-MODULE**, XML nodes will be used as URIs from the file located on the client. The file path may be relative or absolute. Default processing will select all of the child elements of the document element (i.e. `/*/*`). The **XML-NODE** option can be specified with an XPath to address a different set of nodes.\n**\u003ca name=\"XML-METADATA\"\u003e\u003c/a\u003eXML-METADATA** | An XPath to address the node that contains metadata portion of the XML. This must be different from the **XML-NODE**. The metadata is set as an external variable with name **METADATA** to **PRE-BATCH-MODULE** and **POST-BATCH-MODULE** and also **PROCESS-MODULE** if enabled by **METADATA-TO-PROCESS-MODULE**.\n**\u003ca name=\"XML-NODE\"\u003e\u003c/a\u003eXML-NODE** | An XPath to address the nodes to be returned in an **XML-FILE** by the `com.marklogic.developer.corb.FileUrisXMLLoader`. For example, a file containing a list of nodes wrapped by a parent element can be used as a **XML-FILE** and the **PROCESS-MODULE** can unquote the URI string as node to do further processing with the node. If not specified, the default behavior is to select the child elements of the document element (i.e. `/*/*`)\n**\u003ca name=\"XML-SCHEMA\"\u003e\u003c/a\u003eXML-SCHEMA** | Path to a W3C XML Schema to be used by `com.marklogic.developer.corb.FileUrisStreamingXMLLoader` or `com.marklogic.developer.corb.FileUrisXMLLoader` to validate an **XML-FILE**, and used by `com.marklogic.developer.corb.SchemaValidateBatchToFileTask` and `com.marklogic.corb.SchemaValidateToFileTask` post-process tasks to validate documents returned from a process module.\n**\u003ca name=\"XML-SCHEMA-HONOUR-ALL-SCHEMALOCATIONS\"\u003e\u003c/a\u003eXML-SCHEMA-HONOUR-ALL-SCHEMALOCATIONS** | Boolean value indicating whether to set the feature [`http://apache.org/xml/features/honour-all-schemaLocations`](https://xerces.apache.org/xerces2-j/features.html#honour-all-schemaLocations). Default is `true`\n**\u003ca name=\"XML-TEMP-DIR\"\u003e\u003c/a\u003eXML-TEMP-DIR** | Temporary directory used by `com.marklogic.developer.corb.FileUrisStreamingXMLLoader` to store files extracted from the **XML-FILE**. If not specified, **TEMP-DIR** value will be used. If neither are specified, then the default Java temp directory will be used.\n\n#### [URIS\\_BATCH\\_REF](https://github.com/marklogic-community/corb2/wiki/URIS_BATCH_REF)\nIf a module, including those specified by **PRE-BATCH-MODULE**, **PROCESS-MODULE** or **POST-BATCH-MODULE** have an external or global variable named **URIS\\_BATCH\\_REF**, the variable will be set to the first **non-numeric** item in the sequence returned by **URIS-MODULE**. This means that, when used, the **URIS-MODULE** must return a sequence with the special string value first, then the URI count, then the sequence of URIs to process.  \n\nAs an example, a batch ref can be a link/id of a document that manages the status of the batch job, where pre-batch module updates the status to start and post-batch module can set it to complete. This example can be used to manage status and errors in automated batch jobs.   \n\nExportBatchToFileTask, PreBatchUpdateFileTask and PostBatchUpdateFileTask use **URIS\\_BATCH\\_REF** as the file name if **EXPORT-FILE-NAME** is not specified. This is useful for automated jobs where name of the output file name can be determined only by the **URIS-MODULE**.  \n\n#### URIS\\_TOTAL\\_COUNT\nTotal count of uris is set as an external variable to **PRE-BATCH-MODULE** and **POST-BATCH-MODULE** (since 2.4.5)\n\n### [Custom Inputs to XQuery or JavaScript Modules](https://github.com/marklogic-community/corb2/wiki/Custom-inputs-to-XQuery-or-JavaScript-modules)\nAny property specified with prefix (with '.') **INIT-MODULE**, **URIS-MODULE**, **PRE-BATCH-MODULE**, **PROCESS-MODULE**, **POST-BATCH-MODULE** will be set as an external variable in the corresponding XQuery module (if that variable is defined as an external string variable in XQuery module). For JavaScript modules the variables need be defined as global variables.  \n\n#### Custom Input Examples:\n- `URIS-MODULE.maxLimit=1000` Expects an external string variable  _maxLimit_ in URIS-MODULE XQuery or global variable for JavaScript.  \n- `PROCESS-MODULE.startDate=2015-01-01` Expects an external string variable _startDate_ in PROCESS-MODULE XQuery or global variable for JavaScript.  \n\nAlternatively, **URIS-MODULE** can pass custom inputs to **PRE-BATCH-MODULE**, **PROCESS-MODULE**, **POST-BATCH-MODULE** by returning one or more of the property values in above format before the count the of URIs. If the **URIS-MODULE** needs **URIS\\_BATCH\\_REF** (above) as well, it needs to be just before the URIs count.  \n\n#### Custom Input From URIS-MODULE Example\n```xquery\nlet $uris := cts:uris()\nreturn (\"PROCESS-MODULE.foo=bar\", \"POST-BATCH-MODULE.alpha=10\", fn:count($uris), $uris)\n```\n\n### [Adhoc Modules](https://github.com/marklogic-community/corb2/wiki/Adhoc-Modules)\nAppending `|ADHOC` to the name or path of a XQuery module (with .xqy extension) or JavaScript (with .sjs or .js extension) module will cause the module to be read from the file system and executed in MarkLogic without being uploaded to Modules database. This simplifies running CoRB jobs by not requiring deployment of any code to MarkLogic, and makes the set of CoRB files and configuration more self contained.   \n\n**INIT-MODULE**, **URIS-MODULE**, **PROCESS-MODULE**, **PRE-BATCH-MODULE** and **POST-BATCH-MODULE** can be specified adhoc by adding the suffix `|ADHOC` for XQuery or JavaScript (with .sjs or .js extension) at the end. Adhoc XQuery or JavaScript remains local to the CoRB and is not deployed to MarkLogic. The XQuery or JavaScript module should be in its named file and that file should be available on the file system, including being on the java classpath for CoRB.\n\n##### Adhoc Examples:\n- `PRE-BATCH-MODULE=adhoc-pre-batch.xqy|ADHOC` adhoc-pre-batch.xqy must be on the classpath or in the current directory.\n- `PROCESS-MODULE=/path/to/file/adhoc-transform-module.xqy|ADHOC` XQuery module file with full path in the file system.  \n- `URIS-MODULE=adhoc-uris.sjs|ADHOC` Adhoc JavaScript module in the classpath or current directory.\n\n#### Inline Adhoc Modules\nIt is also possible to set a module option with inline code blocks, rather than a file path. This can be done by prepending either `INLINE-XQUERY|` or `INLINE-JAVASCRIPT|` to the option value, followed by the XQuery or JavaScript code to execute. Inline code blocks are executed as \"adhoc\" modules and are not uploaded to the Modules database. The `|ADHOC` suffix is optional for inline code blocks.\n\n##### Inline Adhoc Example\n```xquery\nURIS-MODULE=INLINE-XQUERY|xquery version '1.0-ml'; let $uris := cts:uris('', 'document', cts:collection-query('foo')) return (count($uris), $uris)\n```\n### JavaScript Modules\nJavaScript modules are supported and can be used in place of an XQuery module. However, if returning multiple values (ex: URIS-MODULE), values must be returned as a [Sequence](https://docs.marklogic.com/js/Sequence). MarkLogic JavaScript API has helper functions to convert Arrays into Sequence ([`Sequence.from()`](https://docs.marklogic.com/Sequence.from)) and inserting values into another Sequence ([`fn.insertBefore()`](https://docs.marklogic.com/fn.insertBefore)).\n\nJavaScript module must have an `.sjs` file extension when deployed to Modules database. However, adhoc JavaScript modules support both `.sjs` and `.js` file extensions.\n\nFor example, a simple URIS-MODULE may look like this:\n```javascript\nlet uris = cts.uris();\nfn.insertBefore(uris, 0, fn.count(uris));\n```\n\nTo return URIS\\_BATCH\\_REF, we can do the following:\n```javascript\nfn.insertBefore(fn.insertBefore(uris, 0, fn.count(uris)), 0, \"batch-ref\")\n```\n\n\u003e Note: Do not use single quotes within (adhoc) JavaScript modules. If you must use a single quote, escape it with a quote (ex: ''text'')\n\n### [Encryption](https://github.com/marklogic-community/corb2/wiki/Encryption)\nIt is often required to protect the database connection string or password from unauthorized access. \nSo, CoRB optionally supports encryption of the entire XCC URL or any parts of the XCC URL (if individually specified), such as **XCC-PASSWORD**.\n\nOption | Description\n---|---\n**\u003ca name=\"DECRYPTER\"\u003e\u003c/a\u003eDECRYPTER** | Must implement `com.marklogic.developer.corb.Decrypter`. Encryptable options include **XCC-CONNECTION-URI**, **XCC-USERNAME**, **XCC-PASSWORD**, **XCC-HOSTNAME**, **XCC-PORT**, and **XCC-DBNAME** \u003cul\u003e\u003cli\u003e`com.marklogic.developer.corb.PrivateKeyDecrypter` (Included) Requires private key file\u003c/li\u003e\u003cli\u003e`com.marklogic.developer.corb.JasyptDecrypter` (Included) Requires jasypt-*.jar in classpath\u003c/li\u003e\u003cli\u003e`com.marklogic.developer.corb.HostKeyDecrypter` (Included) Requires Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files\u003c/li\u003e\u003c/ul\u003e\n**\u003ca name=\"PRIVATE-KEY-FILE\"\u003e\u003c/a\u003ePRIVATE-KEY-FILE**  | Required property for PrivateKeyDecrypter. This file should be accessible in the classpath or on the file system\n**\u003ca name=\"PRIVATE-KEY-ALGORITHM\"\u003e\u003c/a\u003ePRIVATE-KEY-ALGORITHM** | (optional) \u003cul\u003e\u003cli\u003eDefault algorithm for PrivateKeyDecrypter is RSA.\u003c/li\u003e\u003cli\u003eDefault algorithm for JasyptDecrypter is PBEWithMD5AndTripleDES\u003c/li\u003e\u003cul\u003e\n**\u003ca name=\"JASYPT-PROPERTIES-FILE\"\u003e\u003c/a\u003eJASYPT-PROPERTIES-FILE** | (optional) Property file for the JasyptDecrypter. If not specified, it uses default `jasypt.proeprties` file, which should be accessible in the classpath or file system.\n\n#### com.marklogic.developer.corb.PrivateKeyDecrypter\nPrivateKeyDecrypter automatically detects if the text is encrypted. Unencrypted text or clear text is returned as-is. Although not required, encrypted text can be optionally enclosed with \"ENC\" ex: ENC(xxxxxx) to clearly indicate that it is encrypted.  \n\nGenerate keys and encrypt XCC URL or password using one of the options below.   \n\n#### Java Crypt\n- Use the PrivateKeyDecrypter class inside the CoRB JAR with the gen-keys option to generate a key.  \n  `java -cp /path/to/lib/* com.marklogic.developer.corb.PrivateKeyDecrypter gen-keys /path/to/private.key /path/to/public.key RSA 1024`  \n\u003e Note: if not specified, default algorithm: RSA, default key-length: 1024\n- Use the PrivateKeyDecrypter class inside the CoRB JAR with the encrypt option to encrypt the clear text such as an xcc URL or password.  \n  `java -cp /path/to/lib/* com.marklogic.developer.corb.PrivateKeyDecrypter encrypt /path/to/public.key clearText RSA`  \n\u003e Note: if not specified, default algorithm: RSA\n\n#### RSA keys\n- `openssl genrsa -out private.pem 1024` Generate a private key in PEM format\n- `openssl pkcs8 -topk8 -nocrypt -in private.pem -out private.pkcs8.key` Create a PRIVATE-KEY-FILE in PKCS8 standard for java\n- `openssl rsa -in private.pem -pubout \u003e public.key`  Extract public key\n- `echo \"uri or password\" | openssl rsautl -encrypt -pubin -inkey public.key | base64` Encrypt URI or password. Optionally, the encrypted text can be enclosed with \"ENC\" ex: ENC(xxxxxx)\n\n#### ssh-keygen  \n- `ssh-keygen` ex:key as id_rsa after selecting a passphrase\n- `openssl pkcs8 -topk8 -nocrypt -in id_rsa -out id_rsa.pkcs8.key` (asks for passphrase)\n- `openssl rsa -in id_rsa -pubout \u003e public.key` (asks for passphrase)\n- `echo \"password or uri\" | openssl rsautl -encrypt -pubin -inkey public.key | base64`\n\n#### com.marklogic.developer.corb.JasyptDecrypter\nJasyptDecrypter automatically detects if the text is encrypted. Unencrypted text or clear text is returned as-is. Though, not required, encrypted text can be optionally enclosed with \"ENC\" ex: ENC(xxxxxx) to clearly indicate that it is encrypted.    \n\nEncrypt the URI or password as below. It is assumed that the [jasypt](http://www.jasypt.org/) distribution is available on your machine.   \n\n`jasypt-1.9.2/bin/encrypt.sh input=\"uri or password\" password=\"passphrase\" algorithm=\"algorithm\" (ex: PBEWithMD5AndTripleDES or PBEWithMD5AndDES)`  \n\n**jasypt.properties file**  \n```properties\njasypt.algorithm=PBEWithMD5AndTripleDES #(If not specified, default is PBEWithMD5AndTripleDES)\njasypt.password=passphrase\n```\n\n#### com.marklogic.developer.corb.HostKeyDecrypter\nHostKeyDecrypter uses internal server identifiers to generate a private key unique to the host server. It then uses that private key as input to AES-258 encryption algorithm. Due to the use of AES-258, it requires JCE Unlimited Strength Jurisdiction Policy Files.\n\u003e Note: certain server identifiers used may change in cases of driver installation or if underlying hardware changes. In such cases, passwords will need to be regenerated. Encrypted passwords will be always be unique to the server they are generated on.\n\nEncrypt the password as follows:  \n`java -cp /path/to/lib/* com.marklogic.developer.corb.HostKeyDecrypter encrypt clearText`  \n\nTo test if server is properly configured to use the HostKeyDecrypter:  \n`java -cp /path/to/lib/* com.marklogic.developer.corb.HostKeyDecrypter test`  \n\n### SSL Support\nCoRB provides support for SSL/TLS over XCCS. As a prerequisite to enabling CoRB SSL support, the XDBC server must be configured to use SSL. It is necessary to specify **XCC-CONNECTION-URI** property with a protocol of 'xccs'. To configure a particular type of SSL configuration use the following property:\n\nOption | Description\n---|---\n**\u003ca name=\"SSL-CONFIG-CLASS\"\u003e\u003c/a\u003eSSL-CONFIG-CLASS** | Must implement `com.marklogic.developer.corb.SSLConfig`\u003cul\u003e\u003cli\u003e`com.marklogic.developer.corb.TrustAnyoneSSLConfig` (default)\u003c/li\u003e\u003cli\u003e`com.marklogic.developer.corb.OneWaySSLConfig`\u003c/li\u003e\u003cli\u003e`com.marklogic.developer.corb.TwoWaySSLConfig`\u003c/li\u003e\u003c/ul\u003e\n\n#### com.marklogic.developer.corb.TrustAnyoneSSLConfig\n**TrustAnyoneSSLConfig** is the default implementation of the SSLContext. It will accept any certificate presented by the MarkLogic server.\n\n#### com.marklogic.developer.corb.OneWaySSLConfig\n**OneWaySSLConfig** uses the default Java truststore for the SSLContext, but can be configured to use a custom TrustStore and (encryptable) password, instead of using the default cacerts.\n\nOption | Description\n---|---\n**\u003ca name=\"SSL-CIPHER-SUITES\"\u003e\u003c/a\u003eSSL-CIPHER-SUITES** | (optional) A comma or colon separated list of acceptable cipher suites used.\n**\u003ca name=\"SSL-ENABLED-PROTOCOLS\"\u003e\u003c/a\u003eSSL-ENABLED-PROTOCOLS** | (optional) A comma or colon separated list of acceptable SSL protocols, in priority order. Default is `TLSv1.2`.\n**\u003ca name=\"SSL-PROPERTIES-FILE\"\u003e\u003c/a\u003eSSL-PROPERTIES-FILE** | (optional) A properties file that can be used to load a common SSL configuration.\n**\u003ca name=\"SSL-TRUSTSTORE\"\u003e\u003c/a\u003eSSL-TRUSTSTORE** | Location of the truststore file.\n**\u003ca name=\"SSL-TRUSTSTORE-PASSWORD\"\u003e\u003c/a\u003eSSL-TRUSTSTORE-PASSWORD** | (encryptable) Password of the truststore file.\n**\u003ca name=\"SSL-TRUSTSTORE-TYPE\"\u003e\u003c/a\u003eSSL-TRUSTSTORE-TYPE** | (optional) Type of the keystore, such as 'JKS' or 'PKCS12'.\n\n\n#### com.marklogic.developer.corb.TwoWaySSLConfig\n**TwoWaySSLConfig** is more complete and configurable implementation of the SSLContext. It supports SSL with mutual authentication. It is configurable via the following properties:\n\nOption | Description\n---|---\n**\u003ca name=\"SSL-CIPHER-SUITES\"\u003e\u003c/a\u003eSSL-CIPHER-SUITES** | (optional) A comma or colon separated list of acceptable cipher suites used.\n**\u003ca name=\"SSL-ENABLED-PROTOCOLS\"\u003e\u003c/a\u003eSSL-ENABLED-PROTOCOLS** | (optional) A comma or colon separated list of acceptable SSL protocols, in priority order. Default is `TLSv1.2`.\n**\u003ca name=\"SSL-KEYSTORE\"\u003e\u003c/a\u003eSSL-KEYSTORE** | Location of the keystore file.\n**\u003ca name=\"SSL-KEYSTORE-PASSWORD\"\u003e\u003c/a\u003eSSL-KEYSTORE-PASSWORD** | (encryptable) Password of the keystore file.\n**\u003ca name=\"SSL-KEYSTORE-TYPE\"\u003e\u003c/a\u003eSSL-KEYSTORE-TYPE** | (optional) Type of the keystore, such as 'JKS' or 'PKCS12'.\n**\u003ca name=\"SSL-KEY-PASSWORD\"\u003e\u003c/a\u003eSSL-KEY-PASSWORD** | (encryptable) Password of the private key.\n**\u003ca name=\"SSL-PROPERTIES-FILE\"\u003e\u003c/a\u003eSSL-PROPERTIES-FILE** | (optional) A properties file that can be used to load a common SSL configuration.\n**\u003ca name=\"SSL-TRUSTSTORE\"\u003e\u003c/a\u003eSSL-TRUSTSTORE** | Location of the truststore file.\n**\u003ca name=\"SSL-TRUSTSTORE-PASSWORD\"\u003e\u003c/a\u003eSSL-TRUSTSTORE-PASSWORD** | (encryptable) Password of the truststore file.\n**\u003ca name=\"SSL-TRUSTSTORE-TYPE\"\u003e\u003c/a\u003eSSL-TRUSTSTORE-TYPE** | (optional) Type of the keystore, such as 'JKS' or 'PKCS12'.\n\n### Load Balancing and Failover with Multiple Hosts\nCoRB 2.4+ supports load balancing and failover using `com.marklogic.developer.corb.ContentSourcePool`. This is automatically enabled when multiple comma separated values (supports encryption) are specified for for **XCC-CONNECTION-URI** or **XCC-HOSTNAME**.\n\n```properties\nXCC-CONNECTION-URI=xcc://hostname1:8000/dbname,xcc://hostname2:8000/dbname,..\n```\nOR\n```properties\nXCC-HOST-NAME=hostname1,hostname2,..\n```\n\nThe default implementation for `com.marklogic.developer.corb.ContentSourcePool` is `com.marklogic.developer.corb.DefaultContentSourcePool`. It uses below options for **CONNECTION-POLICY** for allocating connections to callers. \n-  **ROUND-ROBIN** - (Default) Connections are allocated using round-robin algorithm. \n-  **RANDOM** - Connections are randomly allocated.\n-  **LOAD** - Host with least number of active connections is allocated to caller.    \n\n### Query and Connection Retries\nCoRB automatically retries the requests a given URI when it encounters `com.marklogic.xcc.exceptions.ServerConnectionException` from MarkLogic. If necessary, the number of retry attempts can be configured using **XCC-CONNECTION-RETRY-LIMIT**. If multiple hosts are specified, we can optionally configure retries per each host using **XCC-CONNECTION-HOST-RETRY-LIMIT**. CoRB waits at least **XCC-CONNECTION-RETRY-INTERVAL** seconds before a connection is retried on a failed host. \n\nCoRB also supports retries of requests failed due to query errors. This feature is only intended for sporadic query errors which are not specific to a particular URI. A good example may include occasional time out exceptions from MarkLogic when the ML is too busy and request time limit is low. We can configure which queries can be retried using **QUERY-RETRY-ERROR-CODES** or **QUERY-RETRY-ERROR-MESSAGE** (when error codes are not available). If necessary, the number of query retry attempts can be configured using **QUERY-RETRY-LIMIT**. CoRB waits at least **QUERY-RETRY-INTERVAL** seconds before retrying a query.\n\n```properties\nQUERY-RETRY-ERROR-CODES=XDMP-EXTIME,SVC-EXTIME\nQUERY-RETRY-ERROR-MESSAGE=ErrorMsg1,ErrorMsg2\n```\n\n### [Usage Examples](https://github.com/marklogic-community/corb2/wiki/Running-CoRB#usage-examples)\nRefer to the [wiki for examples](https://github.com/marklogic-community/corb2/wiki/Running-CoRB#usage-examples) of how to execute a CoRB job and various ways of configuring the job options.\n\n### [ModuleExecutor Tool](https://github.com/marklogic-community/corb2/wiki/ModuleExecutor-Tool)\n\nSometimes, a two or more staged CoRB job with both a selector and transform isn't necessary to get the job done. Sometimes, only a single query needs to be executed and the output captured to file. \nMaybe even to execute only a single query with no output captured. \nIn these cases, the [ModuleExecutor Tool](https://github.com/marklogic-community/corb2/wiki/ModuleExecutor-Tool) can be used to quickly and efficiently execute your XQuery or JavaScript files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarklogic-community%2Fcorb2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarklogic-community%2Fcorb2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarklogic-community%2Fcorb2/lists"}