Not really. Instance cleanup is part of x-discovery-server.  When create a 
service node of static from Java API, there is no parameter for refreshing 
time. Nor there is cleanup object.  A general question is that are all three 
types of services supported in Java API and RESTFul API? Here is the summary 
from my tests:

Java API,
-  Dynamic service works.  An ephemeral node is created at ZK.
- Static/Permanent service doesn't work.  Normal node is created at ZK but get 
deleted when program exits.

RESTFul API,
- Not able to create dynamic service node. Got error

Caused by: com.sun.jersey.api.client.UniformInterfaceException: PUT 
http://localhost:51234/v1/service/staticSvc/8193610a-bdd6-4c2f-a9ec-6dc7c89b8679
 returned a response status of 400 Bad Request

- Static and permanent work fine.

Thanks,
Ying-Yi

On Feb 6, 2014, at 6:38 PM, Jordan Zimmerman 
<[email protected]<mailto:[email protected]>>
 wrote:

This sounds like https://issues.apache.org/jira/browse/CURATOR-81 which is 
fixed in 2.4.1 which will be released any day now. Let me know if it’s 
something different.

-JZ

________________________________
From: Huang, Ying-Yi Huang, Ying-Yi<mailto:[email protected]>
Reply: [email protected]<mailto:[email protected]> 
[email protected]<mailto:[email protected]>
Date: February 6, 2014 at 6:33:47 PM
To: [email protected]<mailto:[email protected]> 
[email protected]<mailto:[email protected]>
Subject:  Static/Permanent service type
When I use service discovery Java API to register a service instance, the 
service type default is dynamic. The service instance node is ephemeral in 
ZooKeeper so the node is deleted when the program exits. However, if I set the 
service type to static or permanent, the node is still deleted when the program 
exits. At ZooKeeper, the node created is not ephemeral though. I am wondering 
if this is by design. Is there any way to create static/permanent service with 
Java API? Or they can only be created with RESTFul API though x-discover-server.

Thanks,
Ying-Yi

Reply via email to