Docling
Convert documents such as PDF, Word or HTML files to Markdown, HTML, JSON or text, extract their metadata or chunk them, with the docling CLI or a docling-serve server.
What’s inside
-
Docling component, URI syntax:
docling:operationId
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-docling-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 59 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.docling.abort-on-error | Whether docling-serve aborts the conversion on the first error. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.allow-file-path-source | Whether a String message body that starts with / or contains \ is interpreted as a local filesystem path to read. When disabled, such a body is rejected instead of being read. This does not affect the CamelDoclingInputFilePath header, nor File, byte[] or explicit path collection bodies used by the batch operations. | false | Boolean |
camel.component.docling.allow-url-source | Whether a String message body that starts with http:// or https:// is interpreted as a remote URL for Docling to fetch. When disabled, such a body is rejected instead of being fetched. This does not affect the CamelDoclingInputFilePath header, nor bodies of any other type. | false | Boolean |
camel.component.docling.async-poll-interval | Interval in milliseconds between the status polls of an async docling-serve task, with useAsyncMode and SUBMIT_ASYNC_CONVERSION. It must be greater than 0. | 2000 | Long |
camel.component.docling.async-task-ttl | Time in milliseconds that a task of SUBMIT_ASYNC_CONVERSION is kept in memory. A task that is older is cancelled and removed, and can no longer be checked or consumed. Only the value of the component configuration is used. | 86400000 | Long |
camel.component.docling.async-timeout | Maximum time in milliseconds for an async docling-serve task to complete, with useAsyncMode and SUBMIT_ASYNC_CONVERSION. A task that takes longer fails. It must be greater than 0. | 300000 | Long |
camel.component.docling.authentication-scheme | How authenticationToken is sent to docling-serve: BEARER in the Authorization header, API_KEY in the X-Api-Key header, or NONE to send no token. | none | AuthenticationScheme |
camel.component.docling.authentication-token | The token sent to docling-serve: in the Authorization header as a Bearer token with authenticationScheme BEARER, or in the X-Api-Key header with API_KEY. It is not sent with NONE. | String | |
camel.component.docling.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.docling.batch-fail-on-first-error | Whether the batch stops at the first failed document: the documents not started yet are skipped and the exchange fails. When false, all documents are converted and the failures are in the results. The CamelDoclingBatchFailOnFirstError header overrides it per message. | true | Boolean |
camel.component.docling.batch-parallelism | Number of threads that convert the documents of a batch in parallel. The CamelDoclingBatchParallelism header overrides it per message. | 4 | Integer |
camel.component.docling.batch-size | Number of documents to submit per sub-batch. Documents are partitioned into sub-batches of this size and each sub-batch is processed before starting the next one. Within each sub-batch, up to batchParallelism threads are used concurrently. This controls memory usage and back-pressure when processing large document sets. | 10 | Integer |
camel.component.docling.batch-timeout | Maximum time in milliseconds for the whole batch, across all its sub-batches. When it is exceeded, the pending documents are cancelled and the exchange fails. The CamelDoclingBatchTimeout header overrides it per message. | 300000 | Long |
camel.component.docling.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean |
camel.component.docling.chunking-include-raw-text | Whether each chunk of the chunking operations also holds raw_text, the text without the context of its headings, besides text. | false | Boolean |
camel.component.docling.chunking-max-tokens | Maximum number of tokens per chunk of CHUNK_HYBRID. When not set, the server takes it from the tokenizer. The CamelDoclingChunkingMaxTokens header overrides it per message. | Integer | |
camel.component.docling.chunking-merge-peers | Whether CHUNK_HYBRID merges undersized successive chunks that have the same headings. When not set, nothing is sent and the server default (true) applies. The CamelDoclingChunkingMergePeers header overrides it per message. | true | Boolean |
camel.component.docling.chunking-tokenizer | Hugging Face model whose tokenizer CHUNK_HYBRID uses to count tokens. When not set, the server uses sentence-transformers/all-MiniLM-L6-v2. The CamelDoclingChunkingTokenizer header overrides it per message. | String | |
camel.component.docling.chunking-use-markdown-tables | Whether the chunking operations serialize the tables in Markdown instead of as triplets. | false | Boolean |
camel.component.docling.configuration | The shared configuration of the endpoints: each endpoint starts from a copy of it. The option is a org.apache.camel.component.docling.DoclingConfiguration type. | DoclingConfiguration | |
camel.component.docling.content-in-body | With the docling CLI, whether the message body is the content of the output file, which is then deleted. When false, the body is the path of the output file, which is moved to the directory of the input file. With the chunking operations, whether the body is the List of chunks instead of the ChunkDocumentResponse. The other docling-serve operations always return the content. | false | Boolean |
camel.component.docling.do-code-enrichment | Whether docling-serve runs the code enrichment model on the code blocks. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.do-formula-enrichment | Whether docling-serve recognizes the formulas and returns them as LaTeX. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.do-ocr | The do_ocr value sent to docling-serve. When not set, false is sent if enableOCR is false, true if ocrLanguage is set, and otherwise nothing, so the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.do-picture-classification | Whether docling-serve classifies the pictures of the documents. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.do-picture-description | Whether docling-serve describes the pictures of the documents with a vision-language model. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.do-table-structure | Whether docling-serve extracts the structure of the tables. When not set, the server default applies, except EXTRACT_STRUCTURED_DATA and BATCH_EXTRACT_STRUCTURED_DATA, which send true. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.docling-command | The docling CLI command to run: a name found on the PATH, or the path of the executable. Not used with useDoclingServe. | String | |
camel.component.docling.docling-serve-url | Base URL of the docling-serve API, used with useDoclingServe. | String | |
camel.component.docling.document-timeout | Timeout in seconds for docling-serve to process each document. When not set, the server default applies. Used by the docling-serve conversions only. | Long | |
camel.component.docling.enable-o-c-r | Whether to run OCR on the bitmap content of the documents, such as scanned pages. When false, the docling CLI gets --no-ocr and docling-serve gets do_ocr=false. When true, the docling CLI runs OCR, and docling-serve uses doOcr, ocrLanguage or its own default. The CamelDoclingEnableOCR header overrides it per message. | true | Boolean |
camel.component.docling.enabled | Whether to enable auto configuration of the docling component. This is enabled by default. | Boolean | |
camel.component.docling.force-ocr | Whether docling-serve replaces the existing text of the documents with the text from OCR (force_ocr). When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.image-export-mode | How docling-serve puts the images in the Markdown, HTML or JSON output: EMBEDDED, PLACEHOLDER or REFERENCED. When not set, the server default applies. Used by the docling-serve conversions only. | String | |
camel.component.docling.images-scale | Scale factor of the images that docling-serve exports. When not set, the server default applies. Used by the docling-serve conversions only. | Double | |
camel.component.docling.include-images | Whether docling-serve extracts the images of the documents. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.include-layout-info | Whether to pass --show-layout to the docling CLI, which draws the bounding boxes of the items on the page images. The docling CLI applies it only to the html_split_page output, which this component does not request. Not used with useDoclingServe. | false | Boolean |
camel.component.docling.include-metadata-in-headers | Whether EXTRACT_METADATA also sets the extracted fields as CamelDoclingMetadata headers. | true | Boolean |
camel.component.docling.include-raw-metadata | Whether EXTRACT_METADATA also returns the whole Docling document as a Map, in the rawMetadata of the DocumentMetadata and, with includeMetadataInHeaders, in the CamelDoclingMetadataRaw header. | false | Boolean |
camel.component.docling.input-base-directory | When set, every local input file path must resolve inside this directory once normalized. Applies to the CamelDoclingInputFilePath header, to file path message bodies, and to the paths used by the batch operations. When empty, no directory restriction is applied. | String | |
camel.component.docling.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.docling.max-file-size | Maximum file size in bytes for processing | 52428800 | Long |
camel.component.docling.md-page-break-placeholder | Text that docling-serve puts between the pages of the Markdown output. Used by the docling-serve conversions only. | String | |
camel.component.docling.oauth-profile | OAuth profile name for obtaining an access token via the OAuth 2.0 Client Credentials grant. When set, the token is acquired from the configured identity provider for each request and sent to docling-serve in the Authorization header as a Bearer token, whatever authenticationScheme is. Requires camel-oauth on the classpath. | String | |
camel.component.docling.ocr-engine | The OCR engine of docling-serve. When not set, the server default applies. Used by the docling-serve conversions only. | String | |
camel.component.docling.ocr-language | Language code for OCR processing. With the docling CLI, en is used when it is not set. With docling-serve, setting it turns OCR on (do_ocr=true) unless enableOCR or doOcr is false, and when it is not set the server uses its own default languages. | String | |
camel.component.docling.operation | The operation to perform. The CamelDoclingOperation header overrides it per message. | convert-to-markdown | DoclingOperations |
camel.component.docling.output-base-directory | When set, the output directory passed to the docling CLI must resolve inside this directory once normalized. Applies to the CamelDoclingOutputFilePath header. The check is lexical and does not resolve symbolic links, matching inputBaseDirectory. When empty, the header value must be a relative path that does not leave the working directory once normalized; set this option to use absolute output directories. | String | |
camel.component.docling.output-format | Output format of the SUBMIT_ASYNC_CONVERSION operation; the other operations always use their own format. The html_split_page value is rejected, as docling-serve does not return the split pages; use html instead | markdown | String |
camel.component.docling.pdf-backend | The backend docling-serve uses to parse PDF files. When not set, the server default applies. Used by the docling-serve conversions only. | String | |
camel.component.docling.pipeline | The pipeline docling-serve uses to process the documents: STANDARD, VLM (vision-language model) or ASR (speech recognition for audio). When not set, the server default applies. Used by the docling-serve conversions only. | String | |
camel.component.docling.process-timeout | Timeout in milliseconds. With the docling CLI, the time to wait for the process to exit before it is killed. With docling-serve, the read timeout of each HTTP request, which also bounds a sync conversion; it must be greater than 0. | 30000 | Long |
camel.component.docling.split-batch-results | Whether the body of a batch operation is a List of BatchConversionResult, one per document, to use with the Split EIP, instead of a single BatchProcessingResults. The CamelDoclingBatchSplitResults header overrides it per message. | false | Boolean |
camel.component.docling.table-cell-matching | Whether docling-serve matches the predicted table cells back to the cells of the PDF. When false, the table structure model defines the text cells. When not set, the server default applies. Used by the docling-serve conversions only. | Boolean | |
camel.component.docling.table-mode | The mode of the TableFormer model that recognizes the table structure: ACCURATE or FAST. When not set, the server default applies. Used by the docling-serve conversions only. | String | |
camel.component.docling.use-async-mode | Whether the conversions use the async API of docling-serve: the task is submitted, its status is polled every asyncPollInterval, and the producer waits for the result up to asyncTimeout. Applies to the conversion and batch operations, not to EXTRACT_METADATA and the chunking operations. The CamelDoclingUseAsyncMode header overrides it per message. | false | Boolean |
camel.component.docling.use-docling-serve | Whether to call the docling-serve API at doclingServeUrl instead of running the docling CLI. The async, batch and chunking operations require it. | false | Boolean |
camel.component.docling.working-directory | Working directory of the docling CLI process. When not set, the process runs in the working directory of the JVM. Not used with useDoclingServe. | String | |
camel.component.docling.api-key-header | Header name for API key authentication. Deprecation note: Not used: the docling-serve client always sends the API key in the X-Api-Key header | X-Api-Key | String |