Skip to content

Commit c3d5e2e

Browse files
committed
Added draft of pattern in configuration
1 parent d821baf commit c3d5e2e

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

articles/azure-functions/functions-bindings-cache-trigger-redispubsub.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,15 @@ public class SimplePubSubTrigger {
218218
@RedisPubSubTrigger(
219219
name = "req",
220220
connection = "redisConnectionString",
221-
channel = "pubsubTest")
221+
channel = "pubsubTest",
222+
pattern = false)
222223
String message,
223224
final ExecutionContext context) {
224225
context.getLogger().info(message);
225226
}
226227
}
228+
229+
227230
```
228231

229232
This sample listens to any keyspace notifications for the key `myKey`.
@@ -241,12 +244,14 @@ public class KeyspaceTrigger {
241244
@RedisPubSubTrigger(
242245
name = "req",
243246
connection = "redisConnectionString",
244-
channel = "__keyspace@0__:keyspaceTest")
247+
channel = "__keyspace@0__:keyspaceTest",
248+
pattern = false)
245249
String message,
246250
final ExecutionContext context) {
247251
context.getLogger().info(message);
248252
}
249253
}
254+
250255
```
251256

252257
This sample listens to any `keyevent` notifications for the delete command [`DEL`](https://redis.io/commands/del/).
@@ -264,7 +269,8 @@ public class KeyeventTrigger {
264269
@RedisPubSubTrigger(
265270
name = "req",
266271
connection = "redisConnectionString",
267-
channel = "__keyevent@0__:del")
272+
channel = "__keyevent@0__:del",
273+
pattern = false)
268274
String message,
269275
final ExecutionContext context) {
270276
context.getLogger().info(message);
@@ -298,6 +304,7 @@ Here's binding data to listen to the channel `pubsubTest`.
298304
"type": "redisPubSubTrigger",
299305
"connection": "redisConnectionString",
300306
"channel": "pubsubTest",
307+
"pattern": false,
301308
"name": "message",
302309
"direction": "in"
303310
}
@@ -315,6 +322,7 @@ Here's binding data to listen to keyspace notifications for the key `keyspaceTes
315322
"type": "redisPubSubTrigger",
316323
"connection": "redisConnectionString",
317324
"channel": "__keyspace@0__:keyspaceTest",
325+
"pattern": false,
318326
"name": "message",
319327
"direction": "in"
320328
}
@@ -332,6 +340,7 @@ Here's binding data to listen to `keyevent` notifications for the delete command
332340
"type": "redisPubSubTrigger",
333341
"connection": "redisConnectionString",
334342
"channel": "__keyevent@0__:del",
343+
"pattern": false,
335344
"name": "message",
336345
"direction": "in"
337346
}
@@ -372,6 +381,7 @@ Here's binding data to listen to the channel `pubsubTest`.
372381
"type": "redisPubSubTrigger",
373382
"connection": "redisConnectionString",
374383
"channel": "pubsubTest",
384+
"pattern": false,
375385
"name": "message",
376386
"direction": "in"
377387
}
@@ -389,6 +399,7 @@ Here's binding data to listen to keyspace notifications for the key `keyspaceTes
389399
"type": "redisPubSubTrigger",
390400
"connection": "redisConnectionString",
391401
"channel": "__keyspace@0__:keyspaceTest",
402+
"pattern": false,
392403
"name": "message",
393404
"direction": "in"
394405
}
@@ -406,6 +417,7 @@ Here's binding data to listen to `keyevent` notifications for the delete command
406417
"type": "redisPubSubTrigger",
407418
"connection": "redisConnectionString",
408419
"channel": "__keyevent@0__:del",
420+
"pattern": false,
409421
"name": "message",
410422
"direction": "in"
411423
}
@@ -443,6 +455,7 @@ Here's binding data to listen to the channel `pubsubTest`.
443455
"type": "redisPubSubTrigger",
444456
"connection": "redisConnectionString",
445457
"channel": "pubsubTest",
458+
"pattern": false,
446459
"name": "message",
447460
"direction": "in"
448461
}
@@ -460,6 +473,7 @@ Here's binding data to listen to keyspace notifications for the key `keyspaceTes
460473
"type": "redisPubSubTrigger",
461474
"connection": "redisConnectionString",
462475
"channel": "__keyspace@0__:keyspaceTest",
476+
"pattern": false,
463477
"name": "message",
464478
"direction": "in"
465479
}
@@ -477,6 +491,7 @@ Here's binding data to listen to `keyevent` notifications for the delete command
477491
"type": "redisPubSubTrigger",
478492
"connection": "redisConnectionString",
479493
"channel": "__keyevent@0__:del",
494+
"pattern": false,
480495
"name": "message",
481496
"direction": "in"
482497
}
@@ -520,13 +535,14 @@ Here's binding data to listen to `keyevent` notifications for the delete command
520535

521536
## Configuration
522537

523-
| function.json property | Description | Required | Default |
524-
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| :-----:| -----:|
525-
| `type` | Trigger type. For the pub sub trigger, the type is `redisPubSubTrigger`. | Yes | |
526-
| `connection` | The name of the [application setting](functions-how-to-use-azure-function-app-settings.md#settings) that contains the cache connection string, such as: `<cacheName>.redis.cache.windows.net:6380,password...`| Yes | |
527-
| `channel` | Name of the pub sub channel that is being subscribed to | Yes | |
528-
| `name` | Name of the variable holding the value returned by the function. | Yes | |
529-
| `direction` | Must be set to `in`. | Yes | |
538+
| function.json property | Description | Required | Default |
539+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------:| -------:|
540+
| `type` | Trigger type. For the pub sub trigger, the type is `redisPubSubTrigger`. | Yes | |
541+
| `connection` | The name of the [application setting](functions-how-to-use-azure-function-app-settings.md#settings) that contains the cache connection string, such as: `<cacheName>.redis.cache.windows.net:6380,password...` | Yes | |
542+
| `channel` | Name of the pub sub channel that is being subscribed to | Yes | |
543+
| `pattern` | If the channel is a pattern. | | |
544+
| `name` | Name of the variable holding the value returned by the function. | Yes | |
545+
| `direction` | Must be set to `in`. | Yes | |
530546

531547
::: zone-end
532548

0 commit comments

Comments
 (0)