Class ServiceDiscoveryBuilder<T>


  • public class ServiceDiscoveryBuilder<T>
    extends java.lang.Object
    • Method Detail

      • builder

        public static <T> ServiceDiscoveryBuilder<T> builder​(java.lang.Class<T> payloadClass)
        Return a new builder.
        Parameters:
        payloadClass - the class of the payload of your service instance (you can use Void if your instances don't need a payload)
        Returns:
        new builder
      • build

        public ServiceDiscovery<T> build()
        Build a new service discovery with the currently set values. If not set, the builder will be defaulted with a JsonInstanceSerializer.
        Returns:
        new service discovery
      • client

        public ServiceDiscoveryBuilder<T> client​(org.apache.curator.framework.CuratorFramework client)
        Required - set the client to use
        Parameters:
        client - client
        Returns:
        this
      • basePath

        public ServiceDiscoveryBuilder<T> basePath​(java.lang.String basePath)
        Required - set the base path to store in ZK
        Parameters:
        basePath - base path
        Returns:
        this
      • thisInstance

        public ServiceDiscoveryBuilder<T> thisInstance​(ServiceInstance<T> thisInstance)
        Optional - instance that represents the service that is running. The instance will get auto-registered
        Parameters:
        thisInstance - initial instance
        Returns:
        this