Skip to content

feat: support parsing buffer config from params in AsyncClientConfig#16

Merged
johnlanni merged 1 commit intohigress-group:envoy-1.27from
johnlanni:support-wasm-redis-params
Nov 13, 2025
Merged

feat: support parsing buffer config from params in AsyncClientConfig#16
johnlanni merged 1 commit intohigress-group:envoy-1.27from
johnlanni:support-wasm-redis-params

Conversation

@johnlanni
Copy link
Copy Markdown

@johnlanni johnlanni commented Nov 13, 2025

Enable AsyncClientConfig to parse buffer_flush_timeout and
max_buffer_size_before_flush from the params map passed during
construction. This allows WASM plugins to configure Redis client
buffer behavior via URL query parameters.

Changes:

  • Add parseUint32FromParams() helper to parse config from params map
  • Parse max_buffer_size_before_flush from params (default: 1024)
  • Parse buffer_flush_timeout from params (default: 3ms)
  • Add header for std::numeric_limits

Usage example:
redisInit("cluster?buffer_flush_timeout=1&max_buffer_size_before_flush=512", ...)

This enables runtime configuration of Redis batching behavior for
latency-sensitive or throughput-optimized scenarios without code changes.

Co-developed-by: Claude noreply@anthropic.com

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]


Note

Allow AsyncClientConfig to read buffer_flush_timeout and max_buffer_size_before_flush from params, and add tests and WASM plugin usage to validate parsing.

  • Redis/Config:
    • Parse buffer params from params in Redis::AsyncClientConfig (buffer_flush_timeout, max_buffer_size_before_flush) with defaults via parseUint32FromParams helper in envoy/redis/async_client.h.
    • Include <limits>; make related members initialized from parsed values.
  • WASM test plugin (test_data/test_redis_call_cpp.cc):
    • Use query params in redisInit/redisCall URLs to set buffer behavior.
  • Tests (test/extensions/filters/http/wasm/wasm_filter_test.cc):
    • Include envoy/redis/async_client.h.
    • Add RedisAsyncClientConfigTest to cover parsing (defaults, invalid, zero, large, overflow).

Written by Cursor Bugbot for commit 6ca8808. This will update automatically on new commits. Configure here.

Change-Id: Id2e57fb2599b27c7d6f79e58031c44d8ad4a0b12
@johnlanni johnlanni merged commit 3fe314c into higress-group:envoy-1.27 Nov 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant