Skip to content

Commit 7eeab77

Browse files
authored
Update cache-how-to-functions.md
Updated syntax
1 parent a632338 commit 7eeab77

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

articles/azure-cache-for-redis/cache-how-to-functions.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,22 @@ public static void PubSubTrigger(
232232

233233
:::zone-end
234234

235-
### RedisListsTrigger
235+
### RedisListTrigger
236236

237-
The `RedisListsTrigger` pops elements from a list and surfaces those elements to the function. The trigger polls Redis at a configurable fixed interval, and uses [`LPOP`](https://redis.io/commands/lpop/)/[`RPOP`](https://redis.io/commands/rpop/)/[`LMPOP`](https://redis.io/commands/lmpop/) to pop elements from the lists.
237+
The `RedisListTrigger` pops elements from a list and surfaces those elements to the function. The trigger polls Redis at a configurable fixed interval, and uses [`LPOP`](https://redis.io/commands/lpop/)/[`RPOP`](https://redis.io/commands/rpop/)/[`LMPOP`](https://redis.io/commands/lmpop/) to pop elements from the lists.
238238

239-
#### Inputs for RedisListsTrigger
239+
#### Inputs for RedisListTrigger
240240

241-
- `ConnectionString`: connection string to the redis cache, for example`<cacheName>.redis.cache.windows.net:6380,password=...`.
242-
- `Keys`: Keys to read from, space-delimited.
241+
- `ConnectionStringSetting`: connection string to the redis cache, for example`<cacheName>.redis.cache.windows.net:6380,password=...`.
242+
- `Key`: Key or keys to read from, space-delimited.
243243
- Multiple keys only supported on Redis 7.0+ using [`LMPOP`](https://redis.io/commands/lmpop/).
244244
- Listens to only the first key given in the argument using [`LPOP`](https://redis.io/commands/lpop/)/[`RPOP`](https://redis.io/commands/rpop/) on Redis versions less than 7.0.
245+
- This field can be resolved using `INameResolver`
245246
- (optional) `PollingIntervalInMs`: How often to poll Redis in milliseconds.
246247
- Default: 1000
247248
- (optional) `MessagesPerWorker`: How many messages each functions worker "should" process. Used to determine how many workers the function should scale to.
248249
- Default: 100
249-
- (optional) `BatchSize`: Number of elements to pull from Redis at one time.
250+
- (optional) `Count`: Number of elements to pull from Redis at one time. These are processed in parallel.
250251
- Default: 10
251252
- Only supported on Redis 6.2+ using the `COUNT` argument in [`LPOP`](https://redis.io/commands/lpop/)/[`RPOP`](https://redis.io/commands/rpop/).
252253
- (optional) `ListPopFromBeginning`: determines whether to pop elements from the beginning using [`LPOP`](https://redis.io/commands/lpop/) or to pop elements from the end using [`RPOP`](https://redis.io/commands/rpop/).
@@ -257,9 +258,9 @@ The following sample polls the key `listTest` at a localhost Redis instance at `
257258
::: zone pivot="programming-language-csharp"
258259

259260
```csharp
260-
[FunctionName(nameof(ListsTrigger))]
261-
public static void ListsTrigger(
262-
[RedisListsTrigger(ConnectionString = "127.0.0.1:6379", Keys = "listTest")] RedisMessageModel model,
261+
[FunctionName(nameof(ListTrigger))]
262+
public static void ListTrigger(
263+
[RedisListTrigger(ConnectionStringSetting = "127.0.0.1:6379", Key = "listTest")] RedisMessageModel model,
263264
ILogger logger)
264265
{
265266
logger.LogInformation(JsonSerializer.Serialize(model));
@@ -311,25 +312,25 @@ public static void ListsTrigger(
311312

312313
:::zone-end
313314

314-
### RedisStreamsTrigger
315+
### RedisStreamTrigger
315316

316-
The `RedisStreamsTrigger` pops elements from a stream and surfaces those elements to the function.
317+
The `RedisStreamTrigger` pops elements from a stream and surfaces those elements to the function.
317318
The trigger polls Redis at a configurable fixed interval, and uses [`XREADGROUP`](https://redis.io/commands/xreadgroup/) to read elements from the stream.
319+
The consumer group for all function instances will be the ID of the function. For example, for the StreamTrigger function in [this sample](https://github.com/Azure/azure-functions-redis-extension/blob/main/samples/dotnet/RedisSamples.cs), the consumer group would be `Microsoft.Azure.WebJobs.Extensions.Redis.Samples.RedisSamples.StreamTrigger`.
318320
Each function creates a new random GUID to use as its consumer name within the group to ensure that scaled out instances of the function don't read the same messages from the stream.
319321

320-
#### Inputs for RedisStreamsTrigger
322+
#### Inputs for RedisStreamTrigger
321323

322-
- `ConnectionString`: connection string to the redis cache, for example, `<cacheName>.redis.cache.windows.net:6380,password=...`.
323-
- `Keys`: Keys to read from, space-delimited.
324+
- `ConnectionStringSetting`: connection string to the redis cache, for example, `<cacheName>.redis.cache.windows.net:6380,password=...`.
325+
- `Key`: Key or keys to read from, space-delimited.
324326
- Uses [`XREADGROUP`](https://redis.io/commands/xreadgroup/).
327+
- This field can be resolved using `INameResolver`.
325328
- (optional) `PollingIntervalInMs`: How often to poll Redis in milliseconds.
326329
- Default: 1000
327330
- (optional) `MessagesPerWorker`: How many messages each functions worker "should" process. Used to determine how many workers the function should scale to.
328331
- Default: 100
329-
- (optional) `BatchSize`: Number of elements to pull from Redis at one time.
332+
- (optional) `Count`: Number of elements to pull from Redis at one time.
330333
- Default: 10
331-
- (optional) `ConsumerGroup`: The name of the consumer group that the function uses.
332-
- Default: "AzureFunctionRedisExtension"
333334
- (optional) `DeleteAfterProcess`: If the listener will delete the stream entries after the function runs.
334335
- Default: false
335336

@@ -338,9 +339,9 @@ The following sample polls the key `streamTest` at a localhost Redis instance at
338339
::: zone pivot="programming-language-csharp"
339340

340341
```csharp
341-
[FunctionName(nameof(StreamsTrigger))]
342-
public static void StreamsTrigger(
343-
[RedisStreamsTrigger(ConnectionString = "127.0.0.1:6379", Keys = "streamTest")] RedisMessageModel model,
342+
[FunctionName(nameof(StreamTrigger))]
343+
public static void StreamTrigger(
344+
[RedisStreamTrigger(ConnectionString = "127.0.0.1:6379", Keys = "streamTest")] RedisMessageModel model,
344345
ILogger logger)
345346
{
346347
logger.LogInformation(JsonSerializer.Serialize(model));

0 commit comments

Comments
 (0)