spring:
application:
name: apigateway-service
cloud:
gateway:
mvn:
routes:
- id: first-service #when the service comes in,
uri: http://localhost:8081/ #192.168.45.104 #allocate it at this port
predicates:
- Path=/first-service/** #when first-service comes, allocate 8081 port
filters:
- CustomFilter
{
"timestamp": "2024-12-25T17:40:16.953+00:00",
"path": "/first-service/check",
"status": 404,
"error": "Not Found",
"requestId": "b7d751fb-1"
}
-8081 원래 서비스 호출하면 잘 호출 되는 것으로 봐서, gateway 쪽 문제로 판단.
-CustomFilter 코드 -> 문제X
-yml 쪽에 필터가 안 먹는 것으로 추측하고 구글링해보니 중간에 적용했던 mvn.routes 가 특정한 상황에만 적용될 수도 있다고한다.
-그래서 그냥 routes로 변경
spring:
application:
name: apigateway-service
cloud:
gateway:
routes:
- id: first-service #when the service comes in,
uri: http://localhost:8081/ #192.168.45.104 #allocate it at this port
predicates:
- Path=/first-service/** #when first-service comes, allocate 8081 port
filters:
- CustomFilter

routes에 원하는 결과가 출력된다.