3

Dear Spring developers!

I would like to setup the spring cloud configserver from offical docs, and from sample codes. It works for me, and I would like to refresh my properties at runtime, if I change it github.

I already added the spring-cloud-config-monitor dependency as well, and I would like to use Kafka for change event broadcasting. I read it in docs, that it is possible, but I can't configure the configserver's spring-cloud-starter-bus-kafka and the clients's spring-cloud-starter-bus-kafka.

I also used a zookeeper, and kafka in docker, it works well.

Can anyone help me about how to configure kafka bus to configserver, and configclient?

Thanks

Lovi
  • 45
  • 5

2 Answers2

1
spring:
  cloud:
    stream:
      kafka:
        binder:
          brokers: host1:port1,host2:port2
          zkNodes: host1:port1,host2:port2
          zkSessionTimeout: 6000

This worked for me. If you want to configure external Kafka brokers then the config should be by default convention of spring cloud kafka connector.

0
spring:
  cloud:      
    bus:     
      enabled: true
    stream:
      kafka:
        binder:
          zkNodes: localhost:9092,127.0.0.1:9092
          brokers: localhost:2181,127.0.01:2181
  • BTW I added localhost and 127.0.0.1 to give you an idea if you had multiple nodes for your ZK and Kafka – Malike St Oct 11 '17 at 14:54
  • I've tried adding the above to my app to do a similar thing, but instead of localhost, I have my Kafka and Zookeeper running on a remote host. I can't get the spring-cloud-starter-bus-kafka libraries to pick up the remote addresses. It's like it's not seeing this yml. They always default to localhost, which fails for me. I'm about to try again with RabbitMQ. I should add I'm using Spring-boot 2.0.0.M7 so it's possibly not compatible yet. – MickG Dec 20 '17 at 01:45