# ElasticSearch and RabbitMQ: disconnected after inactivity

**URL:** <https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695>\
**Category:** Elasticsearch\
**Created:** [July 8, 2013, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695 "2013-07-08T10:56:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![11124](https://avatars.discourse-cdn.com/v4/letter/1/b5a626/32.png) [@11124](https://discuss.elastic.co/u/11124)\
**Post date:** [July 8, 2013, 10:56am UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/1 "2013-07-08T10:56:09Z")

</div>

Hi all,

I have a setup with two node RabbitMQ cluster and ElasticSearch server with  
RabbitMQ river that acts as consumer of RabbitMQ queue.  
I use it proof of concept purposes to test if this configuration works,  
what is the load that can take etc.  
I have the following problem: after some inactivity - no data is to ES over  
RabbitMQ - I am not able to send data to ES again.  
How I reproduce the situation: restart ES, the river connects to RabbitMQ  
and it is ready to receive messages. I wait for say 60-90 minutes. When I  
look at RabbitMQ Web UI it looks like there is connection between RabbitMQ  
and ES - there is a registered consumer. When I try to put message in the  
queue the river disconnects and I am not able to send messages to ES  
anymore. Netstat shows that there is open connection between the river and  
RabbitMQ. The only solution is to restart ES.

My questions are:  
Is this a normal behavior?  
Is there anything like timeout, heartbeat that can cause this behavior?  
Do I have to simulate heartbeat to keep the river connected?  
Can I reconnect the river without restarting ES server?

Are there any tools how to debug this?

Thanks in advance

best regards,  
nickolay kolev

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Michael\_Klishin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_klishin/32/1062_2.png) [@Michael\_Klishin](https://discuss.elastic.co/u/Michael_Klishin)\
**Post date:** [July 8, 2013, 11:04am UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/2 "2013-07-08T11:04:49Z")

</div>

2013/7/8 Николай Колев [lem00na@gmail.com](mailto:lem00na@gmail.com)

> Is there anything like timeout, heartbeat that can cause this behavior?

Your OS or firewall seem to be closing TCP connections it considers idle.

> Do I have to simulate heartbeat to keep the river connected?

RabbitMQ Java client lets you set a heartbeat value (the default value used  
unless you tune it is 30 minutes).

I'm not sure if the ES river may be disabling that setting, intentionally  
or not (it should not).

## Not sure why it does not try to reconnect either.

MK

> **[michaelklishin - Overview](https://github.com/michaelklishin)**
>
> Infrastructure, data services, distributed systems, Erlang, Elixir, Rust - michaelklishin

[http://twitter.com/michaelklishin](http://twitter.com/michaelklishin)

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 8, 2013, 12:17pm UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/3 "2013-07-08T12:17:16Z")

</div>

We don't disable heartbeat so I assume it's using default value.  
We can expose it as an option though. Issue opened: [https://github.com/elasticsearch/elasticsearch-river-rabbitmq/issues/29](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/issues/29)

@nickolay: which versions of elasticsearch and rabbitMQ river are you using?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 8 juil. 2013 à 13:04, Michael Klishin [michael.s.klishin@gmail.com](mailto:michael.s.klishin@gmail.com) a écrit :

> 2013/7/8 Николай Колев [lem00na@gmail.com](mailto:lem00na@gmail.com)  
> Is there anything like timeout, heartbeat that can cause this behavior?
> 
> Your OS or firewall seem to be closing TCP connections it considers idle.
> 
> Do I have to simulate heartbeat to keep the river connected?
> 
> RabbitMQ Java client lets you set a heartbeat value (the default value used unless you tune it is 30 minutes).
> 
> I'm not sure if the ES river may be disabling that setting, intentionally or not (it should not).
> 
> ## Not sure why it does not try to reconnect either.
> 
> MK
> 
> [michaelklishin (Michael Klishin) · GitHub](http://github.com/michaelklishin)  
> [http://twitter.com/michaelklishin](http://twitter.com/michaelklishin)
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11124](https://avatars.discourse-cdn.com/v4/letter/1/b5a626/32.png) [@11124](https://discuss.elastic.co/u/11124)\
**Post date:** [July 8, 2013, 12:27pm UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/4 "2013-07-08T12:27:24Z")

</div>

Hi Michael, David,

Michael: I have a conversation with the system admins and they confirmed  
that there is a rule that closes inactive for one hour sessions.

David: I will create river with that option and will test; will write back  
about the results  
about versions:  
RabbitMQ 2.8.6  
ElasticSearch: 0.90.2

Thanks both for the support

best regards,  
nickolay kolev

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 8, 2013, 12:48pm UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/5 "2013-07-08T12:48:29Z")

</div>

I was asking for rabbitmq _river_ version. I assume it's 1.6.0, right?  
Could you check that the latest version on master branch works as you are expecting? See commit: [Expose heartbeat option · elastic/elasticsearch-river-rabbitmq@e3ed899 · GitHub](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/commit/e3ed8994ba39a3278422bf841a3a0f2842a812b6)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 8 juil. 2013 à 14:27, Николай Колев [lem00na@gmail.com](mailto:lem00na@gmail.com) a écrit :

> Hi Michael, David,
> 
> Michael: I have a conversation with the system admins and they confirmed that there is a rule that closes inactive for one hour sessions.
> 
> David: I will create river with that option and will test; will write back about the results  
> about versions:  
> RabbitMQ 2.8.6  
> Elasticsearch: 0.90.2
> 
> Thanks both for the support
> 
> best regards,  
> nickolay kolev
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11124](https://avatars.discourse-cdn.com/v4/letter/1/b5a626/32.png) [@11124](https://discuss.elastic.co/u/11124)\
**Post date:** [July 8, 2013, 1:05pm UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/6 "2013-07-08T13:05:19Z")

</div>

Hi David,

Sorry for misunderstanding,  
yes the version is 1.6.0  
will test and come later with results

best regards,  
nickolay kolev

08 юли 2013, понеделник, 15:48:29 UTC+3, David Pilato написа:

> I was asking for rabbitmq _river_ version. I assume it's 1.6.0, right?  
> Could you check that the latest version on master branch works as you are  
> expecting? See commit:  
> [Expose heartbeat option · elastic/elasticsearch-river-rabbitmq@e3ed899 · GitHub](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/commit/e3ed8994ba39a3278422bf841a3a0f2842a812b6)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 8 juil. 2013 à 14:27, Николай Колев \<[lem...@gmail.com](mailto:lem...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi Michael, David,
> 
> Michael: I have a conversation with the system admins and they confirmed  
> that there is a rule that closes inactive for one hour sessions.
> 
> David: I will create river with that option and will test; will write back  
> about the results  
> about versions:  
> RabbitMQ 2.8.6  
> Elasticsearch: 0.90.2
> 
> Thanks both for the support
> 
> best regards,  
> nickolay kolev
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![11124](https://avatars.discourse-cdn.com/v4/letter/1/b5a626/32.png) [@11124](https://discuss.elastic.co/u/11124)\
**Post date:** [July 9, 2013, 6:13am UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/7 "2013-07-09T06:13:09Z")

</div>

Hi David,

I can confirm that the patch works.  
I have compiled and installed latest revision and I works as expected.  
Thanks for the great work.

best regards,  
nickolay kolev

08 юли 2013, понеделник, 15:48:29 UTC+3, David Pilato написа:

> I was asking for rabbitmq _river_ version. I assume it's 1.6.0, right?  
> Could you check that the latest version on master branch works as you are  
> expecting? See commit:  
> [Expose heartbeat option · elastic/elasticsearch-river-rabbitmq@e3ed899 · GitHub](https://github.com/elasticsearch/elasticsearch-river-rabbitmq/commit/e3ed8994ba39a3278422bf841a3a0f2842a812b6)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)  
> | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 8 juil. 2013 à 14:27, Николай Колев \<[lem...@gmail.com](mailto:lem...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi Michael, David,
> 
> Michael: I have a conversation with the system admins and they confirmed  
> that there is a rule that closes inactive for one hour sessions.
> 
> David: I will create river with that option and will test; will write back  
> about the results  
> about versions:  
> RabbitMQ 2.8.6  
> Elasticsearch: 0.90.2
> 
> Thanks both for the support
> 
> best regards,  
> nickolay kolev
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:27am UTC](https://discuss.elastic.co/t/elasticsearch-and-rabbitmq-disconnected-after-inactivity/12695/8 "2017-07-06T02:27:31Z")

</div>


