File contents Gateway Service Skill
Service Type: API Gateway
Central entry point for all API requests.
Responsibilities
Request routing to backend services
Authentication/Authorization (JWT validation)
Rate limiting (Redis-based)
Circuit breaker (Resilience4j)
Request/Response logging
CORS handling
Package Structure
com.company.gateway/
├── config/ # Security, CORS configuration
├── filter/ # Global filters (logging, auth)
└── fallback/ # Circuit breaker fallbacks
Key Components
Route Configuration
Routes are defined in application.yml:
Path-based routing
Circuit breaker per service
Rate limiting per endpoint
Global Filters
LoggingFilter : Logs all requests, adds trace ID
AuthFilter : Validates JWT tokens (if needed)
Fallback Controller
Returns friendly error messages when services are down.
Adding New Route
# application.yml
spring:
cloud:
gateway:
routes:
- id: new-service
uri: http://localhost:808X
predicates:
- Path=/api/new/**
filters:
- name: CircuitBreaker
args:
name: newService
fallbackUri: forward:/fallback/default
Commands
# Run
mvn spring-boot:run
# Test routes
curl http://localhost:8080/api/users
curl http://localhost:8080/actuator/gateway/routes
1 --- 2 name: gateway-service 3 description: Gateway Service Skill 4 --- 5 # Gateway Service Skill 6 7 ## Service Type: API Gateway 8 9 Central entry point for all API requests. 10 11 ## Responsibilities 12 13 - Request routing to backend services 14 - Authentication/Authorization (JWT validation) 15 - Rate limiting (Redis-based) 16 - Circuit breaker (Resilience4j) 17 - Request/Response logging 18 - CORS handling 19 20 ## Package Structure 21 22 ``` 23 com.company.gateway/ 24 ├── config/ # Security, CORS configuration 25 ├── filter/ # Global filters (logging, auth) 26 └── fallback/ # Circuit breaker fallbacks 27 ``` 28 29 ## Key Components 30 31 ### Route Configuration 32 Routes are defined in `application.yml`: 33 - Path-based routing 34 - Circuit breaker per service 35 - Rate limiting per endpoint 36 37 ### Global Filters 38 - **LoggingFilter**: Logs all requests, adds trace ID 39 - **AuthFilter**: Validates JWT tokens (if needed) 40 41 ### Fallback Controller 42 Returns friendly error messages when services are down. 43 44 ## Adding New Route 45 46 ```yaml 47 # application.yml 48 spring: 49 cloud: 50 gateway: 51 routes: 52 - id: new-service 53 uri: http://localhost:808X 54 predicates: 55 - Path=/api/new/** 56 filters: 57 - name: CircuitBreaker 58 args: 59 name: newService 60 fallbackUri: forward:/fallback/default 61 ``` 62 63 ## Commands 64 65 ```bash 66 # Run 67 mvn spring-boot:run 68 69 # Test routes 70 curl http://localhost:8080/api/users 71 curl http://localhost:8080/actuator/gateway/routes 72 ```
mduongvandinh/skills-java-spring/tree/main/java-spring-microservices/tools/generators/templates/gateway-service commit fe458dfa25
Frequently asked questions How do I install the Gateway Service skill? Run npx skillmds@latest add mduongvandinh/gateway-service in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Gateway Service skill do? Gateway Service Skill It is listed under Coding & Dev Tools on SkillMD.
Is Gateway Service safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Gateway Service? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Gateway Service free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Gateway Service? mduongvandinh (@mduongvandinh) published this skill. Their other Agent Skills are listed on their SkillMD profile.