What is the role of query parameters in API versioning?
Query parameter versioning keeps URLs stable and selects the API version with a parameter such as api_version=2. See how to implement it and when to avoid it.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
Query parameter versioning keeps URLs stable and selects the API version with a parameter such as api_version=2. See how to implement it and when to avoid it.
Put the version in the route, give each major version its own controller and DTOs, and share logic in services. Includes Spring Framework 7 notes.
API versioning keeps existing clients working while your API evolves. Learn the main strategies, a Spring Boot example and how to retire old versions.
Learn how to configure CORS in Spring Boot with @CrossOrigin, global addCorsMappings and Spring Security, and how to debug preflight failures.
In Spring, @CrossOrigin attaches a CORS policy to a controller or handler method. See how it merges with global config and what each attribute does.
Define one CORS policy for all endpoints in Spring Boot with WebMvcConfigurer or a CorsFilter bean, and make it work with Spring Security.
CorsConfiguration holds Spring's CORS rules: allowed origins, methods, headers, credentials and preflight cache time. See how to register it and avoid common CORS errors.
Compare the ways to configure CORS in Spring MVC and WebFlux: @CrossOrigin, global configurers and CorsFilter, with working examples.
Annotations look the same, but MVC routes through DispatcherServlet and WebFlux through DispatcherHandler. Compare controllers, RouterFunction and filters.
Write a GlobalFilter or an AbstractGatewayFilterFactory for Spring Cloud Gateway, with pre and post logic, ordering, YAML and Java route registration.
There is no @EnableGateway annotation in Spring Cloud Gateway. Add the starter and define routes, predicates and filters in YAML or the Java DSL.
A GatewayFilter runs on specific routes to change requests and responses; GlobalFilter runs on all. Learn built-in filters, custom filters and ordering.
Configure Spring Cloud Gateway rate limiting with RequestRateLimiter, RedisRateLimiter and a KeyResolver, in YAML or Java.
In Feign, @RequestMapping describes the outgoing request: verb, path, headers and media types. Learn usage, pitfalls and the modern alternatives.
Use a custom ErrorDecoder, bounded retries and a circuit breaker with a FallbackFactory to handle Feign client errors in Spring Cloud OpenFeign.
The @FeignClient name is the service ID for discovery and the key for per-client config. See how it works with url, path and contextId.
Add a fallback or fallbackFactory to a Spring Cloud OpenFeign client using Resilience4j, since Hystrix has been removed, and tune timeouts and the circuit breaker.
The circuit breaker pattern fails fast when a dependency is unhealthy. See the three states, a Resilience4j example and how it fits with retries and timeouts.
Set connect-timeout and read-timeout globally or per client with Spring Cloud OpenFeign. Covers defaults, Java config, retries and circuit breaker timeouts.
spring-cloud-starter-openfeign turns annotated Java interfaces into HTTP clients wired into load balancing and circuit breakers. See setup, config and alternatives.