173만명의 커뮤니티!! 함께 토론해봐요.
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
- id: user-service uri: lb://USER-SERVICE predicates: - Path=/user-service/** - Method=PATCH filters: - RemoveRequestHeader=Cookie - RewritePath=/user-service/(?<segment>.*), /$\{segment} - AuthorizationHeaderFilter 이렇게 작성했는데요 @postmapping("/user/test") @patchmapping("/user/test") 포스트는 잘동작하는데 패치는 404가 납니다 뭐가 문제일까요?
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
kim미소 파파
2024-01-12T15:38:24.475Z
댓글 2
좋아요 1
조회수 624
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
안녕하세요 선생님! 강의를 잘 듣던 와중에 궁금증이 생겨 질문 드립니다. 게이트 웨이에 설정한 필터 중, 요청 uri를 재정의 하기 위해서 RewritePath 라는 필터를 사용하잖아요. 이때 /user-service/(?<segment>.*), /$\{segment} 는 정규식인가요??... 정규식표현에 segment라는 것이 찾아봐도 나오지 않아서요!!
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
qpal1zm23
2024-01-10T07:27:13.913Z
댓글 3
좋아요 1
조회수 519
해결됨
Microservice 설계(with EventStorming,DDD)
VO Money 에서 add(money:Money) 함수에 대해서 궁금합니다. VO는 불변인데 Money를 초기화 해서 값을 재할당 하는건지 어떤식으로 이해하면 좋을지 궁금합니다.
info
2024-01-10T03:59:03.534Z
댓글 1
좋아요 0
조회수 437
해결됨
Java 마이크로서비스(MSA) 프로젝트 실습
안녕하세요! 강의 잘 보고있습니다.이번 강의에서 블루그린배포 개념을 설명해주시며 스케일 업에 대해 알려주셨는데요! 제가 공부했던 얕은 지식을 떠올려보면, 스케일 업 은 기존 서버의 사양 등을 업그레이드해 시스템을 확장 (수직적) 스케일 아웃 은 서버를 여러대 추가하여 시스템을 확장 - 로드밸런싱 동반 (수평적) 라고 배웠던 것 같은데.. 아무튼, 질문의 요점은 블루 그린 배포는 여러 대의 서버가 있는 스케일 아웃 방식 에서 무중단 배포가 가능한 배포 모델이 아니라, 스케일 업 방식 인가요?? 감사합니다!
java spring rest-api spring-boot msa 스케일업 스케일아웃 무중단배포 블루그린배포
진경
2024-01-09T23:58:05.115Z
댓글 1
좋아요 0
조회수 491
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
안녕하세요 위 사진처럼 인스턴스의 ID가 아래의 yml파일로 설정한데로 적용되지 않고 있어 질문드렸습니다. 커서를 두었을 때 포트번호도 확인해서 해당 인스턴스인것도 확인하였습니다. 원인이나 해결방법을 알 수 있을까요 ㅠㅠ
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
이승언
2024-01-09T19:34:02.083Z
댓글 1
좋아요 0
조회수 503
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
강의 소개에 부트3버전으로 2024.01 업데이트라고 되어 있던데, 이전 질문 내용을 보니 작년 초부터 업데이트하신다고 하셨는데, 업데이트가 지속적으로 안되는 것 같더라구요. 이번 1월에는 업데이트 진행하시나요? 질의응답에서 매번 한다고 말씀하시고, 지속적으로 업데이트 안되는 것 같아 문의드립니다. 강사님 강의의 한 팬으로써 꼭 업데이트 되길 바랍니다. 1회독 끝낸상태라 한번 더 강의를 수강하려는데, 선문의 드립니다. Spring Boot 3.2 + Spring Cloud 2023.0.0 업데이트 예정 (2024-01)
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
2024-01-05T04:18:11.002Z
댓글 2
좋아요 0
조회수 464
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
강의 소개에 Spring Boot 3.2 + Spring Cloud 2023.0.0 업데이트 예정 (2024-01) 쓰여 있는데 해당 계획 실습 예제 파일만 업데이트 하시는 건지 혹은 강의 녹화본까지 업데이트를 하시는 것이 유효한지 질문드립니다. 또한 커뮤니티의 질문 글을 보면 강사님께서 8월 이후로 답변이 드문드문 한 상태인데 인프런 AI의 답변이 해당 질문 글에 대한 적절한 답변을 하여 답변을 하시지 않는 건지, 현재 바쁘셔서 답변을 하시지 않는 건지 질문드립니다. 감사합니다.
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
SHYU
2024-01-04T12:54:33.381Z
댓글 2
좋아요 1
조회수 355
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
혹시 복습차원에서 강의 정리해서 개인블로그에 포스팅 해도 될까요?? 만일 포스팅하게 된다면, 꼭 출처는 남기겠습니다!!
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
mnk1106
2024-01-04T09:33:58.911Z
댓글 2
좋아요 0
조회수 412
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
실수로 gateway-mvc라이브러리를 설치 후 실행 했을 때 톰캣으로 실행이 되었는데 이때는 게이트웨이url에 /first-service/welcome를 붙였을 때 실행이 되지 않았는데, gateway 라이브러리 다시 설치후 netty 에서는 정상적으로 동작 하는데 톰캣에서는 안되고, netty에서만 되는 이유가 뭔가요???
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
hdh8990
2024-01-04T06:10:23.690Z
댓글 2
좋아요 0
조회수 999
해결됨
Microservice 설계(with EventStorming,DDD)
Entity를 설계 하다가 자주 변하지만 응집도가 높은 값들은 어떻게 해야할까요? 자주 변하지만 응집도가 높은 값들은 VO를 사용한다. VO로 선언된 값의 수정은 불가능 하지만 생성으로 값을 초기화 한다. 그냥 이러한 상황에서는 응집도가 높아도 VO를 고려하지 하지 않는다. 수정 기능이 필요하다면 VO가 아닌 Entity를 고려해야 한다?
info
2024-01-03T08:36:09.761Z
댓글 1
좋아요 0
조회수 431
해결됨
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
2024-01-02 15:45:16 ts=2024-01-02T06:45:16.877Z caller=main.go:487 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="open /etc/prometheus/prometheus.yml: operation not permitted 어떻게 해결해야할까요...?
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
흑후추
2024-01-02T06:48:14.537Z
댓글 2
좋아요 0
조회수 924
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
spring boot3 에서 slueth를 사용할 수 없다고 합니다. 삽질 끝에 비슷하게 구현이 되긴 했는데 조금 다른 점 때문에 강사님이 의도하신바가 맞는지 정확히는 모르겠네요. 첫 요청의 traceID와 spanID가 다른 점 혹~시 필요하신분이 계시다면 참고해주세요! 추가의존성 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-tracing-bridge-brave</artifactId> </dependency> <dependency> <groupId>io.zipkin.reporter2</groupId> <artifactId>zipkin-reporter-brave</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> <dependency> <groupId>io.github.openfeign</groupId> <artifactId>feign-micrometer</artifactId> </dependency> 기존 스타터 sleuth, zipkin 의존성 제거 yml 변경점 server: port: 0 spring: application: name: order-service # spring boot 3.0 이전 zipkin, sleuth 설정 # zipkin: # base-url: http://127.0.0.1:9411 # enabled: true # sleuth: # sampler: # probability: 1.0 jpa: hibernate: ddl-auto: update h2: console: enabled: true settings: web-allow-others: true path: /h2-console datasource: driverClassName: org.h2.Driver url: jdbc:h2:mem:testdb ## 추가 cloud: openfeign: micrometer: enabled: true eureka: instance: instance-id: ${spring.cloud.client.hostname}:${spring.application.instance_id:${random.value}} client: register-with-eureka: true fetch-registry: true service-url: defaultZone: http://localhost:8761/eureka management: endpoint: health: show-details: always endpoints: web: exposure: include: refresh, health, beans, busrefresh, info, metrics, prometheus ## 추가 tracing: sampling: probability: 1.0 propagation: type: b3 zipkin: tracing: endpoint: http://localhost:9411/api/v2/spans logging: level: com.example.orderservice: DEBUG ## 추가 pattern: level: "%5p [%X{traceId:-},%X{spanId:-}]" 추가 주석 부분만 추가 Config Bean 추가 @Configuration public class MoniterConfig { @Bean public Capability capability(final MeterRegistry registry) { return new MicrometerCapability(registry); } } 이 Config 를 추가하지 않으시면, 요청 마다 TraceID가 달라집니다. 액츄에이터도 필수 몇 가지 글을 참고하여 세팅한거라 몇몇 의존성이나 설정은 없어도 될수도 있지만 거의 필요한거 같습니다. 그 외에 오류나 추적하는거는 동일하게 동작하는거 같습니다! 혹시 누군가 도움이 되시길!
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
이북자
2024-01-01T14:39:17.141Z
댓글 2
좋아요 7
조회수 1266
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
CustomFilter 클래스는 기동될 때 로그로 찍어서 확인했는데 생성은 되는데 apply 함수가 호출이 안되네요. first ,second, apigateway 프로젝트 재빌드를 해도 호출이 안되네요. pre, post filter log가 호출이 안되는 이유가 무엇인가요? CustomFilter.java @Component @Slf4j public class CustomFilter extends AbstractGatewayFilterFactory<CustomFilter.Config> { public CustomFilter(){ super(Config.class); log.info("TEST TEST"); } @Override public GatewayFilter apply(final Config config) { log.info(" TEST 1 TEST 2"); // Custom Pre Filter return ((exchange, chain) -> { ServerHttpRequest request = exchange.getRequest(); ServerHttpResponse response = exchange.getResponse(); log.info("Custom PRE filter : request id -> {}", request.getId()); // Custom post Filter return chain.filter( exchange ).then(Mono.fromRunnable(() -> { log.info("Custom POST filter : response code -> {}", response.getStatusCode()); })); }) ; } public static class Config{ // put the configuration properties } } application.yml server: port: 8000 eureka: client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://localhost:8761/eureka spring: application: name: apigateway-service cloud: gateway: mvc: routes: - id: first-service uri: http://localhost:8081 predicates: - Path= /first-service/** filters: # - AddRequestHeader=first-request, first-request-header2 # - AddResponseHeader=first-response, first-response-header2 - CustomFilter - id: second-service uri: http://localhost:8082 predicates: - Path= /second-service/** filters: # - AddRequestHeader=second-request, second-request-header2 # - AddResponseHeader=second-response, second-response-header2 - CustomFilter apigateway 로그 2023-12-31T01:50:27.862+09:00 WARN 2068 --- [apigateway-service] [ main] trationDelegate$BeanPostProcessorChecker : Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [loadBalancerWebClientBuilderBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies. 2023-12-31T01:50:28.212+09:00 INFO 2068 --- [apigateway-service] [ main] c.e.a.Filter.CustomFilter : TEST TEST 2023-12-31T01:50:28.216+09:00 INFO 2068 --- [apigateway-service] [ main] c.e.a.Filter.GlobalFilter : TEST TEST 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host] 2023-12-31T01:50:29.192+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [XForwardedRemoteAddr] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight] 2023-12-31T01:50:29.193+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService] 2023-12-31T01:50:29.564+09:00 INFO 2068 --- [apigateway-service] [ main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses RestTemplate. 2023-12-31T01:50:29.922+09:00 WARN 2068 --- [apigateway-service] [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. While this cache implementation is useful for development and tests, it's recommended to use Caffeine cache in production.You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath. 2023-12-31T01:50:29.956+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING 2023-12-31T01:50:30.008+09:00 INFO 2068 --- [apigateway-service] [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1 2023-12-31T01:50:30.009+09:00 INFO 2068 --- [apigateway-service] [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data. 2023-12-31T01:50:30.019+09:00 INFO 2068 --- [apigateway-service] [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1703955030017 with initial instances count: 0 2023-12-31T01:50:30.024+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application APIGATEWAY-SERVICE with eureka with status UP 2023-12-31T01:50:30.314+09:00 INFO 2068 --- [apigateway-service] [ main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port 8000 2023-12-31T01:50:30.320+09:00 INFO 2068 --- [apigateway-service] [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8000 2023-12-31T01:50:30.708+09:00 INFO 2068 --- [apigateway-service] [ main] c.e.a.ApigatewayServiceApplication : Started ApigatewayServiceApplication in 5.877 seconds (process running for 6.826)
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
닉네임_한글 가능
2023-12-30T02:48:42.942Z
댓글 1
좋아요 0
조회수 400
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
apigateway 실행할 때 netty 서버가 아니라 tomcat으로 연결이 되는데 왜 그런 건가요?? netty서버로 작동할려면 어떻게 해야되나요?
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
lsy
2023-12-29T02:13:28.149Z
댓글 3
좋아요 0
조회수 1040
해결됨
Java 마이크로서비스(MSA) 프로젝트 실습
잘못써있네용
java spring rest-api spring-boot msa
김병철
2023-12-28T06:58:02.723Z
댓글 1
좋아요 1
조회수 444
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
auth서버와 resource서버는 서로 통신을 안하게끔 설계하는 것이 좋은가요? 서버끼리 통신할 일이 많아 보이는데, 이러면 Monolitic 방식보다 많이 느려질 것 같아서 말입니다. 그리고 authService가 userService를 사용하므로, user에 관련된 것들은 auth 서버에 넣어야 되는 건가요? 아니면 resource에다가 넣어도 되는건가요? 그리고 어지간한 서비스는 회원(user) 테이블과 관련이 있을 것 같은데(ex: TableJoin 같은 것 해야할때) , 어느정도로 서비스가 독립적이어야 Monolitic 보다 MSA가 더 나은지 궁금합니다.
돌로스원숭숭
2023-12-23T12:49:08.212Z
댓글 2
좋아요 0
조회수 391
해결됨
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
안녕하세요! 강사님 로드 밸런싱 & 서버 관련 질문드립니다. Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA) 현재 저는 섹션 2 API Gateway Service 까지 강의를 진행한 상태입니다. 현업에서는 해당 강의에서 나와있는 것처럼 어플리케이션 단에서의 로드 밸런싱 구현을 많이 하나요? 아니라면 현업에서는 어떠한 방법으로 자주 사용하여 구현을 하나요? 어떤 상황에서 어플리케이션 단에서의 로드 밸런싱 구현을 하나요? 트래픽 분산을 목적으로 로드 밸런싱을 사용하기 위해 여러 개의 어플리케이션 인스턴스들을 서버에 올린다고 하였을 때 현업에서는 어떻게 관리하나요? AWS EC2 기준으로 설명해주시면 좋을 것 같습니다! 읽어주셔서 감사합니다(__)
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
kjww9807
2023-12-23T09:46:31.087Z
댓글 1
좋아요 1
조회수 311
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
docker network 지정 시 해당 network내에서 할당되는 ip 대역에 서비스 ip가 순차적으로 할당되는 것 같은데요, kafka같은 경우는 그 대역에서 직접 ip하나를 지정해서 사용하고 서비스에서도 그 kafka ip를 하드코딩으로 직접 지정해두는데, 환경에 따라 network ip 대역이 변경될 일은 없는건가요? docker container 네트워크 스펙인지 궁금합니다.
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
이무
2023-12-23T04:28:26.264Z
댓글 1
좋아요 1
조회수 286
미해결
Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
질문이 있습니다. Local에 kafka를 직접 설치한 경우 kafka connect를 위해 jdbc connector 경로 지정 등 작업이 필요했던 것 같은데 docker compose로 구동시킬 때는 이러한 작업에 대한 지정이 필요 없는건가요??
spring-boot jpa 아키텍처 spring-cloud kafka msa rabbitmq
이무
2023-12-23T01:01:59.542Z
댓글 1
좋아요 0
조회수 298
해결됨
장애 없는 서비스를 만들기 위한 Resilience4j - CircuitBreaker
제 프로젝트에선 smtp프로토콜로 gmail을 전송하고 있습니다. 앞의 강의를 몇개 듣다보니 retry로 일시적인 지연은 어느정도 해결될수있을것 같은데, 만약 gmail서버에 큰 장애가 난다면 모든 요청들이 retry회수를 꽉 채우게 되어 트래픽이 몰린다면 많은 retry가 쌓여 네트워크에 부담을 줄수있는 상황이 발생할수도 있을 것 같습니다. (물론 개인프로젝트에서 gmail서버의 지연이나 장애까지 고려하는게 조금 너무간것 아닌가 싶기도합니다 ㅠ) 1. 위의 문제를 해결해보기위해 써킷브레이커라는 개념을 이용해 해결해볼수있다 라고 이해했는데 맞을까요? 2. 만약 위 개념을 도입하지않는다면 retry 회수를 줄이고, 아래와같이 보조(?) 메일서버를 두는것도 방법이 될수있을까요? 아니면 더 좋은방법이 어떤것들이 있는지 궁금합니다! try { sendEmailWithSMTP(); } catch (SMTPException smtpException) { log.error("primary 메일서버 전송실패", smtpException); try { sendEmailWithNaver(); } catch (NaverMailException naverMailException) { log.error("secondary 메일서버 전송실패 ", naverMailException); } } 3. 저는 취준생인데 이미 앞강의만 듣고도 좋은 키워드들과 방법들의 존재를 알았다는것만으로 수확을 거뒀다고 생각합니다. 뒷강의를 끝까지 듣고 제가 구현해봐도 될지.. 아니면 아직은 이런것도 있구나 하는정도 스탠스를 추천하시는지 궁금합니다.
spring-boot msa circuit-breaker resilience4j
2023-12-21T10:41:34.194Z
댓글 2
좋아요 1
조회수 316