본문 바로가기

MSA

21. Spring Cloud Bus(broadcast push update)로 Config 적용하기 - #2

1. AMQP(Advanced Message Queuing Protocol) 사용을 위한 Config Server, api-gateway 및 microservice dependency 추가

1-1. Config Server

actuator, amqp, bootstrap 추가

1-2. api-gateway 및 microservice (actuator은 기 설정)

2. application.yml에 rabbitmq 사용 설정 및 actuator busrefresh 추가

rabbitmq 설정과 actuator endpoint busrefresh 추가

3. eureka, rabbitMQ, config, api-gateway, micro service 모두 기동

eureka, config application.yml, rabbitMQ console, api-gateway application.yml 설정

* config server 기동 시 No such label: main 오류 메시지는 config서버의 git repository에서 찾는 branch라 master인 경우 main으로 브랜치 변경을 하면 해소된다

브랜치 교정후 기동을 하면 그림과 같이 rabbitMQ가 정상 연동됨을 확인할 수 있다
같이 기동한 micro service도 rabbitmq에 연동이 잘 되어 있다
api-gateway도 rabbitmq 연동이 잘 되어 있다