code: public static String encodeMetadata(ServiceEndpoint serviceEndpoint) {
      try {
        return objectMapper.writeValueAsString(serviceEndpoint);
      } catch (IOException e) {
        LOGGER.error("Failed to write metadata: " + e);
        throw Exceptions.propagate(e);
      }
    }
docs: Encodes {@link ServiceEndpoint} into raw String.
  
  @param serviceEndpoint - service endpoint to encode.
  @return encoded {@link ServiceEndpoint}. In case of deserialization error throws {@link
  IOException}