@Bean
 @SneakyThrows
 public ServiceDiscovery<ZookeeperInstance> serviceDiscovery(
     CuratorFramework curatorFramework,
     InstanceSerializer<ZookeeperInstance> instanceSerializer,
     ZookeeperDiscoveryProperties zookeeperProperties) {
   ServiceDiscovery<ZookeeperInstance> serviceDiscovery =
       ServiceDiscoveryBuilder.builder(ZookeeperInstance.class)
           .client(curatorFramework)
           .basePath(zookeeperProperties.getRoot())
           .serializer(instanceSerializer)
           .build();
   serviceDiscovery.start();
   return serviceDiscovery;
 }
Пример #2
0
 public void start() throws Exception {
   serviceDiscovery.start();
 }