1. Spring Cloud Config Server 코드 전문 // build.gradle에 아래 내용을 추가 dependencies { implementation 'org.springframework.cloud:spring-cloud-config-server' } Spring Cloud Config Server로 동작하기 위한 디펜던시를 추가해둔다. # application.yml spring: application: name: my_first_config_server cloud: config: server: git: uri: https://github.com/injuk/spring_cloud_config_demo.git default-label: main server: # 포트는 자유롭게 설정하되,..
App.실행 직후 에러 없이 다음의 메시지와 함께 종료되는 경우가 있다. Process finished with exit code 0 이는 내장 톰캣과 관련된 문제라고 함. 실행은 되었는데, 톰캣에 올라가지 못한 것으로 보인다. 아래와 같이 추가해주자. dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' }
참고 java 8 default gc 오늘 java8 default gc에 대해서 검색을 해도 공식 문서에서는 잘 검색이 안된다. stackoverflow에 default가 parallelGC라고 하는 글들이 있어서 직접 실행해보았다. 우선 sdkman으로 최신 java를 설치한다. sdk.. shuiky.tistory.com [~] jps [~] # jps로부터 현재 실행 중인 Java의 pid 확인 [~] # 또는 그냥 jcmd 입력 [~] jcmd [jpid입력] VM.flags -XX:-BytecodeVerificationLocal -XX:-BytecodeVerificationRemote -XX:CICompilerCount=4 -XX:InitialHeapSize=268435456 -XX:+Mana..
참고 SpringBoot - 외부 프로퍼티 적용하기(application.properties) application.properties SpringBoot를 구동시 동작할 포트 정보, DB정보 등 여러가지 세팅 관련된 데이터나 별도의 경로 옵션등의 값을 프로퍼티에 넣어두고 사용됩니다. 기본 프로퍼티 위치는 /src/main/resou myhappyman.tistory.com 요약 실행시 명령어 매개변수 Java System 속성 OS 환경 변수 @ProperySource 패키징된 jar 외부의 애플리케이션 속성 패키징된 jar 내부의 애플리케이션 속성 기본 속성 실습 hello: ingnoh @SpringBootApplication @RestController @Log4j2 public class Dem..
Spring Boot 2.5.2 IntelliJ 2020.3.3 1. Eureka Server dependencies { implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server' developmentOnly 'org.springframework.boot:spring-boot-devtools' testImplementation 'org.springframework.boot:spring-boot-starter-test' } server: port: 8761 eureka: instance: appname: injuk-server client: fetch-registry: false register-with-eure..
특정 URL을 찔러 상태 코드를 확인하는 용도로 간단하게 사용하였음. openConnection 이후에 getResponseCode로 코드를 반환받는다. timeout, connection refused의 경우 Exception 핸들링이 필요하다. import java.net.ConnectException; import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.net.URL; @Log4j2 public class ServiceMonitoringService { public void getUrl(URL url) { try { HttpURLConnection connection = (HttpURLConnec..
1. Primitive type Stack 영역에 저장되며, '실제값'이 저장된다. 타입별 기본값이 있으므로 null은 존재하지 않는다. Primitive type 종류 : boolean, byte, short, int, long, float, double, char 2. Reference type Primitive 타입을 제외한 모든 유형 Heap 영역에 저장되며, 값이 저장되어 있는 '주소값'을 저장한다. 문법상으로는 에러가 없어도 런타임시 NullPointerException 등의 에러가 발생할 수 있다. 참고 : Wrapper Class? 클래스이므로 Reference type이다. 즉, null이 존재한다. Primitive type으로 표현할 수 있는 간단한 데이터를 객체로 만들어야할 경우에 ..
싱글톤 : 디자인 패턴에서, 생성자가 여러번 호출되더라도 실제로 생성되는 객체는 하나가 되는 방식 최초의 생성자 호출시 객체를 생성한 후, 이후의 생성자 호출에서는 최초에 생성된 객체만을 리턴 class Single { private static Single single; private Single() {} public static Single getInstance() { if(single == null) single = new Single(); return single; } /* private static Single single = new Single(); public static Single getInstance() { return single; } */ } class Main { public st..
- Total
- Today
- Yesterday
- etc
- kotlin
- hashicorp
- shell
- dev
- Java
- react
- Docker
- Linux
- IntelliJ
- javascript
- Gradle
- mysql
- pgloader
- Puppeteer
- 코딩테스트
- eureka
- AWS IoT
- Node.js
- Spring Cloud Config
- Vault
- JEST
- spring boot
- Database
- postgresql
- Git
- JPA
- AWS
- jQuery
- terraform
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |