LangStream Documentation
Langstream.aiLangStream GitHub RepoChangelog
  • LangStream Documentation
  • ❤️Langstream.ai
  • ⭐LangStream GitHub Repo
  • 📜Changelog
  • about
    • What is LangStream?
    • License
  • Get Started
  • installation
    • LangStream CLI
    • Docker
    • Minikube (mini-langstream)
    • Kubernetes
    • Build and install from source
  • Building Applications
    • Vector Databases
    • Application structure
      • Pipelines
      • Instances
      • Configuration
      • Topics
      • Assets
      • Secrets
      • YAML templating
      • Error Handling
      • Stateful agents
      • .langstreamignore
    • Sample App
    • Develop, test and deploy
    • Application Lifecycle
    • Expression Language
    • API Gateways
      • Websocket
      • HTTP
      • Message filtering
      • Gateway authentication
    • API Reference
      • Agents
      • Resources
      • Assets
  • LangStream CLI
    • CLI Commands
    • CLI Configuration
    • Web interface
  • Integrations
    • Large Language Models (LLMs)
      • OpenAI
      • Hugging Face
      • Google Vertex AI
      • Amazon Bedrock
      • Ollama
    • Data storage
      • Astra Vector DB
      • Astra
      • Cassandra
      • Pinecone
      • Milvus
      • Solr
      • JDBC
      • OpenSearch
    • Integrations
      • Apache Kafka Connect
      • Apache Camel
    • LangServe
  • Pipeline Agents
    • Agent Messaging
    • Builtin agents
      • Input & Output
        • webcrawler-source
        • s3-source
        • azure-blob-storage-source
        • sink
        • vector-db-sink
        • camel-source
      • AI Agents
        • ai-chat-completions
        • ai-text-completions
        • compute-ai-embeddings
        • flare-controller
      • Text Processors
        • document-to-json
        • language-detector
        • query
        • query-vector-db
        • re-rank
        • text-normaliser
        • text-extractor
        • text-splitter
        • http-request
      • Data Transform
        • cast
        • compute
        • drop
        • drop-fields
        • merge-key-value
        • unwrap-key-value
      • Flow control
        • dispatch
        • timer-source
        • trigger-event
    • Custom Agents
      • Python sink
      • Python source
      • Python processor
      • Python service
    • Agent Developer Guide
      • Agent Types
      • Agent Creation
      • Configuration and Testing
      • Environment variables
  • Messaging
    • Messaging
      • Apache Pulsar
      • Apache Kafka
      • Pravega.io
  • Patterns
    • RAG pattern
    • FLARE pattern
  • Examples
    • LangServe chatbot
    • LlamaIndex Cassandra sink
Powered by GitBook
On this page
  • Deploying the component into your LangStream application
  • Apache Camel Sources
Edit on GitHub
  1. Integrations
  2. Integrations

Apache Camel

Configuration for LangStream Sources using Apache Camel.

Deploying the component into your LangStream application

LangStream doesn't bundle all the Camel connectors, but you can easily deploy them into your application.

Declare the dependency to the connector in your configuration.yaml file and LangStream will download it and deploy it into your application.

configuration:
  dependencies:
    - name: "Apache Camel GitHub component"
      url: "https://repo1.maven.org/maven2/org/apache/camel/camel-github/4.1.0/camel-github-4.1.0.jar"
      sha512sum: "f40e55ddfde21e11e6a26fbb50e4f75df37976c673dbc4aeeaa350257b0179f4a9a71f099f8ac3cbc60cc9d8ff9559984a304fb7d6785bcfb22a9943ceb8d7bd"
      type: "java-library"
    - name: "Apache Camel GitHub component - dependency"
      url: "https://repo1.maven.org/maven2/org/eclipse/mylyn/github/org.eclipse.egit.github.core/2.1.5/org.eclipse.egit.github.core-2.1.5.jar"
      sha512sum: "4fab14efed656b6705ad74ab9c05a346fe4fdc737b1b5130842aee7ebba98b895b7cb8c35d15e3da150116f445ae3b5c88daaaa5319c39144cb365247b9d0630"
      type: "java-library"

You have to bundle all the jars needed by the connector - in this example the Apache Camel GitHub component requires the org.eclipse.egit.github.core jar file.

The jar files are downloaded by the LangStream CLI when you are deploying the application and then copied to the java/lib directory. You are not required to use this mechanism - you can manually copy the jar files if you prefer - but if you use the dependency mechanism, the LangStream CLI will check the sha512sum of the files to make sure that they are not corrupted.

We recommend adding a .gitignore file into your application so you don't commit the jar file into your git repository.

Apache Camel Sources

Once you have your connector deployed into your application, you can use it in your pipeline.

This is an example of configuring a Source connector that reads events from GitHub:

topics:
  - name: "output-topic"
    creation-mode: create-if-not-exists
pipeline:
  - name: "read-from-github"
    type: "camel-source"

    configuration:
      component-uri: "github:PULLREQUESTCOMMENT/${secrets.camel-github-source.branch}"
      component-options:
         oauthToken: "${secrets.camel-github-source.oauthToken}"
         repoName: "${secrets.camel-github-source.repoName}"
         repoOwner: "${secrets.camel-github-source.repoOwner}"
  - name: "keep only the contents of the comment"
    type: "compute"
    output: "output-topic"
    configuration:
        fields:
           - name: "value"
             expression: "value.body"

You must provide the component-uri and the component-options in the "configuration" section.

All component-options are passed to the component as additional parameters in the query string, appended to the component-uri. This mechanism helps you in defining each property in a separate secret, so that you can easily rotate the secrets without changing the pipeline configuration. Additionally, the camel-source agent will automatically URL-encode the values of the parameters passed to the query string.

PreviousApache Kafka ConnectNextLangServe

Last updated 1 year ago