<spanid="streams-developer-guide-app-reset"></span><h1>Application Reset Tool<aclass="headerlink"href="#application-reset-tool"title="Permalink to this headline"></a></h1>
<p>You can reset an application and force it to reprocess its data from scratch by using the application reset tool.
This can be useful for development and testing, or when fixing bugs.</p>
and output) and <aclass="reference internal"href="manage-topics.html#streams-developer-guide-topics-internal"><spanclass="std std-ref">internal topics</span></a> differently
applications, it is your responsibility to adjust those downstream applications as appropriate when you reset the
upstream application.</li>
<li>Reset the local environment of your application instances. It is your responsibility to delete the local
state on any machine on which an application instance was run. See the instructions in section
<aclass="reference internal"href="#streams-developer-guide-reset-local-environment"><spanclass="std std-ref">Step 2: Reset the local environments of your application instances</span></a> on how to do this.</li>
<li><pclass="first">All instances of your application must be stopped. Otherwise, the application may enter an invalid state, crash, or produce incorrect results. You can verify whether the consumer group with ID <codeclass="docutils literal"><spanclass="pre">application.id</span></code> is still active by using <codeclass="docutils literal"><spanclass="pre">bin/kafka-consumer-groups</span></code>.
When long session timeout has been configured, active members could take longer to get expired on the broker thus blocking the reset job to complete. Use the <codeclass="docutils literal"><spanclass="pre">--force</span></code> option could remove those left-over members immediately. Make sure to shut down all stream applications when this option is specified to avoid unexpected rebalances.</p>
<li><pclass="first">Use this tool with care and double-check its parameters: If you provide wrong parameter values (e.g., typos in <codeclass="docutils literal"><spanclass="pre">application.id</span></code>) or specify parameters inconsistently (e.g., specify the wrong input topics for the application), this tool might invalidate the application’s state or even impact other applications, consumer groups, or your Kafka topics.</p>
<h2>Step 1: Run the application reset tool<aclass="headerlink"href="#step-1-run-the-application-reset-tool"title="Permalink to this headline"></a></h2>
<p>Invoke the application reset tool from the command line</p>
<p>Warning! This tool makes irreversible changes to your application. It is strongly recommended that you run this once with <codeclass="docutils literal"><spanclass="pre">--dry-run</span></code> to preview your changes before making them.</p>
empty internal state, but not reprocess previous data, simply omit the parameter <codeclass="docutils literal"><spanclass="pre">--input-topics</span></code>.
<spanid="streams-developer-guide-reset-local-environment"></span><h2>Step 2: Reset the local environments of your application instances<aclass="headerlink"href="#step-2-reset-the-local-environments-of-your-application-instances"title="Permalink to this headline"></a></h2>
<p>For a complete application reset, you must delete the application’s local state directory on any machines where the
application instance was run. You must do this before restarting an application instance on the same machine. You can
use either of these methods:</p>
<ulclass="simple">
<li>The API method <codeclass="docutils literal"><spanclass="pre">KafkaStreams#cleanUp()</span></code> in your application code.</li>
<li>Manually delete the corresponding local state directory (default location: <codeclass="docutils literal"><spanclass="pre">/${java.io.tmpdir}/kafka-streams/<application.id></span></code>). For more information, see <ahref="/{{version}}/javadoc/org/apache/kafka/streams/StreamsConfig.html#STATE_DIR_CONFIG">Streams</a> javadocs.</li>