You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by Narayanan A R <na...@gmail.com> on 2012/05/08 07:22:39 UTC

Ephermal node and notifications for stateless sessions

Hi,

Does ZK support ephermal node creation for stateless clients. Anyone has
dealt with similar requests? For instance, one or more clients would make
REST API call to a service and it in turns creates nodes in ZK. Connections
could be active between the service and ZK but not to the client. I am
looking something like a client would touch a znode periodically for the
heartbeat and if the heartbeat goes away, the nodes created by that client
should get deleted. Is this supported?

Similarly, I am looking for notifications for stateless clients. Basically
registering a post pack URL for ZK to make a callback.

Regards,
ARN

Re: Ephermal node and notifications for stateless sessions

Posted by Narayanan A R <na...@gmail.com>.
Thank you.

On Tue, May 8, 2012 at 7:29 AM, Camille Fournier <ca...@apache.org> wrote:

> In what you're describing, your service creates ephemeral nodes on behalf
> of its clients, and has to track the clients liveness. You're redoing a lot
> of the logic ZK would handle for you if you had your clients talk directly
> to ZK, but you can certainly reimplement that logic if you want. I think
> this is a less-than-ideal system design but if you have a system where
> stateful connections don't make sense it might be the best you can do.
>
> I would recommend spending some time with the ZK documentation and a
> highlighter, it sounds like you might want to design something fairly
> complex and it's useful to really understand the system well before you
> start on such a task.
>
> C
>
> On Tue, May 8, 2012 at 1:22 AM, Narayanan A R <
> narayanan.arunachalam@gmail.com> wrote:
>
> > Hi,
> >
> > Does ZK support ephermal node creation for stateless clients. Anyone has
> > dealt with similar requests? For instance, one or more clients would make
> > REST API call to a service and it in turns creates nodes in ZK.
> Connections
> > could be active between the service and ZK but not to the client. I am
> > looking something like a client would touch a znode periodically for the
> > heartbeat and if the heartbeat goes away, the nodes created by that
> client
> > should get deleted. Is this supported?
> >
> > Similarly, I am looking for notifications for stateless clients.
> Basically
> > registering a post pack URL for ZK to make a callback.
> >
> > Regards,
> > ARN
> >
>

Re: Ephermal node and notifications for stateless sessions

Posted by Camille Fournier <ca...@apache.org>.
In what you're describing, your service creates ephemeral nodes on behalf
of its clients, and has to track the clients liveness. You're redoing a lot
of the logic ZK would handle for you if you had your clients talk directly
to ZK, but you can certainly reimplement that logic if you want. I think
this is a less-than-ideal system design but if you have a system where
stateful connections don't make sense it might be the best you can do.

I would recommend spending some time with the ZK documentation and a
highlighter, it sounds like you might want to design something fairly
complex and it's useful to really understand the system well before you
start on such a task.

C

On Tue, May 8, 2012 at 1:22 AM, Narayanan A R <
narayanan.arunachalam@gmail.com> wrote:

> Hi,
>
> Does ZK support ephermal node creation for stateless clients. Anyone has
> dealt with similar requests? For instance, one or more clients would make
> REST API call to a service and it in turns creates nodes in ZK. Connections
> could be active between the service and ZK but not to the client. I am
> looking something like a client would touch a znode periodically for the
> heartbeat and if the heartbeat goes away, the nodes created by that client
> should get deleted. Is this supported?
>
> Similarly, I am looking for notifications for stateless clients. Basically
> registering a post pack URL for ZK to make a callback.
>
> Regards,
> ARN
>

Re: Ephermal node and notifications for stateless sessions

Posted by Patrick Hunt <ph...@apache.org>.
Part of what you're asking about is available. "if the heartbeat goes
away, the nodes created by that client should get deleted". That's
available in the current REST proxy in src/contrib/rest. See the
SPEC.txt file there for more details.

Patrick

On Mon, May 7, 2012 at 10:22 PM, Narayanan A R
<na...@gmail.com> wrote:
> Hi,
>
> Does ZK support ephermal node creation for stateless clients. Anyone has
> dealt with similar requests? For instance, one or more clients would make
> REST API call to a service and it in turns creates nodes in ZK. Connections
> could be active between the service and ZK but not to the client. I am
> looking something like a client would touch a znode periodically for the
> heartbeat and if the heartbeat goes away, the nodes created by that client
> should get deleted. Is this supported?
>
> Similarly, I am looking for notifications for stateless clients. Basically
> registering a post pack URL for ZK to make a callback.
>
> Regards,
> ARN