一 新建项目microservice-consumer-movie-ribbon-hystrix-turbine-mq
二 为项目添加依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
三 在配置文件中添加如下内容,连接RabbitMQ
server:
port: 8010
spring:
application:
name: microservice-consumer-movie
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
eureka:
client:
serviceUrl:
defaultZone:http://localhost:8761/eureka/
instance:
prefer-ip-addr