-
Notifications
You must be signed in to change notification settings - Fork 1
Repository Connector Execution Modes
OpenCrawling offers a flexible architecture designed to run repository connectors under two different operational modes: Dynamic UI-Driven (Long-Lived Service) or Standalone/Headless (One-Shot Task).
This guide explains both architectures and details how to configure them for local and production environments.
| Feature | Dynamic UI-Driven Mode | Standalone/Headless Mode |
|---|---|---|
| Container Lifespan | Long-running daemon | Ephemeral (runs one-shot crawl and exits) |
| Connector Resolution | Instantitated at runtime via API/UI inputs | Pre-selected on boot via environment variables |
| Multi-Tenancy | Single container runs multiple jobs in parallel | One container runs one specific job |
| Typical Target | Web applications, Admin console dashboards | Kubernetes CronJobs, Airflow, CI/CD pipelines |
In this mode, you deploy a single, long-running instance of the OpenCrawling backend (oc-mcp-server or oc-runtime container).
All connector classes (e.g. FileSystemRepositoryConnector, AlfrescoRepositoryConnector, etc.) are loaded on the classpath. The backend acts as a job manager.
- Dynamic Registration: Through the Admin UI (or REST API), you register repository and output connectors. Configurations (like URLs, credentials, paths) are saved as JSON metadata.
-
Runtime Instantiation: When you hit "Start" on a Job, the orchestrator retrieves the connector class name (e.g.,
org.opencrawling.alfresco.AlfrescoRepositoryConnector), dynamically instantiates it with the saved configuration map, and triggers the crawl thread. - Isolation: Because instantiation happens dynamically inside virtual threads, you can run multiple crawl jobs simultaneously targeting completely different repositories (e.g., crawling local directories, Alfresco nodes, and SharePoint folders) on the same running container without needing restarts.
In this mode, you run a container configured to automatically boot, crawl a preconfigured path, write the claims/documents, and exit. This is ideal for cron schedulers or scheduled job workflows.
You control this behavior using Spring Boot properties.
-
spring.opencrawling.crawl-on-startup: Enable/disable automated crawl on boot. -
spring.opencrawling.repository-connector-type: Choose which repository connector class to bind (fileoralfresco). -
spring.opencrawling.scan-path: The starting folder path or node ID to crawl. -
spring.opencrawling.transformation-connector: The target vector/embedding connector key (e.g.,Ollama local).
To configure a headless container for crawling an Alfresco Content Services server:
services:
oc-crawler-alfresco:
build:
context: .
dockerfile: docker/Dockerfile.crawler
container_name: oc-crawler-alfresco-job
environment:
- SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka:9094
- SPRING_OPENCRAWLING_CRAWL_ON_STARTUP=true
- SPRING_OPENCRAWLING_REPOSITORY_CONNECTOR_TYPE=alfresco
- SPRING_OPENCRAWLING_SCAN_PATH=-root-
- SPRING_OPENCRAWLING_TRANSFORMATION_CONNECTOR=Ollama local
volumes:
- ./oc-runtime/data:/data
networks:
- opencrawling-networkOn container startup:
- The runtime boots up and detects
SPRING_OPENCRAWLING_CRAWL_ON_STARTUP=true. - It filters the loaded beans to find a connector matching
alfresco(instantiatingAlfrescoRepositoryConnector). - It crawls from
-root-recursively, sending claims to the Kafka queue. - Once completed, the container exits successfully.
If you are registering connectors via the REST API or adding them to the connectors database (connectors.json), reference these fully qualified class names:
| Connector | Class Name |
|---|---|
| Local File System | org.opencrawling.crawler.connectors.filesystem.FileConnector |
| Alfresco Content Services | org.opencrawling.alfresco.AlfrescoRepositoryConnector |
| Apache Iceberg | org.opencrawling.iceberg.IcebergRepositoryConnector |
| PGVector Output | org.opencrawling.vector.VectorOutputConnector |