목록Java (42)
Mini

Spring Cloud Bus는 분산 시스템의 구성 변경사항을 실시간으로 전파하는 메시징 시스템주요 특징: - 메시지 브로커(RabbitMQ/Kafka)를 통한 마이크로서비스 간 통신 - Config Server의 설정 변경사항 자동 전파 - @RefreshScope 빈들의 자동 갱신 - /actuator/busrefresh 엔드포인트로 수동 갱신 가능 설정 예시:config-serveruser-service, api-gateway레빗mq, 액츄에이터를 yml에 써주면 된다. 설정 변경 시 동작 과정:1. 설정 변경2. /actuator/bus-refresh 호출3. Spring Cloud Bus가 변경사항을 모든 서비스에 전파4. 각 서비스의 @RefreshScope 빈 갱신 * 결과yml 값을 바꾸고..

package hello.servlet;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.web.servlet.ServletComponentScan;@ServletComponentScan //서블릿 직접등록후 사용하겠음.@SpringBootApplicationpublic class ServeltApplication { public static void main(String[] args) { SpringApplication.run(ServeltApplication.class,..
main에 @ServletComponentScan 을 달아주면된다.@ServletComponentScan //서블릿 직접등록후 사용하겠음.package hello.servlet;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.web.servlet.ServletComponentScan;@ServletComponentScan //서블릿 직접등록후 사용하겠음.@SpringBootApplicationpublic class ServeltApplication { public static voi..


* 하이버네이트 버전설정, db 설정 4.0.0 jpa-basic ex1-hello-jpa 1.0.0 17 17 UTF-8 org.hibernate hibernate-core 6.4.2.Final javax.xml.bind jaxb-api 2.3.1 com.h2database h2 2.2.224 ch.qos.logback logback-classic 1.4.14 --> //db 뭐쓸건지 //사투리 설정 //쿼리..
1. ByteArrayOutputStream에 출력물담기 2. assertThat(msg.toString.contain)로 비교하면된다. package christmas.view; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; class OutputViewTest { private static ByteArrayOutputStream outputMessage; ..