> For the complete documentation index, see [llms.txt](https://docs.xplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplatform.com/talon/developing-applications/authoring-user-code/consensus-model/specifying-the-ha-policy.md).

# Specifying The HA Policy

The choice of a microservice's HA Policy, aka Consensus Model, is a design choice. Therefore, it is not a configurable option. Instead, the HA policy isspecified via the [AppHAPolicy](https://build.neeveresearch.com/core/javadoc/LATEST/com/neeve/server/app/annotations/AppHAPolicy.html) annotation on the microservice's main class.

The following illustrates how to set a microservice's HA policy

```java
import com.neeve.server.app.annotations.*;
 
@AppHaPolicy(StateReplication)
public class MyApp {
     ...
}
```

The [AppHAPolicy](https://build.neeveresearch.com/core/javadoc/LATEST/com/neeve/server/app/annotations/AppHAPolicy.html) supports the following values

* StateReplication
* EventSourcing

### Default HA Policy

A microservice that is not annotated with the [AppHAPolicy](https://build.neeveresearch.com/core/javadoc/LATEST/com/neeve/server/app/annotations/AppHAPolicy.html) defaults to StateReplication.
