<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>
output, and intermediate topics) and <aclass="reference internal"href="manage-topics.html#streams-developer-guide-topics-internal"><spanclass="std std-ref">internal topics</span></a> differently
when resetting the application.</p>
<p>Here’s what the application reset tool does for each topic type:</p>
<ulclass="simple">
<li>Input topics: Reset to the beginning of the topic. This means that it sets the application’s committed consumer offsets for all partitions to each partition’s <codeclass="docutils literal"><spanclass="pre">earliest</span></code> offset (for consumer group <codeclass="docutils literal"><spanclass="pre">application.id</span></code>).</li>
<li>Intermediate topics: Skip to the end of the topic, i.e., set the application’s committed consumer offsets for all partitions to each partition’s <codeclass="docutils literal"><spanclass="pre">logSize</span></code> (for consumer group <codeclass="docutils literal"><spanclass="pre">application.id</span></code>).</li>
<li>Internal topics: Delete the internal topic (this automatically deletes any committed offsets).</li>
</ul>
<p>The application reset tool does not:</p>
<ulclass="simple">
<li>Reset output topics of an application. If any output (or intermediate) topics are consumed by downstream
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>
</ul>
<dlclass="docutils">
<dt>Prerequisites</dt>
<dd><ulclass="first last">
<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>.</p>
</li>
<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>
</li>
<li><pclass="first">You should manually delete and re-create any intermediate topics before running the application reset tool. This will free up disk space in Kafka brokers.</p>
</li>
<li><pclass="first">You should delete and recreate intermediate topics before running the application reset tool, unless the following applies:</p>
<blockquote>
<div><ulclass="simple">
<li>You have external downstream consumers for the application’s intermediate topics.</li>
<li>You are in a development environment where manually deleting and re-creating intermediate topics is unnecessary.</li>
<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>
--config-file <String: file name> Property file containing configs to be
passed to admin clients and embedded
consumer.
--dry-run Display the actions that would be
performed without executing the reset
commands.
--input-topics <String: list> Comma-separated list of user input
topics. For these topics, the tool will
reset the offset to the earliest
available offset.
--intermediate-topics <String: list> Comma-separated list of intermediate user
topics <spanclass="o">(</span>topics used in the through<spanclass="o">()</span>
method<spanclass="o">)</span>. For these topics, the tool
will skip to the end.
--zookeeper Zookeeper option is deprecated by
bootstrap.servers, as the reset tool
would no longer access Zookeeper
directly.
</pre></div>
</div>
<p>Parameters can be combined as needed. For example, if you want to restart an application from an
empty internal state, but not reprocess previous data, simply omit the parameters <codeclass="docutils literal"><spanclass="pre">--input-topics</span></code> and
<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">/var/lib/kafka-streams/<application.id></span></code>). For more information, see <aclass="reference internal"href="../javadocs.html#streams-javadocs"><spanclass="std std-ref">state.dir</span></a> StreamsConfig class.</li>