리스트(232)
-
IntelliJ - 스프링 부트 Active Profile 설정 방법
스프링부트로 개발 시 application.yml 혹은. properties 파일에 profiles를 설정을 하여 실행환경을 다르게 두어 동작이 필요로 할 때가 있다. 인텔리제이 무료버전에서 active-profile을 설정하여 실행하는 법을 알아보자 spring: profiles: active: local ..... spring: profiles: active: batch 방법 1. 상단의 실행 버튼의 Edit Configuration을 클릭한다. 2. Modify options > Add VM options을 실행 후 -Dspring.profiles.active="실행시킬 profile명" 입력 후 저장한다. 3. 실행하면 "The following 1 profile is active: ..." 라는..
2023.01.24 -
스프링 이벤트 처리
✅ 아래 내용들에 대해서 알아보자 - 이벤트란 무엇일까? - 스프링 이벤트 처리 방법 - 예제 코드 & 실습 - 이벤트 발송 프로세스 이벤트란? 컴퓨팅에서 이벤트(event)란 프로그램에 의해 감지되고 처리될 수 있는 동작이나 사건을 의미합니다. 예를 들어 사용자가 키보드의 키를 누르는 행위, 사용자가 화면의 버튼을 누르는 것 등의 행위들을 의미한다. 분산 시스템 간에 이벤트를 생성, 발행(publish)하고 발행된 이벤트를 필요로하는 수신자에게 전달하여 수신자가 이벤트를 처리하는 형태의 시스템 아키텍처를 Event-driven-architecture(EDA)라고 한다. 스프링 이벤트 처리 방법 스프링의 Application context는 BeanFactory 기능 말고 여러가지 기능들을 제공하는데 그..
2023.01.20 -
Webflux + Swagger 적용하기
Webflux 환경에서 Swagger를 적용해보자! 1. Webflux에서 Swagger를 사용하기 위해서는 build.gradle에 스웨거 사용을 위해 추가를 한다.(각자 버전에 맞게 설정) implementation "io.springfox:springfox-swagger2:${swaggerVersion}" implementation "io.springfox:springfox-swagger-ui:${swaggerVersion}" implementation "io.springfox:springfox-spring-webflux:${swaggerVersion}" implementation "io.springfox:springfox-bean-validators:${swaggerVersion}" 2. 스웨거를..
2023.01.17 -
Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
현상 인텔리제이에서 빌드 시 아래 오류가 발생 하였음 - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.6') - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-..
2023.01.03 -
QDSL - 기본 문법
이 글은 김영한님의 QueryDSL 강의를 듣고 정리한 글입니다. where 조건을 사용한 특정 멤버 찾기(JPQL VS Querydsl ) @DisplayName("특정 멤버를 찾는 JPQL 예시") @Test public void startJPQL() { //given, then //member1을 찾아라 Member findMember = em.createQuery("select m from Member m where m.username =:username", Member.class) .setParameter("username", "member1") .getSingleResult(); //then assertThat(findMember.getUsername()).isEqualTo("member1")..
2022.12.08 -
Equasls, HashCode에 대해서 알아보자
✅ 아래 내용들에 대해서 알아보자 - 동일성 & 동등성 - Equals & HashCode 동일성 & 동등성 동일성이란 객체가 메모리에서 고유하게 식별되는 것을 의미한다. 즉, 객체의 참조값(주소값)이 같은 경우 두 객체는 동일한 객체이고 Java에서 == 연산자를 통해 비교할 수 있다. 동등성이란 객체가 가지고 있는 값이 같은 경우 두 객체는 동등한 객체라고 의미한다. 자바에서 equals() 메서드를 재정의하여 동등성을 비교할 수 있다. 동일성과 동등성 차이를 예시 코드를 보면서 이해해 보자. class anyClass{ int value; public anyClass(int value) { this.value = value; } //equals 재정의 @Override public boolean e..
2022.12.06