问题
I'm trying to make a ConfigServer Remote and Client with Gitlab repository. The ConfigServer receives the notification of push through a Webhooks, but it doesn´t send the message to the client. I run a RabbitMQ with Docker, and I can see in the rabbit's console that the services are connected with it. So I don´t know what is the problem.
The configServer pom file looks like:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
ConfigServes's propertie file looks like:
server.port:8888
spring.cloud.config.server.git.uri:https://gitlab.com/user/repo-properties.git
spring.cloud.config.server.git.username:user
spring.cloud.config.server.git.password:pass
spring.rabbitmq.host:172.17.0.1
spring.rabbitmq.port:5672
spring.rabbitmq.username:guest
spring.rabbitmq.password:guest
spring.cloud.bus.enabled:true
management.security.enabled:false
spring.cloud.config.server.monitor.gitlab.enabled:true
spring.profiles.active:desa
The pom of the client looks like:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
And the application.yml of the client looks like:
spring:
rabbitmq:
host: 172.17.0.1
port: 5672
username: guest
password: guest
application:
name: user-server-config
cloud:
config:
uri: http://localhost:8888
profiles:
active: desa
I run rabbit with Docker with: sudo docker run --name rabbitmq -p 5672:5672 rabbitmq
I created a Webhooks in Gitlab. When a push a change, the ConfigServer receives the notification of /monitor, but the client doesn't receives the changes, does not receive anything. I don't know how to resolve this.
Thanks!
来源:https://stackoverflow.com/questions/42894061/springcloud-configserver-rabbitmq-client-doesnt-receive-message-from-conf