Skip to content

THREESCALE-15547 fix(3scale_batcher): handle string values - #1597

Merged
tkan145 merged 1 commit into
3scale:masterfrom
tkan145:THREESCALE-15547
Aug 25, 2026
Merged

THREESCALE-15547 fix(3scale_batcher): handle string values#1597
tkan145 merged 1 commit into
3scale:masterfrom
tkan145:THREESCALE-15547

Conversation

@tkan145

@tkan145 tkan145 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Fix https://redhat.atlassian.net/browse/THREESCALE-15547

Verification steps

  • Checkout this branch
  • Build new runtime-image
make runtime-image IMAGE_NAME=apicast-test
  • Get into dev-env
cd dev-environments/plain-http-upstream
  • Edit apicast-config.json as follow
diff --git a/dev-environments/plain-http-upstream/apicast-config.json b/dev-environments/plain-http-upstream/apicast-config.json
index ff944273..4ff9bf1d 100644
--- a/dev-environments/plain-http-upstream/apicast-config.json
+++ b/dev-environments/plain-http-upstream/apicast-config.json
@@ -13,6 +13,14 @@
         "policy_chain": [
           {
             "name": "apicast.policy.apicast"
+          },
+          {
+              "name": "3scale_batcher",
+              "version": "builtin",
+              "configuration": {
+                  "auths_ttl": "2",
+                  "batch_report_seconds": "10"
+              }
           }
         ],
         "proxy_rules": [
  • Start the gateway
make gateway IMAGE_NAME=apicast-test
  • Send a request to the gateway
curl --resolve get.example.com:8080:127.0.0.1 -v "http://get.example.com:8080/?user_key=123"
  • You should get a HTTP/1.1 200 response
  • Monitor the gateway log, you should see the following
gateway-1  | 2026/07/22 04:19:28 [debug] 19#19: *38 3scale_batcher.lua:69: func(): 3scale batcher report timer got 1 reports
@tkan145
tkan145 requested a review from a team as a code owner July 17, 2026 02:33
@tkan145 tkan145 changed the title fix(3scale_batcher): handle string values Jul 20, 2026
When configuring the auths_ttl and batch_report_seconds values a batch
processing policy to string instead of integer, the policy will silently
fail unless APICAST_VALIDATE_POLICY_CONFIGS is set.

Enabling APICAST_VALIDATE_POLICY_CONFIGS is currently too risky as it will
cause existing policies configured with the wrong data type to fail. A safer
approach is to try converting the values numbers, then fallback to the default
value when the input data is invalid.
@tkan145
tkan145 merged commit 82a098a into 3scale:master Aug 25, 2026
12 checks passed
@tkan145
tkan145 deleted the THREESCALE-15547 branch August 25, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants