묻고 답해요
150만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
순위 정보를
불러오고 있어요
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
grafana 그래프 nodata
https://www.inflearn.com/community/questions/267420/%EB%8C%80%EC%89%AC%EB%B3%B4%EB%93%9C%EC%97%90-%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%A5%BC-%EB%AA%BB%EA%B0%80%EC%A0%B8%EC%98%A4%EB%8A%94%EA%B2%83-%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4를 참고하여 Legend: {{instance}}Instant 체크 + Fields 입력을 통해 위에 처리량은 잘나오는 모습입니다 하지만밑에 그래프들은 Fields 입력하는 부분이없어서 처리량때 처럼 설정을 할 수 없고 역시나no data로 나오네요설정은 이대로 했습니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
route 설정이 동작을 안하는거 같아요.
RouteLocator gatewayRoutes(RouteLocatorBuilder builder)이 메소드를 만들기 위해 implementation 'org.springframework.cloud:spring-cloud-starter-gateway' 이걸로 수정했을 했는데 이후 저 메소드를 주석 처리하고 applicatio.yml을로 설정을 대체 했을 때는 동작을 안하고 implementation 'org.springframework.cloud:spring-cloud-starter-gateway-mvc'mvc로 다시 변경해줘야 올바르게 동작하는데무슨 차이가 있을까요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
FeignErrorDecoder 질문
FeignErrorDecoder 에 대해서order_is_empty를 수정한뒤에127.0.0.1:8000/actuator/busrefresh 를 호출하면Keys refreshed [spring.cloud.bootstrap.enabled, order_service.exception.order_is_empty]로그는 정상적으로 뜨며디버깅 모드로 코드를 추가해서 실행한결과List<ResponseOrder> orders= orderServiceClient.getOrders(userId);코드전에env.getProperty("order_service.exception.order_is_empty") 를 확인해본 결과는정상적으로 리프레시되지만 이후에 오류를 터트리고 FeignErrorDecoder 처리 로직에서switch(response.status()){ case 400: break; case 404: if(methodKey.contains("getOrders")){ return new ResponseStatusException(HttpStatus.valueOf(response.status()),env.getProperty("order_service.exception.order_is_empty")); } break; default: return new Exception(response.reason()); }getProperty("order_service.exception.order_is_empty")이부분이 새로운 환경 변수가ErrorDecoder 에서는 반영 안되는것같아서 해결이 안되서 질문남깁니다 ! UserServiceImpl 에서는 정상적으로 바뀐값이 나오는거보면 ErrorDecoder 문제 같은데 정확히 모르겠습니다 @RefreshScope 이것도 해결책은 아닌것같아요 답변 부탁드립니다 !
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
로그인 에러
안녕하세요 강사님! 질문이 있어서 작성합니다.현재 섹션 7까지 수강한 상태입니다.회원가입을 하고 로그인을 시도했는데 회원가입은 정상, 로그인은 에러가 반환됩니다. 1) 섹션 19(165강)에서 WebSecurity 코드로 실행package com.example.user_service.sercurity; import com.example.user_service.service.UserService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authorization.AuthorizationDecision; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.core.Authentication; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.access.expression.WebExpressionAuthorizationManager; import org.springframework.core.env.Environment; import org.springframework.security.web.access.intercept.RequestAuthorizationContext; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.IpAddressMatcher; import java.util.function.Supplier; @Configuration @EnableMethodSecurity public class WebSecurity { private final UserService userService; private final BCryptPasswordEncoder bCryptPasswordEncoder; private final Environment env; public static final String ALLOWED_IP_ADDRESS = "127.0.0.1"; public static final String SUBNET = "/32"; public static final IpAddressMatcher ALLOWED_IP_ADDRESS_MATCHER = new IpAddressMatcher(ALLOWED_IP_ADDRESS + SUBNET); public WebSecurity(Environment env, UserService userService, BCryptPasswordEncoder bCryptPasswordEncoder){ this.env = env; this.userService = userService; this.bCryptPasswordEncoder = bCryptPasswordEncoder; } @Bean public AuthenticationManager authenticationManager(HttpSecurity http) throws Exception { AuthenticationManagerBuilder authenticationManagerBuilder = http.getSharedObject(AuthenticationManagerBuilder.class); authenticationManagerBuilder.userDetailsService(userService).passwordEncoder(bCryptPasswordEncoder); return authenticationManagerBuilder.build(); } @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http.csrf((csrf) -> csrf.disable()) .authorizeHttpRequests((authz) -> authz .requestMatchers(new AntPathRequestMatcher("/actuator/**")).permitAll() .requestMatchers(new AntPathRequestMatcher("/h2-console/**")).permitAll() .requestMatchers(new AntPathRequestMatcher("/users", "POST")).permitAll() .requestMatchers(new AntPathRequestMatcher("/welcome")).permitAll() .requestMatchers(new AntPathRequestMatcher("/health_check")).permitAll() .anyRequest().access( new WebExpressionAuthorizationManager( "hasIpAddress('127.0.0.1') or hasIpAddress('192.168.219.119')")) ) .sessionManagement((session) -> session .sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .headers((headers) -> headers.frameOptions((frameOptions) -> frameOptions.disable())); return http.build(); } private AuthorizationDecision hasIpAddress(Supplier<Authentication> authentication, RequestAuthorizationContext object){ return new AuthorizationDecision(ALLOWED_IP_ADDRESS_MATCHER.matches(object.getRequest())); } }2) https://github.com/joneconsulting/toy-msa/tree/springboot3.2 에서 'springboot3.2' 브런치의 'WebSecurityNew', 'IpAddressLoggingFilter' 코드로 실행 그리고 IpAddressLoggingFilter 코드에 대한 강의도 있나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
jwt 검증 로직 질문
강의 예제 코드에서는 user-service 라는 msa 에서 jwt발급 과정에서 user id를 Subject에 설정해서 발급하고이후에 gateway 에서 검증할 때 그냥 subject 만 추출하고 null 이 아니면 그냥 검증되는 식으로작성되어있습니다 그리고 강의에서 bearer 토큰으로 받은 값에서 subject 를 추출해서 그걸 user_id 랑 비교해서 검증하면 된다는 언급이 있습니다 여기서 의문인 건 비교할 실제 db 가 user-service 에있다는 점입니다추후 강의에서 msa 간 통신하여 user-service에 있는 db 에서 userId 가져와서 비교하는 식으로 처리가 되는 걸까요 ?궁금해서 질문 남깁니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
feign + resilience4j 적용 시, fallback exception 처리 질문
Resilience4j - circuitbreaker를 보며 공부 중에 feign 에 Resilience4j의 cb나 bulkhead를 적용하게 되면 feignfallbackfactory 동작 시, throwable이 wrapping 되는 현상이 나타납니다.(ex. ExecutionException) 예를 들어, 4xx대의 에러, 즉 FeignException.BadRequest에 대한 분기 처리를 하려면 fallbackfactory 에서 throwable에 대한 원본 cause 를 추출하는 방법 밖에는 없을까요? (ex, throwable.getcause().getcause())
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
로컬호스트이름이 달라요
이와같이 이름이 ip 로 나오는게아니고저렇게 host.docker.internal 로 나와서 도커랑 관련해서 설정이 꼬인거같아서 원상복구하고싶어서 질문드립니다 윈도우 환경입니다
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
안녕하세요 인증/ 인가에 대해서 질문 있습니다.
안녕하세요 강의 잘 듣고 있습니다.MSA 환경에서 SPRING CLOUD GATEWAY를 사용할때 예를들어 유저 서비스에서 JWT 서비스(생성, 검증)를 구성하고 SPRING CLOUD GATEWAY feign client로 통신하고 토큰을 검증하고 각 모듈로 헤더를 통해서 userId, role을 전달할때 api별 권한을 관리를 어떻게 하는지는 궁금합니다.스프링 클라우드 게이트웨이에 SecurityConfig에서 모든 모듈에 대한 url에 권한을 설정하기에는 너무 많은 api별 권한을 적어야놔야 할것같아서 이게 맞나 싶습니다혹시 각 모듈마다 ApiGatewayAuthenticationFilter를 만들어서 헤더 값을 통해서 아래 코드와 같이 SecurityContextHolder를 주입시켜서 각 모듈에 대한 SecurityConfig에서 권한을 관리 하거나 @PreAuthorize를 통하여 관리하거나 실무에서는 어떤 방법을 쓰는지 궁금합니다!!!List<SimpleGrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority(formattedRole));UsernamePasswordAuthenticationToken authentication =new UsernamePasswordAuthenticationToken(userId, null, authorities);SecurityContextHolder.getContext().setAuthentication(authentication);더 좋은 방법이 있다면 알고 싶습니다!!
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
도커로 mysql을 가동했으면 어떻게 해야할까요?
docker exec -it bash 해서 복사 해서 내 디렉터리까지 옮겨서 다 따라해봤는데 저는 kongmac@minuuimaegbug-ui-noteubug Dockerfile % docker logs cde3e64f71aa2025-03-07T08:00:12.394150Z 0 [System] [MY-015015] [Server] MySQL Server - start.2025-03-07T08:00:12.622065Z 0 [Warning] [MY-010143] [Server] Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line2025-03-07T08:00:12.623333Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.1.0) starting as process 1mysqld: File './binlog.index' not found (OS errno 13 - Permission denied)2025-03-07T08:00:12.628763Z 0 [ERROR] [MY-010119] [Server] Aborting2025-03-07T08:00:12.630606Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 9.1.0) MySQL Community Server - GPL.2025-03-07T08:00:12.630620Z 0 [System] [MY-015016] [Server] MySQL Server - end.이런 오류가 나오네요... 도커로 db포트 열었으면 어떻게 해야하나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
카프카를 사용한 이유 이거 맞나요?
이번 카프카에서는 두 가지를 배운거 같은데 1. order -> catalog로 프로듀서와 컨슈머로 역할을 나눠서 재고관리2. 두개의 포트에서 단일 데이터베이스에 접근했을 때 카프카를 이용해서 관리하는 거 이렇게 두 가지 가르쳐주신 거 같습니다.제가 생각했을 때 1번은 카프카를 사용한 이유는 예제를 보여주기 위해서라고 생각했습니다. 카프카말고 @FeignClient를 사용해서 주문을 했을 시에 catalog에 접근하여 재고를 업데이트 시켜주면 되겠다 라고 생각했습니다. 2번은 카프카를 사용했어야 했다고 생각한 이유가 2개의 서버포트가 단일 데이터베이스에 접근했을 시에 카프카 유무에 따라 동시에 같은 주문이 들어왔을때 데이터의 일관성이 깨질수도 있다고 생각했습니다.제가 적은 내용이 틀리면 말씀해주시면 감사하겠습니다.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
재고관리에 카프카 쓴 이유가 궁금합니다.
재고관리에 카프카 쓴 이유가 궁금합니다.제가 이해한 내용으로는 현재 order와 catalog는 다른 포트를 사용 중이고 같은 DB를 사용 중인걸로 알고있습니다. 그래서 카프카말고 @FeignClient로 재고관리에 업데이트 해주는 방식이 있는 거 같은데 이 상황에서 카프카를 쓴 이유가 있나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
프로젝트에 카프카 쓸때도 설정 다 해줘야하나요?
이전 카프카1편 강의에서는 Iterm을 이용해서 직접 접근한 거 같은데 만약 스프링 프로젝트로 만들어도 jdbc connector, db connector를 kafka connector에 별도로 설정해줘야하나요? 아니면 스프링이 알아서 다 세팅해주나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
도커로 사용해도 카프카 커넥트 설정 다 따라해야하나요?
도커로 사용해도 카프카 바이너리, 카프카 커넥트, 카프카 jdb 커넥트 세개 다 다운하고 설정해줘야하나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
Driver org.mariadb.jdbc.Driver is not suitable for jdbc:mysql://localhost:3306/mydb
mariadb driver로 접속할 수 없다고 나오는데 이거 혹시 무슨 문제인지 알 수 있을까요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
강의자료
깃허브에서 강의자료를 다운받았는데암호가 걸려있어서 굿노트에서 열리지도 않고 파일에서 필기도 안되고 인쇄도 안됩니다.암호 안걸려있는 강의자료를 받을 수 있을까요.
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
spring 부트 3.5 사용중인데 zuul 어떻게 해양할까요
deprecated돼서 spring initializr에 검색조차 안되는데그냥 강의 듣다보면 다른 해결방안 나오는건가요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
git에서 설정파일 읽어들일 때 윈도우의 경우 로컬위치가 name에 붙어 나오는 현상
저한테도 있어서 봤는데, 크게 신경 쓸 필요는 없을 것 같습니다.Appdata/local/temp 는 말 그대로 앱의 임시파일 저장하는 곳이고, config 서버 기동 시 git에서 해당 설정파일들을 읽어들여 저 위치에 저장하는 것으로 보입니다.근데 왜 윈도우만 저렇게 임시파일을 저장하고 그 위치의 주소를 붙여서 출력해주는지는 잘 모르겠네요. 맥OS는 그때그때 git에서 파일을 가져오는 것일까요? 제가 맥이 없어서 그걸 모르겠네요.
-
해결됨Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
config 파일 암호화
yml의 설정 내용을 암호화하는 작업중에 궁금한 점이 있습니다. 암호화해도 http://config server주소/config파일명/프로파일 경로로 접속하면 해독된 값을 볼 수 있는데 이러면 암호화한 의미가 있는지 궁금합니다config 서버에서 http://config server주소/config파일명/프로파일 경로를 비활성화하는 방법이 있을까요?그리고 비대칭키에서 암호화에 사용하는 password는 평문으로 yml에 저장하고 있는데 이러면 반쪽짜리(?) 암호화일 것 같은데 이렇게 사용해도 되는건지가 궁금합니다
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
유레카 서버가 종료된상태에서 질문
안녕하세요유레카 서버가 종료된경우클라이언트에서 연결오류 관련 에러로그가 많이 뜨더라구요운영 환경에서 클라이언트앱 쪽에 이런 로그가 너무 많이 발생하는것은 지저분해보여서 간단하게 한줄짜리 커스텀로그로 대체하고싶은데 방법이 있을까요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
Kafka Source Connect 사용
강사님 너무 좋은 강의 감사드립니다. JDBC Source Connector 예시를 잘 보았습니다. 해당 소스 커넥터의 경우 DB를 주기적으로 폴링해서 변경사항을 감지해서 DB 부담이 큰 것으로 알고 있는데요. (CDC source connector에 비해)혹시 해당 방식의 커넥터는 현업에서도 메이저하게 사용하는 방식인지 아니면 단순 예시인지 궁금합니다.
주간 인기글
순위 정보를
불러오고 있어요