묻고 답해요
156만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결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을 받은지 궁금합니다
-
미해결Microservice 구현 (with EDA,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 커넥트 세개 다 다운하고 설정해줘야하나요?
-
해결됨RabbitMQ를 이용한 비동기 아키텍처 한방에 해결하기
채팅 방식 질문입니다!
학습중 궁금한 것은 언제든 문의 하세요.질문을 최대한 자세히 남겨주시면 반드시 답변 드리도록 하겠습니다.추가로 알고 싶은 내용도 요청해주시면 강의 자료를 업데이트 해서 제공할 예정입니다. 해당 강의에서 http요청은 mq를 사용하게 되는데 채팅의 경우 스프링의 기본 내장브로커를 사용하게 되는 것이 아닌가요?
-
미해결DevOps를 위한 Docker 가상화 기술 (Private Harbor Registry)
Harbor 인증서 설정 후 IP 변경
안녕하세요,Harbor+Jenkins 실습 중 문의사항이 생겨 질문 남깁니다.Jenkins에서 Harbor로 푸시를 할 때 에러가 발생해 확인해보니 https 관련 에러가 나는 것 같았습니다. 확인해보니 Harbor를 설치하고 며칠 뒤 실습을 진행해 host pc의 ip가 변경되었고, 이로 인해 문제가 발생하고 있었습니다.이럴 경우, 매번 재설정을 해주는 것 외에 다른 해결법이 있을까요? 감사합니다.
-
미해결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에 검색조차 안되는데그냥 강의 듣다보면 다른 해결방안 나오는건가요?
-
미해결Microservice 설계(with EventStorming,DDD)
다른 BC 또는 마이크로서비스 담당 정보를 어떻게 이용하나요?
컨텍스트 매핑 강의를 듣는 중입니다.대여를 처리하려면 도서 정보, 회원 정보도 필요합니다.다른 BC 또는 마이크로서비스가 관리하는 정보를 어떻게 이용하나요?- 대여할 도서(도서 정보 필요)- 대여할 사용자(회원 정보 필요)