#spring-boot

15 snippets tagged with #spring-boot

javaintermediate

Spring Boot REST Controller with CRUD

Create a complete REST API with Spring Boot: GET, POST, PUT, DELETE with validation and error handling.

Best for: Building RESTful APIs with Spring Boot

#spring-boot#rest-api
javaintermediate

Spring Boot Global Exception Handler

Centralized error handling with @ControllerAdvice for validation errors, 404s, and custom exceptions.

Best for: Consistent error responses across all endpoints

#spring-boot#error-handling
javaadvanced

Spring Security — JWT Authentication

Implement JWT authentication with Spring Security: token generation, validation, and filter chain.

Best for: Securing REST APIs with JWT tokens

#spring-boot#jwt
javaintermediate

Spring Boot — Custom Validator Annotation

Create custom validation annotations with ConstraintValidator for domain-specific field validation.

Best for: Domain-specific input validation

#spring-boot#validation
javaintermediate

Spring Boot Caching with Redis

Add caching to Spring Boot services with @Cacheable, @CacheEvict, TTL configuration, and Redis.

Best for: Reducing database load with application-level caching

#spring-boot#caching
javabeginner

Spring Boot — Scheduled Tasks and Cron

Schedule background tasks with @Scheduled: fixed rate, fixed delay, cron expressions, and async tasks.

Best for: Background job scheduling in Spring Boot

#spring-boot#scheduling
javaadvanced

Spring WebFlux — Reactive REST API

Build reactive REST APIs with Spring WebFlux using Mono, Flux, and non-blocking operations.

Best for: High-throughput non-blocking APIs

#spring-boot#webflux
javabeginner

Spring Boot — Profiles and Configuration

Manage environment-specific config with Spring profiles: application-{env}.yml, @Profile, and @Value.

Best for: Environment-specific application configuration

#spring-boot#profiles
javaadvanced

Spring Boot AOP — Aspects and Advice

Use Spring AOP for cross-cutting concerns: logging, timing, auditing, and transaction-like behavior.

Best for: Automatic method logging across services

#spring-boot#aop
javaintermediate

Spring Boot — Application Events

Use Spring's event system for decoupled communication: custom events, async listeners, and ordering.

Best for: Decoupled event-driven service communication

#spring-boot#events
javaadvanced

Spring Security — Role-Based Access Control

Configure RBAC with Spring Security: roles, method security, endpoint permissions, and custom filters.

Best for: Fine-grained API endpoint authorization

#spring-boot#security
javaintermediate

Spring Boot — RestClient HTTP Calls

Make HTTP requests with Spring RestClient (6.1+): GET, POST, error handling, interceptors, and timeouts.

Best for: REST API consumption in Spring Boot services

#spring-boot#rest-client
javaadvanced

Spring Boot Integration Testing

Write Spring Boot integration tests with MockMvc, test slices, TestContainers, and mock beans.

Best for: REST API endpoint verification

#spring-boot#testing
kotlinintermediate

Spring Boot REST API in Kotlin

Build a REST API with Spring Boot and Kotlin: controllers, services, error handling, and validation.

Best for: RESTful API development with Kotlin

#kotlin#spring-boot
kotlinadvanced

Spring WebFlux with Kotlin Coroutines

Build reactive Spring APIs using Kotlin coroutines: suspend functions, Flow, and coRouter DSL.

Best for: Non-blocking REST APIs with Kotlin coroutines

#kotlin#spring-boot