Skip to content
Camel component for Apache CouchDB
Find file
Latest commit 8b4c8d7 Dec 6, 2013 @sksamuel Update
Failed to load latest commit information.
src added apache license text to files Jul 29, 2012
.gitignore Added option for delete / inserts only Jul 29, 2012 Update Dec 6, 2013
pom.xml Release 1.0.0 Jul 29, 2012


This component is now included in camel as part of

The camel-couchdb component allows you to treat Apache CouchDB as a producer or consumer of messages. Using the lightweight LightCouch API, this camel component has the following features:

  • As a consumer, monitors couch changesets for inserts, updates and deletes and publishes these as messages into camel routes.
  • As a producer, can save or update documents into couch.
  • Can support as many endpoints as required, eg for multiple databases across multiple instances.
  • Ability to have events trigger for only deletes, only inserts/updates or all (default).
  • Headers set for sequenceId, document revision, document id, and HTTP method type.

How to Use

You can use couch as an endpoint with the following URI. The endpoint URI is the same for producer and consumer. couchdb:http://hostname[:port]/database?[options...]

Some of the available options are:

  • deletes document deletes are published as events (default true)
  • updates document inserts/updates are published as events (default true)
  • heartbeat how often to send an empty message to keep socket alive (default 30000ms)
  • createDatabase create the database if it does not already exist (default false)
  • username username in case of authenticated databases (default null)
  • password password for authenticated databases (default null)

Meta Data

Messages published into the system have the following metadata applied in the form of headers on the exchange:

  • CouchDbDatabase - the database the message came from
  • CouchDbSeq - the couchdb changeset sequence number of the update / delete message
  • CouchDbId - the couchdb document id
  • CouchDbRev - the couchdb document revision
  • CouchDbMethod - the method (delete / update)


camel-couchdb has a complete set of unit tests. In addition there are some integration tests that require you to run a local instance of Couch. By default the tests will look at localhost:5984 and for a database called camelcouchdb.


This software is licensed under the Apache 2 license, quoted below.

Copyright 2013 Stephen Samuel

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
Something went wrong with that request. Please try again.