# Ecotone Phases

## Phases

To increase application speed **Ecotone works in three phases**.

## **Compile Phase:**

In this Phase, Ecotone is looking for all the configuration. This is optimized to look only for concrete Ecotone classes and scan our application level catalog (Depending on the configuration).

After all configuration is collected, Ecotone executes Modules in order to prepare them.\
Each Module produces it's own set of configuration, like Command Handlers, Event Handlers, Interceptors etc. After this all the configuration is registered in Messaging system and we are ready to move to the next phase.

## **Dumping Phase:**

After all configuration is collected, Ecotone will dump the configuration, so it can be reused between requests. This depending on the integration, may be dumped directly to our Depedency Container or as a separate configuration file.

The configuration now is ready to be re-used.

## Execution Phase:

Execution Phase is executing Messaging Flow. This happen when we actually trigger Command or Query Bus on Run Time for example.\
In this phase there is no need for collecting or dumping the configuration anymore, as that was already done. Therefore Ecotone load already prepared configuration and executes.

The big advantage of Ecotone is that during Execution Phase, it only executes and load the configuration for the flow that is being executed. This way the speed of execution can be preserved even for big projects.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ecotone.tech/messaging/contributing-to-ecotone/ecotone-phases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
