protected override void DoRegister(ServiceMetadata metadata) { try { _zkClient.EnsurePathRecursive(metadata.FullPath, true); _zkClient.CreateOrReplace(metadata.FullPath, metadata.ToBytes(), CreateMode.Ephemeral); } catch (Exception ex) { var message = string.Format("Fail to register metadata[{0}] to zookeeper, cause : {1}", metadata, ex.Message); throw new Exception(message, ex); } }