# Query a client node connection status

**URL:** <https://discuss.elastic.co/t/query-a-client-node-connection-status/3530>\
**Category:** Elasticsearch\
**Created:** [November 7, 2010, 1:55am UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530 "2010-11-07T01:55:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer\_doron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomer_doron/32/3304_2.png) [@tomer\_doron](https://discuss.elastic.co/u/tomer_doron)\
**Post date:** [November 7, 2010, 1:55am UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530/1 "2010-11-07T01:55:44Z")

</div>

is there some event that node/client dispatches when it connects/  
disconnects from the cluster? i am trying to find a a way to manage  
node's connection status, perhaps there a different methodology of  
achieving this?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 8, 2010, 9:44pm UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530/2 "2010-11-08T21:44:24Z")

</div>

There isn't a callback API for that on the client API level. You can try and  
call cluster health / state, if it returns, it means you are connected.

On Sun, Nov 7, 2010 at 3:55 AM, tomer doron [tomer.doron@gmail.com](mailto:tomer.doron@gmail.com) wrote:

> is there some event that node/client dispatches when it connects/  
> disconnects from the cluster? i am trying to find a a way to manage  
> node's connection status, perhaps there a different methodology of  
> achieving this?

---

<div class="post-metadata">

**Author:** ![tomer\_doron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomer_doron/32/3304_2.png) [@tomer\_doron](https://discuss.elastic.co/u/tomer_doron)\
**Post date:** [November 16, 2010, 3:37am UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530/3 "2010-11-16T03:37:02Z")

</div>

thanks shay, this is what i ended up doing (on a scheduler). however,  
i do think a callback/event for connection status changes would be  
nice addition. do you want me to open an enhancement ticket?

On Nov 8, 1:44 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> There isn't a callback API for that on the client API level. You can try and  
> call cluster health / state, if it returns, it means you are connected.
> 
> On Sun, Nov 7, 2010 at 3:55 AM, tomer doron [tomer.do...@gmail.com](mailto:tomer.do...@gmail.com) wrote:
> 
> > is there some event that node/client dispatches when it connects/  
> > disconnects from the cluster? i am trying to find a a way to manage  
> > node's connection status, perhaps there a different methodology of  
> > achieving this?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [November 16, 2010, 8:33am UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530/4 "2010-11-16T08:33:27Z")

</div>

Yea, sounds like a good idea!

On Tue, Nov 16, 2010 at 5:37 AM, tomer doron [tomer.doron@gmail.com](mailto:tomer.doron@gmail.com) wrote:

> thanks shay, this is what i ended up doing (on a scheduler). however,  
> i do think a callback/event for connection status changes would be  
> nice addition. do you want me to open an enhancement ticket?
> 
> On Nov 8, 1:44 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > There isn't a callback API for that on the client API level. You can try  
> > and  
> > call cluster health / state, if it returns, it means you are connected.
> > 
> > On Sun, Nov 7, 2010 at 3:55 AM, tomer doron [tomer.do...@gmail.com](mailto:tomer.do...@gmail.com)  
> > wrote:
> > 
> > > is there some event that node/client dispatches when it connects/  
> > > disconnects from the cluster? i am trying to find a a way to manage  
> > > node's connection status, perhaps there a different methodology of  
> > > achieving this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:16am UTC](https://discuss.elastic.co/t/query-a-client-node-connection-status/3530/5 "2017-07-06T04:16:26Z")

</div>


