<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy" -->

---
title: Building Intelligent Document Processing with Apache...
description: A step-by-step guide to building an AI-powered document processing system using Apache Camel, IBM Docling, and LangChain4j in Java. The tutorial covers...
canonical: https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building Intelligent Document Processing with Apache Camel, Docling and LangChain4j | daily.dev
og:description: A step-by-step guide to building an AI-powered document processing system using Apache Camel, IBM Docling, and LangChain4j in Java. The tutorial covers...
og:url: https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy
og:image: https://api.daily.dev/og/posts/3xWnyzTpy.png
og:image:alt: Building Intelligent Document Processing with Apache Camel, Docling and LangChain4j
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building Intelligent Document Processing with Apache Camel, Docling and LangChain4j

**[Baeldung](https://daily.dev/sources/baeldung)** · 9 min read · 5 upvotes · 0 comments

## Summary

A step-by-step guide to building an AI-powered document processing system using Apache Camel, IBM Docling, and LangChain4j in Java. The tutorial covers converting PDF documents to Markdown via a Docling server running in Docker, orchestrating the workflow with Camel routes, sending the structured content to an OpenAI-compatible LLM through LangChain4j, and exposing an interactive Q&A HTTP API using an embedded Undertow server. Key patterns include caching the converted Markdown to avoid repeated conversions and using Camel's pollEnrich EIP to reuse preprocessed documents per request.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://feeds.feedblitz.com/~/964749371/0/baeldung>

## Questions this post answers

### How do I convert a PDF into Markdown using Docling with Apache Camel?

Use the camel-docling component's docling:CONVERT_TO_MARKDOWN endpoint pointed at a running docling-serve instance, configured with useDoclingServe=true and doclingServeUrl. A Camel route watching a documents directory sends each file automatically, and docling-serve returns the converted Markdown in the message body, which can then be written to disk.

_Developers wiring PDF ingestion into AI pipelines can find integration patterns like this through daily.dev._

### How can I send extracted document text to an LLM using LangChain4j from an Apache Camel route?

Bind an OpenAiChatModel instance to Camel's registry under a name like chatModel, then route the prompt body to the langchain4j-chat component with chatModel=#chatModel referencing that bound instance. Camel resolves the model from its registry and forwards the constructed prompt, including embedded document content, to generate a response.

_Teams combining Camel routing with LLM calls can track integration approaches like this via daily.dev._

### How do I avoid re-converting a PDF to Markdown on every API request in a document Q&A service?

Convert the document once and store the resulting Markdown file, then use Camel's pollEnrich EIP with idempotent=false to re-read that same Markdown file on every incoming HTTP request instead of invoking Docling again. This keeps question-answering requests lightweight since only the cached Markdown, not the original PDF, is reprocessed each time.

_Developers optimizing RAG-style Q&A APIs for repeated queries can follow patterns like this on daily.dev._

## Similar posts on daily.dev

- [Orchestrating Agentic and Multimodal AI Pipelines with Apache Camel](https://daily.dev/posts/orchestrating-agentic-and-multimodal-ai-pipelines-with-apache-camel-gsj1h57u6) · InfoQ · 0 upvotes · 0 comments
- [LLM Integration With Apache Camel OpenAI Component](https://daily.dev/posts/llm-integration-with-apache-camel-openai-component-xarxzi5rz) · Baeldung · 2 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#langchain4j](https://daily.dev/tags/langchain4j), [#apache-camel](https://daily.dev/tags/apache-camel)

[View this post on daily.dev](https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building Intelligent Document Processing with Apache Camel, Docling and LangChain4j","url":"https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy"},"datePublished":"2026-07-30T23:54:30.429Z","dateModified":"2026-09-14T06:28:38.832Z","description":"A step-by-step guide to building an AI-powered document processing system using Apache Camel, IBM Docling, and LangChain4j in Java. The tutorial covers...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/86d3f473cc9c26d22d95b9bd9656549f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/86d3f473cc9c26d22d95b9bd9656549f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Baeldung","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Baeldung","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576","url":"https://daily.dev/sources/baeldung"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,langchain4j,apache-camel","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Baeldung","item":"https://daily.dev/sources/baeldung"},{"@type":"ListItem","position":3,"name":"Building Intelligent Document Processing with Apache Camel, Docling and LangChain4j"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-intelligent-document-processing-with-apache-camel-docling-and-langchain4j-3xwnyztpy#faq","mainEntity":[{"@type":"Question","name":"How do I convert a PDF into Markdown using Docling with Apache Camel?","acceptedAnswer":{"@type":"Answer","text":"Use the camel-docling component's docling:CONVERT_TO_MARKDOWN endpoint pointed at a running docling-serve instance, configured with useDoclingServe=true and doclingServeUrl. A Camel route watching a documents directory sends each file automatically, and docling-serve returns the converted Markdown in the message body, which can then be written to disk. Developers wiring PDF ingestion into AI pipelines can find integration patterns like this through daily.dev."}},{"@type":"Question","name":"How can I send extracted document text to an LLM using LangChain4j from an Apache Camel route?","acceptedAnswer":{"@type":"Answer","text":"Bind an OpenAiChatModel instance to Camel's registry under a name like chatModel, then route the prompt body to the langchain4j-chat component with chatModel=#chatModel referencing that bound instance. Camel resolves the model from its registry and forwards the constructed prompt, including embedded document content, to generate a response. Teams combining Camel routing with LLM calls can track integration approaches like this via daily.dev."}},{"@type":"Question","name":"How do I avoid re-converting a PDF to Markdown on every API request in a document Q&A service?","acceptedAnswer":{"@type":"Answer","text":"Convert the document once and store the resulting Markdown file, then use Camel's pollEnrich EIP with idempotent=false to re-read that same Markdown file on every incoming HTTP request instead of invoking Docling again. This keeps question-answering requests lightweight since only the cached Markdown, not the original PDF, is reprocessed each time. Developers optimizing RAG-style Q&A APIs for repeated queries can follow patterns like this on daily.dev."}}]}
```

