Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Default Value

Description

Producer

Consumer

database

none

Required. The name of the database to which this endpoint will be bound. All operations will be executed against this database.

(tick)

(tick)

bucket

fs

The name of the GridFS bucket within the Database. The default is the GridFS.DEFAULT_BUCKET value ("fs").

(tick)

(tick)

operation

create

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

  • Query operations: findOne, listAll, count
  • Write operations: create
  • Delete operations: remove

(tick)

 

query

none

Combined with the query strategy parameters to create the query used to search for new files.

 

 

(tick)

queryStrategy

TimeStamp

The strategy that is used to find new files. Can be one of:

  • TimeStamp - files that are uploaded after the Consumer starts are processed

  • PersistentTimestamp - Like TimeStamp, but the last timestamp used is persisted to a collection so when the Consumer restarts, it can resume where it left off

  • FileAttribute - finds files that do NOT have the give attribute. After processing, it adds the attribute.

  • TimestampAndFileAttribute - finds files that are newer than the TimeStamp and are missing the attribute

  • PersistentTimestampAndFileAttribute

 

(tick)

persistentTSCollection

camel-timestamps

When using persistent timestamps, this is the Collection that the timestamp is stored into.

 (tick)

persistenTSObject

camel-timestamp

When using persistent timestamps, this is the object ID for the timestamp object. Each consumer can have it's own timestamp ID stored in a common Collection

 (tick)

fileAttributeName

camel-processed

When using FileAttribute, this is the name of the attribute that is used. When a file is about to be processed, the attribute is set to "processing" and then set to "done" when the file processing is done.

 (tick)

delay

500 (ms)

The delay between polling GridFS for new files

 (tick)

initialDelay

1000 (ms)

The initial delay before the first poll

 (tick)

Configuration of database in Spring XML

...

Returns the total number of file in the collection, returning an Integer as the OUT message body.

Code Block
// from("direct:count").to("gridfs?database=tickets&operation=count");
Integer result = template.requestBodyAndHeader("direct:count", "irrelevantBody");
assertTrue("Result is not of type Long", result instanceof Integer);

...