Riptide HTTP Client tutorial
Riptide is Zalando's open source Java HTTP client built around declarative client-side response routing, where responses are dispatched to handlers by status, status series, reason phrase or content type, much like server-side request routing. The tutorial covers adding the Maven dependency, building an Http object with an executor and request factory, sending GET and POST requests, and using dispatch with Navigators for flat and nested routing, including catch-all bindings and pass() no-op handlers. Requests run on an Executor and return CompletableFuture<ClientHttpResponse>, and the riptide-capture module's Capture class lets callers get a deserialized body object such as a Product back from the future.
Related posts
- Ready, steady, goa: our API setup
incident.io mediumAdeptincident.io defines its HTTP API in Goa's design-first DSL, which generates net/http transport handlers, validation code, typed Go service interfaces, OpenAPI 3.0 specs and Go clients. This replaces hand-written Gin handlers with manual parsing, auth and serialization. On top of Goa, a `make generate-api` pipeline pretty-prints and merges the OpenAPI output and filters it into internal, mobile and public variants. Those variants feed specialised clients: typed TypeScript for the React frontend, lean mobile clients and Go test clients. A single DSL change then flows through to server code, docs and compile-time-checked frontend types.
- How to Build a Web App with and without Rails Libraries
Shopify Engineering mediumAdeptBuilds a small birthday-tracker web app called Mirth from scratch in plain Ruby, then rebuilds it with Rails components to show what each layer abstracts away. It starts with a TCP server on Ruby's socket library and adds hand-written HTTP request-line parsing, GET/POST routing, Content-Length body reading and response construction with 303 redirects. Later sections add persistent storage and swap in Rack plus Rails libraries (Action Controller, Action Dispatch, Active Record, Action View). The payoff is a concrete picture of what Rails handles for you.
- Macramé: Untangling the Knot on the Etsy Android Listing Screen
Etsy Code as Craft mediumAdeptEtsy rewrote its 4000-line Android listing Fragment into Macramé, a Mobius-inspired unidirectional architecture: a single immutable State exposed via StateFlow, flattened into small UI models rendered by a RecyclerView with ListAdapter diffing, and a sealed-class Event dispatcher routing actions to single-purpose Handlers that update State, launch async work, or emit SideEffects to the Fragment. The five-month rewrite cut Time to First Content by 18% (1585 ms to 1298 ms), lifted listing views, add-to-carts and searches in an A/B test, and raised business-logic unit test coverage from single digits to 76%. Remaining tradeoffs include Event/Handler wiring boilerplate, harder debugging of Handler-dispatched event chains, and overkill on simple screens.
- Using the GitHub Copilot SDK for Java
GitHub Engineering mediumAdeptGitHub Copilot SDK for Java lets server-side Java code create agent sessions, register tools, send prompts and stream events without depending on Langchain4j or Spring AI, and with BYOK it can target OpenAI, Azure, Anthropic or compatible endpoints. A Jakarta EE 11 real-estate lead pipeline on Open Liberty demonstrates the core APIs: annotation-based tools via @CopilotTool (experimental, needs an annotation processor and compiler flag), inline lambda tools, section-level system message overrides, a one-line sendAndWait agentic loop, and session.on event streaming pushed over WebSocket. The key integration point is passing a ManagedThreadFactory-backed virtual-thread Executor so tool callbacks keep CDI, JNDI and transaction context, while ToolSet restricts which built-in tools each session can use in production.
- All you need to know about timeouts
Zalando Engineering mediumAdeptTimeouts on remote calls should always be set explicitly, because library defaults (like Java HttpClient's infinite timeout) let stuck downstream services exhaust thread pools and other resources. Connection timeout should derive from network RTT (roughly RTT × 3), while request timeout should come from measured latency percentiles gathered in shadow mode, e.g. p99.9 for a 0.1% false-timeout rate. For chained calls, either split the SLA budget across services or wrap the chain in a time limiter such as CompletableFuture.orTimeout or Resilience4j TimeLimiter. Retry only on timeouts and 5xx for idempotent operations, using Idempotency-Key headers, circuit breakers and exponential backoff with jitter, and avoid retries when p99 sits close to p50.