묻고 답해요
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로 나오네요설정은 이대로 했습니다.
-
미해결비전공자도 이해할 수 있는 쿠버네티스 입문/실전
실무 개발 환경
안녕하세요. 재밌고 좋은 강의를 해주셔서 감사합니다. 아직 70%정도 보고 있지만 궁금하게 있습니다.현재 백엔드 개발자로 근무하고 있는데 저희 환경은 aws의 ec2에 직접 올려백엔드 서버(spring-boot)를 운영하고 있습니다. 점차 쿠버네티스 환경으로 변경하려고인프라담당자들과 백엔드 개발자들이 스터디 및 환경 구축하고 있는데요. 만약 실무에서쿠버네티스 환경으로 바뀐다면 개발자들의 로컬 개발 환경은 어떻게 하시는지 궁금합니다.대부분 자바, 스프링 환경이면 인텔리제이등으로 개발 후 테스트를 해볼텐데 컨테이너에서 다른 개발자들과 다 같은 환경에서 테스트를 해보고 빌드해보고 해야 하지 않는가 싶어서요. 실무에선어떤식으로 개발자들이 개발하는지 개발, 테스트 , 운영 배포 까지 플로우가 어떻게 되는지 궁금합니다.
-
미해결비전공자도 이해할 수 있는 쿠버네티스 입문/실전
교육자료 혹시 공유가 가능하실까요
안녕하세요. 교육 잘 받았습니다. 제가 받았던 교육자료 문서로 받아 볼 수 있을까요? 아니면 온라인으로 찾아볼 수 있는지 확인 부탁드립니다.
-
미해결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로 다시 변경해줘야 올바르게 동작하는데무슨 차이가 있을까요?
-
미해결EDA 기반 Microservice 구현 (with Hexagonal, DDD)
Aggregate 하위에 꼬리를 무는 Entity 는?
헥사고날 아키텍처를 구현하면 먼저 Domain 부분을 구현하는것으로 아는데요,A class, B class, C class가 있다고 한다면.A class 에는 B의 List를, B에서는 C의 List를 가지고 있다고 합시다.그러면 이런 상황에서는 A를 조회하게 되면 B를 여러개 가져오는것을 막기위해 JPA에서는 LazyLoading을 사용할텐데 문제는 Domain 개발 단계에서 JPA를 사용하지 않고 하는 경우에는 어떻게 개발을 하는지 궁금합니다. 즉, 하나의 Aggregate 를 중심으로 Entity가 계층적으로 줄줄이 이어진 경우가 있는지, 그렇다면 이를 어떻게 해결하는지 말입니다. Aggregate 하나 조회하면 저~기 최하위 계층 데이터까지 다 가져오는게 좀 이상한거 같아서요.무조건 JPA를 사용한다고 생각하면 좋으나, 이를 나중에 다른 ORM으로 변경을 해도 문제가 없게 하는게 헥사고널의 취지라고 생각하다보니 이런 질문을 드립니다.
-
미해결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 이것도 해결책은 아닌것같아요 답변 부탁드립니다 !
-
미해결RabbitMQ를 이용한 비동기 아키텍처 한방에 해결하기
스탭4 질문드립니다
안녕하세요, 스탭4 news 스크립트 코드가 궁금해 질문드립니다.우선 영상처럼 curl -X POST "http://localhost:8080/news/api/publish?newsType=ja"curl -X POST "http://localhost:8080/news/api/publish?newsType=sp"curl -X POST "http://localhost:8080/news/api/publish?newsType=vu"컬로 3번 찌르면 아래 사진과 같이 응답값이 찍히는데요스크립트 부분에서 connect 함수 실행시 현재 선택한 const newsType = document.getElementById("newsType").value; (java선택)값이 java이라subscribeToNews(newsType);이부분에 subscription = stompClient.subscribe(/topic/java, function (message) { alert(message.body); addMessageToDiv(message.body); }); 이렇게 /topic/java만 subscribe 할텐데 어떻게 spring , vue가 나왔는지 궁금합니다.curl 요청 -> restController -> publisher 에서 publishMessage 메서드를 통해 fanout으로 bindingBuilder가 설정된 큐에 send -> 클라이언트(html)에서 stomp를 이용해 구독 로직인것같은데클라이언트(html)에서 /topic/java만 구독한상태에서 다른 vue, spring을 받은지 궁금합니다
-
미해결EDA 기반 Microservice 구현 (with Hexagonal, DDD)
헥사곤 아키텍쳐 관련하여 문의드립니다.
안녕하세요, 강의 내용 중에 궁금한 점이 있어 질문드립니다.궁금한점이 제가 아는 헥사곤 아키텍쳐는 위와 같이, 입력포트는 인터페이스, 유스케이스는 입력포트의 구현체이고, 포트는 애플리케이션 코어와 외부 세계 사이의 경계점이라고 알고 있는데, 본 강의에서는 반대로 되어 있는데요, 혹시 경계를 유스케이스로 정하신 특별한 이유가 있으신지 궁금합니다.
-
해결됨RabbitMQ를 이용한 비동기 아키텍처 한방에 해결하기
생성자 질문드립니다
NotificationMessage모델에 생성자를 추가하는 이유가 Jackson 역직렬화때문에 추가하셨다 했는데 setter만 있으면 필드명과 알아서 바인딩되어서 생성자가 없어도 되는거 아닌가요? 실제로 생성자 삭제하고 message key값으로 /app/send 요청 찌르면 객체에 바인딩이 잘된상태인데 궁금합니다
-
미해결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 가져와서 비교하는 식으로 처리가 되는 걸까요 ?궁금해서 질문 남깁니다.
-
해결됨RabbitMQ를 이용한 비동기 아키텍처 한방에 해결하기
Pub/Sub & WebSocket 활용한 실시간 알림
SSE & Redis와 Pub/Sub & WebSocket을 비교하고 있는데요.실시간성과 정확성을 위해서라면 Pub/Sub & WebSocket을 더 많이 쓰나요? 알림의 특성상 채팅과 같은 양방향은 아니기 때문에 WebSocket이 적합한 선택인지 궁금합니다.
-
미해결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 커넥트 세개 다 다운하고 설정해줘야하나요?
주간 인기글
순위 정보를
불러오고 있어요