• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Dec-2021-

COPYINGH A D15-Sep-202134.2 KiB675553

Makefile.amH A D15-Sep-2021244 86

Makefile.inH A D15-Dec-202125.3 KiB792702

READMEH A D15-Sep-20212.1 KiB8157

imhiredis.cH A D15-Sep-202142.9 KiB1,5151,036

README

1Redis Input Plugin using hiredis library
2
3REQUIREMENTS:
4
5* hiredis ( https://github.com/redis/hiredis.git )
6
7USAGE:
8
9This plugin has two current "modes" that it supports:
10
111. "queue"
12The queue mode will LPOP or RPOP your message from a redis list.
13Following parameters are required:
14 - mode: Set mode to "queue" to enable the queue mode
15 - key: The key to xPOP on
16 - server: The name or IP address of the redis server
17 - port: The redis listening port
18
19Following parameters are optional:
20 - password: If set, the plugin will issue an "AUTH" command before calling xPOP
21 - uselpop: If set to "1", LPOP will be used instead of default RPOP
22
23Redis pipelining is used inside the workerthread, with a hardcoded batch size of #10.
24
25Imhiredis will query Redis every second to see if entries are in the list, if that's the case they will be dequeued
26continuously by batches of 10 until none remains.
27
28Due to its balance between polling interval and pipelining and its use of lists, this mode is quite performant and reliable.
29However, due to the 1 second polling frequency, one may consider using the `subscribe` mode instead if very low latency is required.
30
31```
32module(load="imhiredis")
33
34input(
35    type="imhiredis"
36    mode="queue"
37    key="vulture"
38    server="127.0.0.1"
39    port="6379"
40    uselpop="1"
41    password="foobar"
42)
43```
44
45
46
472. "subscribe"
48The subscribe mode will SUBSCRIBE to a redis channel. The "key"
49parameter is required and will be used for the subscribe channel.
50
51Following parameters are required:
52 - mode: Set mode to "subscribe" to enable the subscribe mode
53 - key: The key to subscribe to (aka the "channel")
54 - server: The name or IP address of the redis server
55 - port: The redis listening port
56
57Following parameters are optional:
58 - password: If set, the plugin will issue an "AUTH" command before listening to a channel
59 - uselpop: If set to "1", LPOP will be used instead of default RPOP
60
61
62```
63module(load="imhiredis")
64
65input(
66    type="imhiredis"
67    mode="subscribe"
68    key="vulture"
69    server="127.0.0.1"
70    port="6379"
71    password="foobar"
72)
73```
74
75
76TODO
77* TLS support
78* detect master/replicas relationships and follow them
79
80
81