RedisPersister is a JMS message consumer that persists the content of the messages to a Redis data store. It listens to the XQueue aad receives JMS nessages as the requests. Either it updates certain datasets on a remote Redis server with the content of the messages, or it queries datasets from a remote Redis server according to the content of the messages and puts the results back to the messages in their body. RedisPersister 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 RedisPersister.
Property Name | Data Type | Requirement | Description | Examples |
---|---|---|---|---|
DefaultKeyName | string | optional | default name of the dataset | mylist |
KeyField | string | optional | field name for the name of the dataset | (default: REDIS) |
QueryField | string | optional | field name for Redis query statement | (default: Query) |
RCField | string | optional | field name to store return code (0 for success) | (default: ReturnCode) |
ResultField | string | optional | field name to store the number of items returned | (default: QueryResult) |
ResultType | integer | optional | type of the result | 8 for JSON (default: 1) |
Currently, RedisPersister only supports operations of put, pub, query and update.
Here is an example of RedisPersister:
{ "Name": "pstr_redis", "ClassName": "org.qbroker.persister.RedisPersister", "URI": "redis://localhost:6379/", "LinkName": "pool", "Operation": "put", "DefaultKeyName": "mylist", "XAMode": "1", "DisplayMask": "6", "StringProperty": { "REDIS": "" } }where it rpushes the message body to a list specified by the field of REDIS.