# Detach java agent runtime

**URL:** <https://discuss.elastic.co/t/detach-java-agent-runtime/191870>\
**Category:** APM\
**Tags:** java\
**Created:** [July 23, 2019, 4:41pm UTC](https://discuss.elastic.co/t/detach-java-agent-runtime/191870 "2019-07-23T16:41:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gajanan8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gajanan8086/32/50604_2.png) [@gajanan8086](https://discuss.elastic.co/u/gajanan8086)\
**Post date:** [August 7, 2019, 11:39am UTC](https://discuss.elastic.co/t/detach-java-agent-runtime/191870/3 "2019-08-07T11:39:38Z")

</div>

If we just use `elastic.apm.active=false`, no matter how long we wait threads `apm-reporter`, `apm-request-timeout-timer`, `configuration-reloader`, `apm-metrics-reporter` will still be running. The only way to stop these threads is using stop method.

Please refer the [Other Thread](https://discuss.elastic.co/t/java-apm-client-transfer-transaction-information-when-using-blockingqueue-instead-of-executorservice/191781/11) to know why I want all threads to be closed, issue with `active` flag and what are the actions I am taking to dettach the agent.

---

_[View the full topic](https://discuss.elastic.co/t/detach-java-agent-runtime/191870)._
