SpringCloud - ConfigServer - RabbitMQ - Client doesn't receive message from ConfigService

拟墨画扇 提交于 2019-12-13 17:22:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!