Class ConsulHelpers


  • public class ConsulHelpers
    extends Object
    Set of utilities that assist in populating a service registration.
    • Constructor Detail

      • ConsulHelpers

        public ConsulHelpers()
    • Method Detail

      • newDefaultMetadata

        public static Map<String,​String> newDefaultMetadata​(ServiceInfo serviceInfo)
        Creates a map with default metadata items that the ConsulRegistryClient will be looking for when it converts a registered service back into a ServiceInstance.

        This map is intended to be a baseline of metadata to register. This map is modifiable, so it can easily be changed or added to later in the registration process.

        Parameters:
        serviceInfo - the information about the service to pull data from.
        Returns:
        a map that is pre-populated with defaults.
      • newDefaultMetadata

        public static Map<String,​String> newDefaultMetadata​(ServiceInstance serviceInstance)
        Creates a map with default metadata items that the ConsulRegistryClient will be looking for when it converts a registered service back into a ServiceInstance.

        This map is intended to be a baseline of metadata to register. This map is modifiable, so it can easily be changed or added to later in the registration process.

        Parameters:
        serviceInstance - the information about the service to pull data from.
        Returns:
        a map that is pre-populated with defaults.