Versions Compared

Key

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

...

from("direct:start").to("dropbox://del?accessToken=XXX&clientIdentifier=XXX&remotePath=/root/folder1/file1.tar.gz").to("mock:result");

Result Message Headers

The following headers are set on exchanges during message transport.result:

Wiki Markup
{div:class=confluenceTableSmall}
|| Property || Value ||
| {{CouchDbDatabaseDELETED_PATH}} | thename databaseof the path messagedeleted cameon fromdropbox |
| {{CouchDbSeq}} | the couchdb changeset sequence number of the update / delete message |
| {{CouchDbId}} | the couchdb document id {div}

Result Message Body

The following objects are set on message body result:

Wiki Markup
{div:class=confluenceTableSmall}
|| Object type || Description ||
| {{CouchDbRevString}} | the couchdb document revision |
| {{CouchDbMethod}} | the method (delete / update) |
{div}

Headers are set by the consumer once the message is received. The producer will also set the headers for downstream processors once the insert/update has taken place. Any headers set prior to the producer are ignored. That means for example, if you set CouchDbId as a header, it will not be used as the id for insertion, the id of the document will still be used.

Message Body

The component will use the message body as the document to be inserted. If the body is an instance of String, then it will be marshalled into a GSON object before insert. This means that the string must be valid JSON or the insert / update will fail. If the body is an instance of a com.google.gson.JsonElement then it will be inserted as is. Otherwise the producer will throw an exception of unsupported body type.

Samples

For example if you wish to consume all inserts, updates and deletes from a CouchDB instance running locally, on port 9999 then you could use the following:

Code Block
from("couchdb:http://localhost:9999").process(someProcessor);

If you were only interested in deletes, then you could use the following

Code Block
from("couchdb:http://localhost:9999?updates=false").process(someProcessor);

If you wanted to insert a message as a document, then the body of the exchange is used

Code Block
from("someProducingEndpoint").process(someProcessor).to("couchdb:http://localhost:9999")
name of the path deleted on dropbox |
{div}