You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Camel MongoDB component

Available as of Camel 2.10

According to Wikipedia: "NoSQL is a movement promoting a loosely defined class of non-relational data stores that break with a long history of relational databases and ACID guarantees." NoSQL solutions have grown in popularity in the last few years, and major extremely-used sites and services such as Facebook, LinkedIn, Twitter, etc. are known to use them extensively to achieve scalability and agility.

Basically, NoSQL solutions differ from traditional RDBMS (Relational Database Management Systems) in that they don't use SQL as their query language and generally don't offer ACID-like transactional behaviour nor relational data. Instead, they are designed around the concept of flexible data structures and schemas (meaning that the traditional concept of a database table with a fixed schema is dropped), extreme scalability on commodity hardware and blazing-fast processing.

MongoDB is a very popular NoSQL solution and the camel-mongodb component integrates Camel with MongoDB allowing you to interact with MongoDB collections both as a producer (performing operations on the collection) and as a consumer (consuming documents from a MongoDB collection).

MongoDB revolves around the concepts of documents (not as is office documents, but rather hierarchical data defined in JSON/BSON) and collections. This component page will assume you are familiar with them. Otherwise, visit http://www.mongodb.org/.

URI format

mongodb:connectionBean?database=databaseName&collection=collectionName&operation=operationName[&moreOptions...]

Endpoint options

Unknown macro: {div}

Name

Default Value

Description

Producer/consumer (* see below)

database

none

Required. The name of the database to which this endpoint will be bound. All operations will be executed against this database unless dynamicity is enabled and the CamelMongoDbDatabase header is set.

P+C

collection

none

Required. The name of the collection (within the specified database) to which this endpoint will be bound. All operations will be executed against this database unless dynamicity is enabled and the CamelMongoDbDatabase header is set.

P+C

operation

none

Required for producers. The id of the operation this endpoint will execute. Pick from the following:

  • Query operations: findById, findOneByQuery, findAll, count
  • Write operations: insert, save, update
  • Delete operations: remove
  • Other operations: getDbStats, getColStats

P

createCollection

true

 

P

invokeGetLastError

false (behaviour may be inherited from connections WriteConcern)

 

P

writeConcern

 

 

P

writeConcernRef

 

 

P

readPreference

 

 

P

dynamicity

false

 

P

persistentIdTailTracking

false

 

TC

cursorRegenerationDelay

1000ms

 

TC

persistentId

none - required if persistent tail tracking is enabled

 

TC

tailTrackingIncreasingField

 

 

TC

tailTrackDb

 

 

TC

tailTrackCollection

 

 

TC

tailTrackField

 

 

TC

Acronyms: P=Producer | C=All consumers | TC = Tailable cursor consumer

  • No labels