@redkern/node-red-redis 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +188 -0
  3. package/README.md +283 -2
  4. package/SECURITY.md +11 -0
  5. package/examples/commands-and-pubsub.json +15 -0
  6. package/examples/streams-at-least-once.json +23 -0
  7. package/lib/completion.js +79 -0
  8. package/lib/control.js +59 -0
  9. package/lib/denylist.js +118 -0
  10. package/lib/dlq.js +49 -0
  11. package/lib/format.js +122 -0
  12. package/lib/inflight.js +131 -0
  13. package/lib/list-consumer.js +125 -0
  14. package/lib/metrics.js +85 -0
  15. package/lib/node-helpers.js +77 -0
  16. package/lib/palette.js +168 -0
  17. package/lib/slot.js +33 -0
  18. package/lib/stream-consumer.js +669 -0
  19. package/nodes/icons/redkern-redis-command.svg +4 -0
  20. package/nodes/icons/redkern-redis-list-in.svg +4 -0
  21. package/nodes/icons/redkern-redis-multi.svg +4 -0
  22. package/nodes/icons/redkern-redis-scan.svg +4 -0
  23. package/nodes/icons/redkern-redis-stream-ack.svg +4 -0
  24. package/nodes/icons/redkern-redis-stream-claim.svg +4 -0
  25. package/nodes/icons/redkern-redis-stream-control.svg +4 -0
  26. package/nodes/icons/redkern-redis-stream-gc.svg +4 -0
  27. package/nodes/icons/redkern-redis-stream-in.svg +4 -0
  28. package/nodes/icons/redkern-redis-stream-metrics.svg +4 -0
  29. package/nodes/icons/redkern-redis-stream-out.svg +4 -0
  30. package/nodes/icons/redkern-redis-subscribe.svg +4 -0
  31. package/nodes/icons/redkern-redis.svg +4 -0
  32. package/nodes/locales/en-US/redkern-redis.html +299 -0
  33. package/nodes/locales/en-US/redkern-redis.json +308 -0
  34. package/nodes/redkern-redis-command.js +49 -0
  35. package/nodes/redkern-redis-config.js +273 -0
  36. package/nodes/redkern-redis-list-in.js +88 -0
  37. package/nodes/redkern-redis-multi.js +75 -0
  38. package/nodes/redkern-redis-scan.js +105 -0
  39. package/nodes/redkern-redis-stream-ack.js +66 -0
  40. package/nodes/redkern-redis-stream-claim.js +60 -0
  41. package/nodes/redkern-redis-stream-control.js +35 -0
  42. package/nodes/redkern-redis-stream-gc.js +77 -0
  43. package/nodes/redkern-redis-stream-in.js +155 -0
  44. package/nodes/redkern-redis-stream-metrics.js +85 -0
  45. package/nodes/redkern-redis-stream-out.js +55 -0
  46. package/nodes/redkern-redis-subscribe.js +51 -0
  47. package/nodes/redkern-redis.html +1126 -0
  48. package/nodes/redkern-redis.js +31 -0
  49. package/package.json +76 -4
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream claim</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M27 45a7 7 0 1 0 1 7 M28 40v5h-5"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream control</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M10 43v12 M15 43v12 M21 43l9 6l-9 6z"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream gc</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M12 52a3 3 0 1 0 6 0a3 3 0 1 0 -6 0 M22 52a3 3 0 1 0 6 0a3 3 0 1 0 -6 0 M17 50l11 -9 M23 50l-11 -9"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream in</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M7 48h1 M11 48h1 M15 48h14 M25 44l4 4l-4 4"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream metrics</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M12 56v-5 M20 56v-11 M28 56v-8"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Stream out</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M20 56v-14 M15 46l5 -5l5 5"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>Subscribe</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M19 49a1 1 0 1 0 2 0a1 1 0 1 0 -2 0 M15 44a7 7 0 0 0 0 10 M25 44a7 7 0 0 1 0 10 M11 41a12 12 0 0 0 0 16 M29 41a12 12 0 0 1 0 16"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="60" viewBox="0 0 40 60">
2
+ <title>redkern redis</title>
3
+ <path fill="none" stroke="#ffffff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="M8 13a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 21a12 4 0 1 0 24 0a12 4 0 1 0 -24 0 M8 29a12 4 0 1 0 24 0a12 4 0 1 0 -24 0"/>
4
+ </svg>
@@ -0,0 +1,299 @@
1
+ <script type="text/html" data-help-name="redkern-redis-config">
2
+ <p>Connection to a standalone Redis or a Redis Cluster, shared by the nodes that use it.</p>
3
+ <h3>Details</h3>
4
+ <p>Each config node opens at most one shared connection (auto-pipelined, no offline queue), one subscriber connection when Pub/Sub nodes use it, and one blocking connection per stream in and list in node. The formula and the live numbers are in the Reliability tab and in <code>redkern_redis_connections{role}</code>.</p>
5
+ <p>Host, port, username and timeouts can be <code>${VAR}</code>: the value comes from the environment while the flow in Git shows its source. The password is a credential and never leaves the runtime.</p>
6
+ <p>In cluster mode the database is always 0, and a stream with a DLQ must share a hash tag with it, for example <code>orders:{eu}</code> and <code>orders:{eu}:dlq</code>.</p>
7
+ <p>TLS always verifies the server certificate. A private CA is added with <code>NODE_EXTRA_CA_CERTS</code>; set TLS server name when the certificate is issued for another name than the host. A rejected certificate gives a red status.</p>
8
+ <h3>References</h3>
9
+ <ul><li><a href="https://github.com/redkern/node-red-redis#config" target="_blank" rel="noopener noreferrer">README: config</a></li></ul>
10
+ </script>
11
+
12
+ <script type="text/html" data-help-name="redkern-redis-command">
13
+ <p>Runs one Redis command on the shared connection.</p>
14
+ <h3>Inputs</h3>
15
+ <dl class="message-properties">
16
+ <dt class="optional">args <span class="property-type">array</span></dt>
17
+ <dd>Command arguments, for example <code>["user:1", "name"]</code>.</dd>
18
+ <dt class="optional">command <span class="property-type">string | array</span></dt>
19
+ <dd>Replaces the configured command when "Allow msg.command" is on.</dd>
20
+ </dl>
21
+ <h3>Outputs</h3>
22
+ <ol class="node-ports">
23
+ <li>Result
24
+ <dl class="message-properties">
25
+ <dt>payload <span class="property-type">any</span></dt>
26
+ <dd>Redis reply.</dd>
27
+ <dt>redkern.redis <span class="property-type">object</span></dt>
28
+ <dd>Palette metadata. Other palettes keep their own keys under msg.redkern.</dd>
29
+ </dl>
30
+ </li>
31
+ <li>Error
32
+ <dl class="message-properties">
33
+ <dt>error <span class="property-type">object</span></dt>
34
+ <dd>With "Send errors to a separate output": { message, code, source }.</dd>
35
+ </dl>
36
+ </li>
37
+ </ol>
38
+ <h3>Details</h3>
39
+ <p>Commands from the denylist (<code>FLUSHALL</code>, <code>FLUSHDB</code>, <code>CONFIG</code>, <code>SHUTDOWN</code>, <code>SWAPDB</code>, <code>FAILOVER</code>, <code>CLIENT KILL</code>, admin <code>CLUSTER</code> subcommands and similar) are rejected unless the denylist is disabled. Scripts (<code>EVAL</code>, <code>FCALL</code>) are rejected from <code>msg.command</code>; set <code>EVAL</code> as the node command and pass the script in <code>msg.args</code>. Blocking commands such as <code>BLPOP</code> and commands that change the connection such as <code>CLIENT REPLY</code> are always rejected, because they would stall or break the shared connection.</p>
40
+ <p>Up to Concurrency messages run at the same time and up to Max queue wait; a full queue fails the message with <code>INPUT_QUEUE_FULL</code>. With Concurrency above 1 the order of replies is not guaranteed.</p>
41
+ <h3>References</h3>
42
+ <ul><li><a href="https://github.com/redkern/node-red-redis#command" target="_blank" rel="noopener noreferrer">README: command</a></li></ul>
43
+ </script>
44
+
45
+ <script type="text/html" data-help-name="redkern-redis-multi">
46
+ <p>Runs several commands in one MULTI/EXEC transaction.</p>
47
+ <h3>Inputs</h3>
48
+ <dl class="message-properties">
49
+ <dt class="optional">commands <span class="property-type">array</span></dt>
50
+ <dd>Array of commands, each an array: <code>[["SET","k","v"],["INCR","c"]]</code>. Overrides the configured list.</dd>
51
+ </dl>
52
+ <h3>Outputs</h3>
53
+ <ol class="node-ports">
54
+ <li>Results
55
+ <dl class="message-properties">
56
+ <dt>payload <span class="property-type">array</span></dt>
57
+ <dd>One reply per command.</dd>
58
+ <dt>redkern.redis <span class="property-type">object</span></dt>
59
+ <dd>Palette metadata. Other palettes keep their own keys under msg.redkern.</dd>
60
+ </dl>
61
+ </li>
62
+ <li>Error
63
+ <dl class="message-properties">
64
+ <dt>error <span class="property-type">object</span></dt>
65
+ <dd>With "Send errors to a separate output": { message, code, source }.</dd>
66
+ </dl>
67
+ </li>
68
+ </ol>
69
+ <h3>Details</h3>
70
+ <p>The denylist applies to every command; scripts are rejected in <code>msg.commands</code>. If any command fails, the message fails with all errors listed.</p>
71
+ <h3>References</h3>
72
+ <ul><li><a href="https://github.com/redkern/node-red-redis#multi" target="_blank" rel="noopener noreferrer">README: multi</a></li></ul>
73
+ </script>
74
+
75
+ <script type="text/html" data-help-name="redkern-redis-scan">
76
+ <p>Walks SCAN, HSCAN, SSCAN or ZSCAN to the end, up to a result limit and a timeout.</p>
77
+ <h3>Inputs</h3>
78
+ <dl class="message-properties">
79
+ <dt class="optional">key <span class="property-type">string</span></dt>
80
+ <dd>Key for HSCAN, SSCAN and ZSCAN.</dd>
81
+ <dt class="optional">match <span class="property-type">string</span></dt>
82
+ <dd>Overrides the configured pattern.</dd>
83
+ <dt class="optional">scanType <span class="property-type">string</span></dt>
84
+ <dd>Overrides the configured type.</dd>
85
+ </dl>
86
+ <h3>Outputs</h3>
87
+ <dl class="message-properties">
88
+ <dt>payload <span class="property-type">array</span></dt>
89
+ <dd>Keys or members; HSCAN and ZSCAN return <code>{ member, value }</code>.</dd>
90
+ <dt>redkern.redis.scan <span class="property-type">object</span></dt>
91
+ <dd><code>{ type, complete, truncated, timedOut, count }</code>.</dd>
92
+ </dl>
93
+ <h3>Details</h3>
94
+ <p>In cluster mode SCAN visits every master. A result cut by the limit or the timeout has <code>complete: false</code> and a yellow status.</p>
95
+ <h3>References</h3>
96
+ <ul><li><a href="https://github.com/redkern/node-red-redis#scan" target="_blank" rel="noopener noreferrer">README: scan</a></li></ul>
97
+ </script>
98
+
99
+ <script type="text/html" data-help-name="redkern-redis-subscribe">
100
+ <p>Receives Redis Pub/Sub messages from channels or patterns.</p>
101
+ <h3>Outputs</h3>
102
+ <dl class="message-properties">
103
+ <dt>topic <span class="property-type">string</span></dt>
104
+ <dd>Channel the message came from.</dd>
105
+ <dt>payload <span class="property-type">string</span></dt>
106
+ <dd>Message text.</dd>
107
+ <dt>pattern <span class="property-type">string</span></dt>
108
+ <dd>Matching pattern in pattern mode.</dd>
109
+ <dt>redkern.redis <span class="property-type">object</span></dt>
110
+ <dd>Palette metadata. Other palettes keep their own keys under msg.redkern.</dd>
111
+ </dl>
112
+ <h3>Details</h3>
113
+ <p>All subscribe nodes of one config node share one subscriber connection. After a reconnect the subscriptions are restored automatically. Messages published while the connection is down are lost, as Pub/Sub has no history; use Streams when every message matters.</p>
114
+ <h3>References</h3>
115
+ <ul><li><a href="https://github.com/redkern/node-red-redis#subscribe" target="_blank" rel="noopener noreferrer">README: subscribe</a></li></ul>
116
+ </script>
117
+
118
+ <script type="text/html" data-help-name="redkern-redis-list-in">
119
+ <p>Pops elements from a Redis list with BLPOP or BRPOP on its own connection.</p>
120
+ <h3>Outputs</h3>
121
+ <dl class="message-properties">
122
+ <dt>topic <span class="property-type">string</span></dt>
123
+ <dd>List key.</dd>
124
+ <dt>payload <span class="property-type">string</span></dt>
125
+ <dd>Popped element.</dd>
126
+ <dt>redkern.redis <span class="property-type">object</span></dt>
127
+ <dd>Palette metadata. Other palettes keep their own keys under msg.redkern.</dd>
128
+ </dl>
129
+ <h3>Details</h3>
130
+ <p>A transitional node for list queues; it will be deprecated once queues move to Streams. Popping removes the element from the list, so an element that is being processed when the pod dies is lost. There is no reliable BLMOVE mode: delivery guarantees come from stream in.</p>
131
+ <p>Prefetch limits elements in the flow at once. With 1 the next element is popped only after the previous message completed in the flow; with 0 the node pops without limit, as the legacy subscribe node did. A message that never completes frees its slot after the release timeout.</p>
132
+ <h3>References</h3>
133
+ <ul><li><a href="https://github.com/redkern/node-red-redis#list-in" target="_blank" rel="noopener noreferrer">README: list-in</a></li></ul>
134
+ </script>
135
+
136
+ <script type="text/html" data-help-name="redkern-redis-stream-in">
137
+ <p>Reads a Redis stream through a consumer group with at-least-once delivery, DLQ and backpressure.</p>
138
+ <h3>Outputs</h3>
139
+ <dl class="message-properties">
140
+ <dt>payload <span class="property-type">object | array</span></dt>
141
+ <dd>Entry fields; JSON objects and arrays written by stream out are restored. An array with batching.</dd>
142
+ <dt>redkern.redis <span class="property-type">object</span></dt>
143
+ <dd><code>{ stream, group, id, consumer, deliveries }</code>; <code>id</code> and <code>deliveries</code> are arrays with batching. stream ack reads it.</dd>
144
+ </dl>
145
+ <h3>Details</h3>
146
+ <p>With manual ACK every entry stays in the PEL until stream ack confirms it. After a pod crash, or when processing takes longer than Reclaim idle, the entry is delivered again, so downstream processing must be idempotent; <code>redkern_redis_redeliveries_total</code> counts repeats. Only pause/resume and a regular redeploy are free of duplicates.</p>
147
+ <p>On start the node recovers its own PEL through a cursor before reading new entries, then reclaims entries abandoned by dead consumers with XAUTOCLAIM. An entry delivered more than Max deliveries times moves to the dead-letter stream atomically with its ACK.</p>
148
+ <p>Backpressure stops reading when the own PEL (or the group PEL) reaches Max pending. Pause, resume, drain and status come from stream control, the admin API and the preStop drain route on port 9551.</p>
149
+ <h3>References</h3>
150
+ <ul><li><a href="https://github.com/redkern/node-red-redis#stream-in" target="_blank" rel="noopener noreferrer">README: stream-in</a></li></ul>
151
+ </script>
152
+
153
+ <script type="text/html" data-help-name="redkern-redis-stream-out">
154
+ <p>Adds msg.payload to a Redis stream with XADD.</p>
155
+ <h3>Inputs</h3>
156
+ <dl class="message-properties">
157
+ <dt>payload <span class="property-type">object</span></dt>
158
+ <dd>Flat object of fields; nested objects and arrays are stored as JSON.</dd>
159
+ <dt class="optional">stream <span class="property-type">string</span></dt>
160
+ <dd>Stream key when "Allow msg.stream" is on.</dd>
161
+ </dl>
162
+ <h3>Outputs</h3>
163
+ <ol class="node-ports">
164
+ <li>Added
165
+ <dl class="message-properties">
166
+ <dt>redkern.redis.xadd <span class="property-type">object</span></dt>
167
+ <dd><code>{ stream, id }</code> of the new entry. Other keys of msg.redkern.redis stay, so the original entry can still be acknowledged.</dd>
168
+ </dl>
169
+ </li>
170
+ <li>Error
171
+ <dl class="message-properties">
172
+ <dt>error <span class="property-type">object</span></dt>
173
+ <dd>With "Send errors to a separate output": { message, code, source }.</dd>
174
+ </dl>
175
+ </li>
176
+ </ol>
177
+ <h3>Details</h3>
178
+ <p>MAXLEN trimming can remove entries still pending in a consumer group and needs the explicit "Allow trimming" option.</p>
179
+ <h3>References</h3>
180
+ <ul><li><a href="https://github.com/redkern/node-red-redis#stream-out" target="_blank" rel="noopener noreferrer">README: stream-out</a></li></ul>
181
+ </script>
182
+
183
+ <script type="text/html" data-help-name="redkern-redis-stream-ack">
184
+ <p>Acknowledges stream entries delivered by stream in.</p>
185
+ <h3>Inputs</h3>
186
+ <dl class="message-properties">
187
+ <dt>redkern.redis <span class="property-type">object</span></dt>
188
+ <dd><code>id</code> (string or array for a batch), <code>stream</code> and <code>group</code> as set by stream in.</dd>
189
+ <dt class="optional">streamId <span class="property-type">string | array</span></dt>
190
+ <dd>Legacy ID field, used when msg.redkern.redis is missing.</dd>
191
+ <dt class="optional">deleteAfterAck <span class="property-type">boolean</span></dt>
192
+ <dd>Overrides "XDEL after ACK".</dd>
193
+ </dl>
194
+ <h3>Outputs</h3>
195
+ <dl class="message-properties">
196
+ <dt>redkern.redis.ack <span class="property-type">object</span></dt>
197
+ <dd><code>{ acked, deleted }</code>. Only with "Pass the message on".</dd>
198
+ </dl>
199
+ <h3>Details</h3>
200
+ <p>A batch is acknowledged with one XACK. The node also releases the entries in the in-flight registry of stream in, which lets it read more under backpressure.</p>
201
+ <h3>References</h3>
202
+ <ul><li><a href="https://github.com/redkern/node-red-redis#stream-ack" target="_blank" rel="noopener noreferrer">README: stream-ack</a></li></ul>
203
+ </script>
204
+
205
+ <script type="text/html" data-help-name="redkern-redis-stream-claim">
206
+ <p>Claims stream entries idle longer than a threshold with XAUTOCLAIM.</p>
207
+ <h3>Inputs</h3>
208
+ <dl class="message-properties">
209
+ <dt class="optional">stream <span class="property-type">string</span></dt>
210
+ <dd>Overrides the stream key.</dd>
211
+ <dt class="optional">group <span class="property-type">string</span></dt>
212
+ <dd>Overrides the group.</dd>
213
+ <dt class="optional">consumer <span class="property-type">string</span></dt>
214
+ <dd>Consumer that receives the entries.</dd>
215
+ <dt class="optional">minIdleMs <span class="property-type">number</span></dt>
216
+ <dd>Overrides Min idle.</dd>
217
+ </dl>
218
+ <h3>Outputs</h3>
219
+ <dl class="message-properties">
220
+ <dt>payload <span class="property-type">array</span></dt>
221
+ <dd><code>{ id, payload }</code> per claimed entry.</dd>
222
+ <dt>redkern.redis.claim <span class="property-type">object</span></dt>
223
+ <dd><code>{ stream, group, consumer, complete, count }</code>.</dd>
224
+ </dl>
225
+ <h3>Details</h3>
226
+ <p>stream in reclaims entries by itself; this node is for manual recovery flows.</p>
227
+ <h3>References</h3>
228
+ <ul><li><a href="https://github.com/redkern/node-red-redis#stream-claim" target="_blank" rel="noopener noreferrer">README: stream-claim</a></li></ul>
229
+ </script>
230
+
231
+ <script type="text/html" data-help-name="redkern-redis-stream-gc">
232
+ <p>Removes idle consumers with an empty PEL from a consumer group.</p>
233
+ <h3>Inputs</h3>
234
+ <dl class="message-properties">
235
+ <dt class="optional">stream <span class="property-type">string</span></dt>
236
+ <dd>Overrides the stream key.</dd>
237
+ <dt class="optional">group <span class="property-type">string</span></dt>
238
+ <dd>Overrides the group.</dd>
239
+ <dt class="optional">minIdleMs <span class="property-type">number</span></dt>
240
+ <dd>Overrides Min idle.</dd>
241
+ </dl>
242
+ <h3>Outputs</h3>
243
+ <dl class="message-properties">
244
+ <dt>payload <span class="property-type">object</span></dt>
245
+ <dd><code>{ removed, kept }</code> with consumer names and idle times.</dd>
246
+ </dl>
247
+ <h3>Details</h3>
248
+ <p>Every pod restart creates a new consumer name. The check for an empty PEL and the delete run in one Lua script, so a consumer that read entries in between is never deleted.</p>
249
+ <h3>References</h3>
250
+ <ul><li><a href="https://github.com/redkern/node-red-redis#stream-gc" target="_blank" rel="noopener noreferrer">README: stream-gc</a></li></ul>
251
+ </script>
252
+
253
+ <script type="text/html" data-help-name="redkern-redis-stream-metrics">
254
+ <p>Samples a consumer group: PEL, lag, consumers and DLQ length.</p>
255
+ <h3>Inputs</h3>
256
+ <dl class="message-properties">
257
+ <dt class="optional">stream <span class="property-type">string</span></dt>
258
+ <dd>Overrides the stream key.</dd>
259
+ <dt class="optional">group <span class="property-type">string</span></dt>
260
+ <dd>Overrides the group.</dd>
261
+ <dt class="optional">deadLetterStream <span class="property-type">string</span></dt>
262
+ <dd>Overrides the DLQ stream.</dd>
263
+ </dl>
264
+ <h3>Outputs</h3>
265
+ <dl class="message-properties">
266
+ <dt>payload <span class="property-type">object</span></dt>
267
+ <dd><code>{ stream, group, pending, lag, consumers, deadLetterLength, lastDeliveredId, sampledAt }</code>.</dd>
268
+ </dl>
269
+ <h3>Details</h3>
270
+ <p>Each sample also updates the palette metrics registry. With the prometheus palette the metrics appear in its /metrics; without it they are served on the internal port 9551 when <code>REDKERN_REDIS_METRICS_TOKEN</code> is set.</p>
271
+ <h3>References</h3>
272
+ <ul><li><a href="https://github.com/redkern/node-red-redis#metrics" target="_blank" rel="noopener noreferrer">README: metrics</a></li></ul>
273
+ </script>
274
+
275
+ <script type="text/html" data-help-name="redkern-redis-stream-control">
276
+ <p>Pauses, resumes, drains or reports stream in consumers of this runtime.</p>
277
+ <h3>Inputs</h3>
278
+ <dl class="message-properties">
279
+ <dt>payload.action <span class="property-type">string</span></dt>
280
+ <dd><code>pause</code>, <code>resume</code>, <code>drain</code> or <code>status</code>, when the node action is "from msg".</dd>
281
+ <dt class="optional">payload.stream <span class="property-type">string</span></dt>
282
+ <dd>Only consumers of this stream.</dd>
283
+ <dt class="optional">payload.group <span class="property-type">string</span></dt>
284
+ <dd>Only consumers of this group.</dd>
285
+ <dt class="optional">payload.nodeId <span class="property-type">string</span></dt>
286
+ <dd>Only this stream in node.</dd>
287
+ <dt class="optional">payload.drainTimeoutMs <span class="property-type">number</span></dt>
288
+ <dd>Drain timeout.</dd>
289
+ </dl>
290
+ <h3>Outputs</h3>
291
+ <dl class="message-properties">
292
+ <dt>payload <span class="property-type">object</span></dt>
293
+ <dd><code>{ action, target, consumers, drained }</code>.</dd>
294
+ </dl>
295
+ <h3>Details</h3>
296
+ <p>Drain stops reading new entries, sends entries already reserved and waits for an empty own PEL. The same commands are available over HTTP: GET/POST /redkern/redis/streams/status and /control on the admin API, and the preStop drain route on port 9551.</p>
297
+ <h3>References</h3>
298
+ <ul><li><a href="https://github.com/redkern/node-red-redis#control" target="_blank" rel="noopener noreferrer">README: control</a></li></ul>
299
+ </script>