묻고 답해요
169만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
변경 감지가 일어나는 시점에 대하여 궁금한 점이 있습니다.
안녕하세요, 언제나 질 좋은 강의 잘 듣고 있습니다. JPA 영속성 컨텍스트에서 변경 감지가 일어나는 시점에 대해서 궁금한 점이 있습니다.영한님께서 강의 10분 45초 즈음에, "트랜잭션이 커밋되는 시점에 JPA가 변경 감지를 실행한다." 라고 언급을 해주셨습니다. 제가 의문이 드는 지점은,영속성 컨텍스트 안에서의 변경 감지영속성 컨텍스트 flush트랜잭션 커밋이 3개가 발생하는 시점입니다. flush가 발생하면, 영속성 컨텍스트의 쓰기 지연 sql 저장소의 쿼리문들이 비워지고, db에 전송된다. 이 때 1차 캐시는 비워지지 않고, 트랜잭션이 커밋되는 시점에서 db에 전송된 쿼리문들이 커밋됨과 동시에 1차 캐시의 스냅샷과 현재 엔티티 상태와의 변경 감지가 일어난다. ---> 이것이 현재 제가 기본적으로 알고 있는 지식입니다. 제 질문은 다음과 같습니다.그런데, 변경 감지라는 것이 결국 update 쿼리문을 날리기 위함인데, 저는 flush 이전에 변경 감지가 발생하여 쓰기 지연 sql 저장소에 update 쿼리문이 저장되는 것이 순서에 맞지 않나? 라는 생각이 듭니다.또한 커밋되는 순간 변경 감지가 일어난다면, 트랜잭션 종료 바로 직전에 update 쿼리문이 날라가는 것이 맞을까요? 즉, (커밋으로 인한 flush가 아닌) 임의의 flush 호출 상황에서는 변경 감지로 인한 쿼리문이 전송되지 않는 것인가요? 질문 이외에도, 제 이해에 틀린 점이 있다면 알려주시면 감사하겠습니다!
-
해결됨스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
컨트롤러 질문
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]컨트롤러에 관한 내용인데요,어떠한 요청이 들어왔을때스프링빈에 등록되어있는 컨트롤러가 있다면, 거기에 맵핑이 된다고 하였는데요, 컨트롤러의 위치나 그런거 상관없이 같은 패키지 안에 있는 모든 컨트롤러를 확인하는건가요? 그럼 소스코드가 방대해질때, 해당 요청이 적절한 컨트롤러와 매핑이 되어있는지 확인하는데 내부적으로 시간이 오래 걸리는점은 없을까요? 알아서 해쉬가 되어있나..?
-
미해결스프링 시큐리티
_csrf 토큰 생성 애러
안녕하세요 강사님 CSRF의 _csrf 토큰을 생성하는 곳에서 에러가 발생해 질문 드립니다.우선 강사님의 코드를 그대로 작성했었는데EL1007E: Property or field 'token' cannot be found on null 오류가 발생했습니다. <meta id="_csrf" name="_csrf" th:content="${_csrf.token}"/> <meta id="_csrf_header" name="_csrf_header" th:content="${_csrf.headerName}"/>오류 발생 당시 코드입니다.그래서 아래의 코드로 변경하였습니다.<meta name="_csrf" th:content="${_csrf?.token}" th:if="${_csrf} ne null"> <meta name="_csrf_header" th:content="${_csrf?.headerName}" th:if="${_csrf} ne null">그랬더니 home 화면에서 csrf 토큰이 제대로 생성되지 않습니다. 하지만 login 화면에서는 같은 코드를 작성했는데 csrf 값이 정상적으로 출력 되었습니다.해당 전체 코드의 Othkkartho/SpringSecurityLearn at ch4.7 (github.com) 깃허브 링크 입니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
DTO사용에 대한 질문
강의 23분18초 부분updateItem을 DTO로 받는것에 대해 질문 2가지있습니다.1. 아래와 같이 서비스계층의 DTO를 만들어서 파라미터로 사용하는부분은 이해했는데, 애초에 그냥 form을 넘겨주는것은 잘못된 설계인가요?@PostMapping("/items/{itemId}/edit") public String updateItem(@ModelAttribute("form") BookForm form) { UpdateItemDto updateItemDto = new UpdateItemDto(form); itemService.updateItem(updateItemDto); //itemService.updateItem(form); return "redirect:/items"; }강의에선 생략하는 부분인것같은데 만약 엔티티에 change() 함수를 만든다했을때 Item을 상속받는 Book, Album,Movie 각각에 change함수를 만들어주어야하나요..? (Item이라는것을 상속받는 3개의 클래스에대해 어떻게 처리해줘야할지 모르겠어요.)Item (부모클래스)에 필드들을 private -> protected로 바꾸고, Book의 change함수를 아래와 같이 만들면되나요? (이경우 Album, Movie 사용한다고 가정하면 똑같이 만들어줘야하는지?)public void change(UpdateItemDto dto) { this.name = dto.getName(); this.price = dto.getPrice(); this.stockQuantity = dto.getStockQuantity(); this.author = dto.getAuthor(); this.isbn = dto.getAuthor(); }
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
java -jar 맥os 터미널에서 실행시킬 경우 질문
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]1). 인텔리제이 상에서는 정상적으로 localhost:8080localhost:8080/hello 모두 다 실행이됩니다.터미널에서 할경우 localhost:8080/hello 를 입력할 경우 hello.html이 잘 나오는데, 그냥 localhost:8080 입력하면 웹 브라우저에서는 Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback....가 발생하고 터미널 창에는 2022-10-30 22:24:56.079 INFO 4861 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'2022-10-30 22:24:56.080 INFO 4861 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'2022-10-30 22:24:56.083 INFO 4861 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 3 ms 로 로그가 나오는데 어떤 문제일까요 ?? 2). 그리고 build ~~ src 디렉토리 안에 스냅샷.jar 과 스냅샷-plain.jar 2개가 있는데 차이가 무엇일까요 ?
-
미해결스프링 시큐리티
AuthenticationManager에 AjaxProvider가 등록되지 않습니다
강사님 안녕하세요!아무리 해봐도AuthenticationManager 에 provider로 AjaxAuthenticationProvider가 등록되질 않는데요 원인을 모르겟습니다...
-
해결됨실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
Postman 기술 질문입니다,(스프링 시큐리티)
안녕하세요 강사님강의 감사하게 잘 듣고 있습니다.다름이 아니라 제가 연습 중인 프로젝트에 Spring-Security, Auditing, Envers를 적용해 보고 있습니다.당연히 데이터를 등록, 수정, 삭제 시 DB에 현재 로그인 중인 사용자 정보가 담기게 되는데 postman에서 그냥 테스트를 하게 되면 오류가 나더라고요,1) 이러한 부분을 해결하기 위해 postman에서 따로 설정을 해줄 수 있는 부분이 있는지도 궁금합니다.(이와 비슷한 관련 강의가 있는지도 궁금합니다!)2) 강의 내용을 보면 DTO 클래스를 ApiController에 작성하셨는데 실무에서는 domain 패키지에 따로 따로 생성해주나요? (그렇게 되면 Create, Update, Delete 너무 많아지는 것 같아서요)
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
Circuit breaker와 ErrorDecoder 동시 사용
강사님 안녕하세요? 강의 너무 잘 듣고 있습니다. Feign Client 강의에서 ErrorDecoder를 추가하여 try-catch문을 사용하지 않고, HTTP 에러 코드 별 처리 방법을 별도로 분리했었는데요.이번 강의에서처럼 Circuit breaker를 사용하면 API 호출 시 발생하는 모든 오류 상황에 대해 fallback 값이 전달되기 때문에 ErrorDecoder는 별도로 필요하지 않을 것 같습니다. 외부 API 호출하는 모든 케이스에서 circuit breaker를 사용한다면 ErrorDecoder는 불필요한 것이 맞나요?circuit breaker와 error decoder가 둘 다 필요하다고 한다면, error decoder은 어떤 역할을 할 수 있나요? 항상 감사드립니다.
-
해결됨Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
@LoadBalanced 관련 질문입니다.
@LoadBalanced 를 사용할시에 apigateway를 거치지 않고 user -> order 로 가는것을 확인했는데 제가 궁금한것은 보통 client 단에서 첫 요청이 들어왔을 시에만 api gateway를 거치고 그 이후 비지니스 로직을 처리하기 위해서 ms간에 소통하는것은 api gateway를 거치지 않는것이 일반적인 건가요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
각 애플리케이션에 랜덤포트를 부여하는 이유
안녕하세요!!! 랜덤포트를 부여하는 이점에 대해서 아직도 이해가 잘 안갑니다.ㅜㅜ 마이크로서비스 애플리케이션의 확장성과 랜덤포트를 부여하는게 얼마나 깊은 관계가있나요?? 저는 정해두고 쓰는게 더 편하다고 생각했거든요. 그리고 실무에서도 정말 이렇게 랜덤포트로 사용하나요?
-
해결됨Spring Boot JWT Tutorial
authenticationManagerBuilder에서 getObject를 할때 에러가 뜹니다.
authenticationManagerBuilder.getObject();This object has not been built at org.springframework.security.config.annotation.AbstractSecurityBuilder.getObject(AbstractSecurityBuilder.java:51) ~[spring-security-config-5.7.4.jar:5.7.4] 왜그러는걸까요 추가로 DaoAuthenticationProvider에서 자동으로 additionalAuthenticationChecks해줘서 String presentedPassword = authentication.getCredentials().toString(); if (!this.passwordEncoder.matches(presentedPassword, userDetails.getPassword())) { this.logger.debug("Failed to authenticate since password does not match stored value"); throw new BadCredentialsException(this.messages .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); }패스워드를 체크할 수 있다는 글을 보았는데 확인해보니 deprecation이 되어있습니다.사용하지 않는게 좋나요?
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
cannot resolve property
application.yml 파일에서 글로벌 필터의 속성 ( baseMessage, preLogger, postLogger) 는 인식하는데 로깅 필터의 속성은 인식하지 못해 cannot resolve property 에러가 납니다. 왜인지 이유를 알 수 없어 질문드립니다.LoggingFilter.java 파일입니다.package com.todaypills.apigatewayservice.Filter; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.gateway.filter.GatewayFilter; import org.springframework.cloud.gateway.filter.OrderedGatewayFilter; import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; import org.springframework.core.Ordered; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.stereotype.Component; import reactor.core.publisher.Mono; @Slf4j //for print log @Component /**커스텀 필터의 일종임, 단지 로그를 찍기 위한 필터이므로 이름을 Logging 이라고 지은 것*/ public class LoggingFilter extends AbstractGatewayFilterFactory<LoggingFilter.Config> { public LoggingFilter() { super(Config.class); } @Override public GatewayFilter apply(Config config) { /** * 위쪽 주석부분은 람다 표현식으로 바로 리턴한 것이고 이것은 람다를 사용하지 않고 리턴한 것임, * 따라서 인스턴스부터 만들어주어야 하고 GatewayFilter는 인터페이스이기 때문에 직접 인스턴스를 생성할 수는 없고, OrderedGatewayFilter() 를 이용하여 인스턴스를 만들어주어야함 * */ GatewayFilter filter = new OrderedGatewayFilter(((exchange, chain) -> { /** exchange: request와 response 객체를 얻기 위함 */ ServerHttpRequest request = exchange.getRequest(); ServerHttpResponse response = exchange.getResponse(); log.info("logging filter: request id -> {}", config.getBaseMessage()); if(config.isPreLogger()){ log.info("logging pre filter start: request id -> {}", request.getId()); } return chain.filter(exchange).then(Mono.fromRunnable(() -> { if(config.isPostLogger()){ //Mono 객체: 웹플럭스(스프링5)에서 지원하는 기능으로 비동기방식의 서버에서 단일값을 전달할 때 모노타입으로 전달 log.info("logging post filter end: response code -> {}", response.getStatusCode()); } })); }), Ordered.HIGHEST_PRECEDENCE); //HIGHEST_PRECEDENCE 는 적용할 필터가 여러개일 때 어느것이 먼저 실행될지 우선순위를 부여함 return filter; } @Data // setter getter 함수 생성 (isPreLogger(), isPostLogger() 등) public static class Config{ // 여기에 configuration 이 있다면 삽입 private String baseMessage; private boolean preLogger; private boolean postLogger; } } application.yml 파일입니다.server: port: 8000 eureka: client: register-with-eureka: true fetch-registry: true service-url: defaultZone: http://localhost:8761/eureka spring: application: name: apigateway-service cloud: gateway: default-filters: - name: GlobalFilter args: # 우리가 정의한 변수 baseMessage: 게이트웨이 글로벌 필터입니다. preLogger: true #prefilter의 유무 postLogger: true routes: #FilterConfig의 라우팅 정보를 yml 파일로도 설정할 수 있음 - id: nutrients-service uri: http://localhost:8081/ predicates: - Path=/nutrients-service/** filters: # - AddRequestHeader=nutrients-request, nutrients-request-heaer-value # - AddResponseHeader=nutrients-response, nutrients-response-header-value - name: CustomFilter - name: LoggingFilter args: baseMessage: 커스텀 로깅 필터입니다. preLogger: true postLogger: true
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
윈도우 h2.bat실행시 아무 반응이 없습니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)예3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)예[질문 내용]여기에 질문 내용을 남겨주세요. h2.bat실행시 아무창도 뜨질 않습니다. 아예 반응이 없습니다.열심히 구글링하여서 3시간가량 할 수 있는 방법을 동원해보았는데 해결이 되지 않아서 질문남깁니다 ㅜㅜh2 버전은 강의에서 말씀하신 1.4.200 버전으로 다운로드 받았습니다아래 해본 방법들을 남깁니다. 모두 결과는 실행하였을 때 반응이 없었습니다.[해본 방법들]cmd창에서 h2.bat 실행 , cmd창에서 "h2.bat" 실행cmd창에서 h2.sh 실행, cmd창에서 "h2.sh" 실행cmd창에서 h2w.bat 실행, cmd창에서 "h2w.bat" 실행다운로드받은 경로 들어가서 마우스로 h2.bat 실행cmd를 관리자권한으로 실행하여 1,2번 방법h2파일 재설치 후 1,2,3,4,5 방법노트북 재부팅 후 1,2,3,4,5 방법프로젝트 폴더 안에있는 application.properties 파일에서 h2데이터베이스 연동설정(이건 아닌것같지만 혹시나해서해봤습니다.)h2포트번호 확인 후 cmd에서 포트번호 전부 확인해봤지만 사용중인 포트번호가 없어서 h2포트번호를 그냥 바꿔본 후 실행환경변수 재설정 열심히 검색중에 하단 링크를 보았는데 해결방법을 못찾으신건가요 ㅠ 답변부탁드립니다!!만약 해결방법이 없다면 Oracle을 연동하여 사용해보겠습니다. 최대한 강의와 비슷하게 진행하고 싶어서 꼭 해결할 수 있었으면 좋겠네요https://www.inflearn.com/questions/175580
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
dataSource 빨간줄 에러나요
강의 8:27 부분에서 괄호 안에 dataSource 에러가 납니다.이런 에러가 나는데요 어떻게 고쳐야 하나요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
gradlew build문제
[질문 내용]cmd창에 gradlew build를 치면 C:\Study\hello-spring>gradlew build> Task :compileJava FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':compileJava'.> invalid source release: 11* Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.> Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 1s1 actionable task: 1 executed 이 에러가 뜨는데 어떻게 해결할 수 있을까요ㅜ
-
미해결실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
Book.java Kotlin으로 변경 후 오류 문의
안녕하세요. 12강 에서 처럼 Book.java를 Book.kt kotlin 코드로 변경하고 나서 테스트코드 수행하면 아래와 같은 오류가 발생합니다. 확인해야 될 사항이 뭐가 있을까요. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookRepository' defined in com.group.libraryapp.domain.book.BookRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.group.librayapp.domain.book.Book
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
Kafka sink connector를 통해서 단일 데이터베이스 저장을 했을 때 장점?
안녕하세요.Kafka Connect 를 활용한 단일 데이터베이스를 사용 파트를 듣고 있는데요.Multiple Order Service가 같은 DB URL을 가지고, JPA를 통해서 데이터 저장을 하면 될 것 같은데, 굳이 Kafka Sink Connector를 통해서 데이터 저장을 하는 이유가 따로 있을까요?JPA를 쓰면 Persistence Manager가 제공하는 여러 장점을 이용할 수 있을 것 같은데, Kafka sink connector는 그런 장점을 이용할 수 없을 것 같아서요.. 실제 현업에서 많이 사용되는 테크닉인지 궁금하고, 만약 사용한다면 장점은 무엇인지 궁금합니다!
-
미해결스프링 시큐리티
addlogouthandler에서요 ~
안녕하세요 선생님 !! addlogouthandler여기서 세션무효화, 토큰 삭제 외에 추가작업을 한다고 하셨는데 여기서 제가 만들 핸들러를 집어넣으면 1)세션 무효화 ,토큰 삭제 + 알파로 제가 만든 기능이 추가된다는 건가요?? 2)그냥 제가 만든 기능만 추가된다는 것인가요?? 그래서 따로 무효화와 토큰을 구현해줘야 한다는 ....? 1번과 2번중에 어떤거죠??
-
미해결스프링과 JPA 기반 웹 애플리케이션 개발
M1 mac 에서 gradle로 빌드하시려는 분들께 공유 하고싶어 글을 남겨요!
Requirementsstatic/node_module로 package.json에 선언된 의존성을 다운로드 받아야한다gradle build 시 package.json에 선언된 의존성을 확인하고 다시 다운로드 받아야 한다.뭔가 간단하게 끝내고 싶다 !!!Actionhttps://github.com/node-gradle/gradle-node-plugin/blob/master/docs/usage.md다양한 관련 플러그인 들이 있지만, 위의 플러그인을 설치 했습니다.2번의 요구사항은 gradle의 증분 컴파일(?)이 해주는 것 같습니다. (정확하지 않음 추측이에요)3번은 관련 자료를 찾던 도중 processResources 를 발견했고, Copies production resources into the production resources directory. 라고 설명 되어 있습니다.(공식 홈페이지)따라서, npm install 시 node_module 파일을 static 이하로 떨어 뜨리면 되겠구나!그리고 processResources를 "npm install 동작을하는 " Task를 의존하게 하면 되겠구나!-- 주석이 많아 가독성이 떨어지지만, 한번 읽어보시면 더 도움이 될거라 생각해서 위의 깃헙에 있는 주석 그대로 복사 붙여넣기 합니다. 수정한 부분은 nodeProjectDir 부분과processResources.dependsOn 부분 입니다.추가로 package.json 도 아래분이 잘 정리 해주셔서 함께 복사 붙여넣기 합니다.(고맙습니다!!)-인텔리제이 빌드시(gradle로 설정안했을 경우 동작안해요!)-gradle 탭 누르셔서 npm Task 들어오는지 확인해주세요!{ "name": "static", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@yaireo/tagify": "^3.5.1", "bootstrap": "^4.4.1", "cropper": "^4.1.0", "font-awesome": "^4.7.0", "jdenticon": "^2.2.0", "jquery": "^3.4.1", "jquery-cropper": "^1.0.1", "mark.js": "^8.11.1", "moment": "^2.24.0", "summernote": "^0.8.16" } }plugins { id "com.github.node-gradle.node" version "3.5.0" id 'org.springframework.boot' version '2.7.5' id 'io.spring.dependency-management' version '1.0.15.RELEASE' id 'java' } group = 'me.studyOlle' version = '0.0.1-SNAPSHOT' sourceCompatibility = '17' configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } node { // Whether to download and install a specific Node.js version or not // If false, it will use the globally installed Node.js // If true, it will download node using above parameters // Note that npm is bundled with Node.js download = true // Version of node to download and install (only used if download is true) // It will be unpacked in the workDir version = "16.14.0" // Version of npm to use // If specified, installs it in the npmWorkDir // If empty, the plugin will use the npm command bundled with Node.js npmVersion = "" // Version of Yarn to use // Any Yarn task first installs Yarn in the yarnWorkDir // It uses the specified version if defined and the latest version otherwise (by default) yarnVersion = "" // Base URL for fetching node distributions // Only used if download is true // Change it if you want to use a mirror // Or set to null if you want to add the repository on your own. distBaseUrl = "https://nodejs.org/dist" // Specifies whether it is acceptable to communicate with the Node.js repository over an insecure HTTP connection. // Only used if download is true // Change it to true if you use a mirror that uses HTTP rather than HTTPS // Or set to null if you want to use Gradle's default behaviour. allowInsecureProtocol = null // The npm command executed by the npmInstall task // By default it is install but it can be changed to ci npmInstallCommand = "install" // The directory where Node.js is unpacked (when download is true) workDir = file("${project.projectDir}/.gradle/nodejs") // The directory where npm is installed (when a specific version is defined) npmWorkDir = file("${project.projectDir}/.gradle/npm") // The directory where yarn is installed (when a Yarn task is used) yarnWorkDir = file("${project.projectDir}/.gradle/yarn") // The Node.js project directory location // This is where the package.json file and node_modules directory are located // By default it is at the root of the current project nodeProjectDir = file("${project.projectDir}/src/main/resources/static") // Whether the plugin automatically should add the proxy configuration to npm and yarn commands // according the proxy configuration defined for Gradle // Disable this option if you want to configure the proxy for npm or yarn on your own // (in the .npmrc file for instance) nodeProxySettings = ProxySettings.SMART } dependencies { // View Template Engine implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // Security implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' //Web implementation 'org.springframework.boot:spring-boot-starter-mail' implementation 'org.springframework.boot:spring-boot-starter-web' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '2.7.5' //Persistence implementation 'org.springframework.boot:spring-boot-starter-data-jpa' runtimeOnly 'com.h2database:h2' runtimeOnly 'com.mysql:mysql-connector-j' // LomBok compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' // Dev developmentOnly 'org.springframework.boot:spring-boot-devtools' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' //Test Implementation testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' } tasks.named('test') { useJUnitPlatform() } processResources.dependsOn('npmInstall')
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
Filter 람다식 관련 질문드립니다.
안녕하세요!Custim Filter 강의 중 아래 코드 부분에서 GatewayFilter의 생성자가 exchange와 chain이기 때문에 return (exchange, chain) -> { .. 이 되는 것 까지는 이해를 하였습니다.그런데 이 때 exchange와 chain 변수가 어디에서 정의되어서 여기서 사용되는 건지 잘 모르겠습니다 ㅠㅠ return (exchange, chain) -> {// GatewayFilter의 생성자 Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain);