SShortSingh.
Back to feed

Developer Tests API Rate Limiting via WSO2 Bijira, Finds Clock-Window Timing Is Critical

0
·7 views

A developer working on a hotel booking backend discovered that his GET endpoint had no rate limiting, forcing him to disable it entirely when exposed publicly for testing. To explore managed rate limiting, he published a read-only endpoint through Bijira, WSO2's API management platform, configuring a 5-requests-per-60-seconds limit via a simple console form with no custom code. Initial tests failed to trigger rejections because two requests hung for 60 seconds each, pushing subsequent requests into new clock-minute windows where the counter had already reset. After switching to a fixed 200ms firing schedule starting just after a new minute began, all 10 requests landed within the same window, yielding exactly 5 approvals and 5 HTTP 429 rejections as configured. The experiment highlighted that rate limit behavior depends heavily on clock-aligned windows and request timing, not just the gap between individual requests.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AI Tool Mines GitHub PR Comments to Extract Team Code-Review Rules, Exposes Early Flaws

An AI agent called Instinct Bot, built by developer Ofer Shapira, created an open-source CLI tool named PR Rulebook that scans merged GitHub pull requests to identify recurring, unwritten code-review conventions. The tool analyzed 45 human review comments from 15 merged pull requests in the astral-sh/ruff repository, generating two candidate rules — both of which proved unreliable. A key flaw was discovered: the tool mistook repeated comments within a single PR for team-wide conventions, inflating confidence scores without cross-PR evidence. The developers have since patched the clustering logic to require evidence from at least two distinct pull requests and improved text normalization. The tool remains in early development, with its npm package unpublished, and the team is seeking five public repositories with active human PR review for a pilot run.

0
ProgrammingDEV Community ·

Open-Source Spring Boot Starter Prevents Duplicate API Requests via Idempotency Keys

A developer has released an open-source library called Spring Boot Idempotency Starter, designed to prevent duplicate processing when clients retry failed API requests. The starter introduces an @Idempotent annotation that developers can apply to endpoints, along with an Idempotency-Key request header that clients use to tag each unique operation. When a retry is detected with the same key and request body, the server replays the cached response instead of re-executing the controller logic; if the key is reused with a different request body, a 409 Conflict error is returned. The library supports both in-memory and Redis storage backends, configurable expiry periods, and Spring Boot auto-configuration, requiring Java 17+, Spring Boot 3.x, and Maven 3.8+. The author cautions that the tool is not a guarantee of exactly-once execution and recommends pairing it with database constraints and business-level safeguards for critical operations.

0
ProgrammingDEV Community ·

Remove White Video Backgrounds in Browser Using Canvas API and WebGL

Web developers often struggle with videos that have white backgrounds, since standard formats like MP4/H.264 do not natively support alpha transparency. A browser-based approach using the Canvas API or WebGL in JavaScript can solve this without desktop software like Premiere Pro or After Effects. The technique involves drawing video frames to an HTML5 canvas, reading pixel data, and setting the alpha channel to zero for white or near-white pixels. A smooth falloff threshold can be applied to off-white edges to prevent jagged borders, with the process looped frame-by-frame via requestAnimationFrame(). Free online tools that run the same logic locally in the browser are also available for those who prefer a no-code solution.