DocumentReceiver is a JMS message producer that queris a document-oriented database and converts the result into a JMS Message. It puts the message to the XQueue as the output. On the other end of the XQueue, the node is supposed to receive the message. DocumentReceiver supports flow control and allows object control from its owner. It is fault tolerant with retry and idle options.
Apart from the common properties, there are many implementation specific properties for DocumentReceiver. Most of them depends on the schemes.
Property Name | Data Type | Requirement | Description | Examples |
---|---|---|---|---|
Retry | integer | optional | number of retry before to give up the delivery | 2 |
RCField | string | optional | field name to store return code (0 for success) | (default: ReturnCode) |
Template | string | optional | template to build the request |
Currently, DocumentReceiver supports MongoDB and Riak, in terms of the scheme of mongodb or riak. In the near future, it will support Cassandra. Here is the matrix of supported operations for various schemes:
Scheme | Operation | Description |
---|---|---|
mongodb | findone | query documents from a collection |
riak | fetch | query documents from a bucket |
Here is an example of DocumentReceiver:
{ "Name": "rcvr_doc", "ClassName": "org.qbroker.receiver.DocumentReceiver", "URI": "mongodb://localhost/test", "LinkName": "root", "Operation": "findone", "XAMode": "1", "Retry": "1", "DisplayMask": "6", "DependencyGroup": [{ "Dependency": [{ "Name": "time_window", "URI": "file:///var/log/nginx/access.log", "Type": "FileMonitor" }] }] }where it sends the query to test database of the MongoDB server and puts the query result to the message body.