파란하늘의 지식창고
What's New in Spring Framework 6.x
Study/Java 2022. 11. 30. 01:28

https://github.com/spring-projects/spring-framework/wiki/What%27s-New-in-Spring-Framework-6.x 106 revision 기준으로 작성됨 What's New in Version 6.1 Core Container virtual threads 및 JDK 21와 전반적으로 호환됨. virtual thread에 대한 Configuration option: 전용 VirtualThreadTaskExecutor 와 SimpleAsyncTaskExecutor의 virtual threads mode, 그리고 new-thread-per-task strategy 와 virtual threads mode가 있는 유사한 SimpleAsyncTaskSchedu..

Spring Boot 3.0 Migration Guide
Study/Java 2022. 11. 28. 17:57

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide 3 revision 기준으로 작성됨 이 문서는 application을 Spring Boot 3.0으로 migration 하는데 도움을 주기 위한 것입니다. Before You Start Upgrade to the Lastest 2.7.x Version upgrade를 시작하기 전에 사용 가능한 최신 2.7.x 버전으로 upgrade 해야 합니다. 이렇게 하면 해당 라인의 최신 dependency에 대해 빌드하고 있는지 확인할 수 있습니다. Review Dependencies Spring Boot 3으로 이동하면 많은 dependency가 upgrade 되며..

Spring Boot 3.0 Release Notes
Study/Java 2022. 11. 27. 03:30

전체 Release Notes 목록은 이 곳에서 확인할 수 있습니다. https://luvstudy.tistory.com/tag/Release%20Notes https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes 21 revision 기준으로 작성됨 Upgrading from Spring Boot 2.7 이것은 Spring boot의 주요 release이기 때문에 기존 application을 upgrade하는 것은 평소보다 조금 복잡할 수 있습니다. 기존 Spring Boot 2.7 application을 upgrade하는데 도움이 되는 전용 migration guide를 마련했습니다. 현재 이전 버전의 Sprin..

Spring Boot GraphQL 사용해보기
Study/Java 2022. 9. 2. 04:34

GraphQL 소개 GraphQL은 페이스북에서 만든 API를 위한 쿼리 언어이다. SQL과 유사하게 사용하는 웹 요청용 쿼리를 정의한 규약이고 많이 사용하는 REST API와 다른 형식의 요청이라고 생각하면 된다. REST API의 경우 요청 주소에 따라 응답 결과를 얻게 되지만 GraphQL은 단일 요청 주소로 질의한 쿼리 별 대한 응답 결과를 얻는 차이가 있다. GraphQL 홈페이지 GraphQL for Java/Kotlin GraphQL은 다양한 언어에 대한 라이브러리를 제공하고 있다. Code using GraphQL 이 중 Java에서 사용하기 위한 라이브러리 항목은 다음을 참고한다. Code using GraphQL Java/Kotlin Spring for GraphQL 이 중 graphq..

article thumbnail
Spring Rest Docs로 OpenAPI (Swagger) 문서를 만들어 Swagger UI로 호출하여 보기
Study/Java 2022. 6. 17. 19:08

이 글의 내용은 Spring Rest Docs를 이미 사용하고 있는 상황에서 OpenAPI 문서를 만들기 위한 내용을 담고 있습니다. OpenAPI Specification 소개 OpenAPI Specification은 예전엔 Swagger Specification으로 알려졌었다. OpenAPI Specification은 Rest API에 대해 문서화를 하기 위한 사양을 정의한 것으로 특정한 소프트웨어나 라이브러리가 아니다. SmartBear Software 회사가 자사 swagger framework에서 REST Api를 문서화하기 위해 사용하던 Swagger Specification을 공개하면서 Linux Foundation의 OpenAPI Initiative project로 관리가 이전되었다. ht..

Spring Boot Database Initialization
카테고리 없음 2022. 6. 13. 04:39

Spring Boot를 사용하면서 DataSource initialization에 대한 여러 방법을 알아보자. https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto.data-initialization “How-to” Guides Spring Boot has no mandatory logging dependency, except for the Commons Logging API, which is typically provided by Spring Framework’s spring-jcl module. To use Logback, you need to include it and spring-jcl on the class..

article thumbnail
Spring Cloud Config Server jdbc backend 사용해보기
Study/Java 2022. 6. 13. 01:25

개인적으로 spring cloud config server를 github repository와 연동해서 사용하고 있었다. 평상시 크게 불편함을 느끼지 못했는데 config server의 설정을 변경할 일이 있을 경우 손쉽게 값을 변경하기 어려워 테스트 하기 불편하여 jdbc로 변경하려고 한다. Spring Cloud Config Server backend 구성 spring cloud config server는 다양한 backend를 구성할 수 있도록 autoconfiguration을 지원하고 있다. EnvironmentRepositoryConfiguration에서 다양한 backend 구성 환경에 대한 설정을 제공하고 있는데 대략 다음과 같다. 이 중에 원하는 환경으로 구성하면 된다. Environmen..

@Validated annotation을 controller가 아닌 service, component layer에서 사용하기
Study/Java 2022. 6. 8. 19:47

@Controller가 아닌 @Service, @Component 등에서 @Validated 사용하기 일반적으로 @Controller에서 @Validated를 사용하여 validation을 사용한다. @PostMapping public BlogArticle create(@RequestBody @Validated(BlogArticle.Create.class) BlogArticle blogArticle) { return blogArticleService.create(blogArticle); } service나 component에서도 @Validated annotation을 사용할 수 있다. 다만 controller에서 사용하는 것과 그 외의 layer에서 사용하는 방법이 좀 차이가 있다. @Service @..