> 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/get-started/sanity-test-your-environment.md).

# Sanity Test your Environment

This section describes how to sanity test that your environment has been setup correctly to build and run X applications. We will do this using the Talon Starter Application which is included as one of the applications in the [samples repository](https://github.com/neeveresearch/nvx-samples).

{% hint style="info" %}
**Other Uses of the The Starter Application:** It is a good idea to download and run the starter application not only from the point of view of sanity testing your environment but also because we use this application to demonstrate how to use various features of an X application as well as to illustrate how non-functional aspects of the platform, such as configuration, horizontal scaling, message passing and high availability work in the platform.
{% endhint %}

## Download the Application

Execute the following to download the repository

```
git clone https://github.com/neeveresearch/nvx-samples
```

This will download the [samples repository](https://github.com/neeveresearch/nvx-samples) to a folder named `nvx-samples` relative to the directory from where the above command was executed.

{% hint style="info" %}
**Don't have Git on your local machine?:** If you do not have git installed on your local machine, go the [samples repository](https://github.com/neeveresearch/nvx-samples), click on the "Clone or Download" button and follow instructions to download the application to your machine.
{% endhint %}

The talon starter application is in the subdirectory `nvx-app-talon-starter`

## Build the Application

Execute the following to build all the sample applications including the starter application

```
cd nvx-samples
mvn -DskipTests clean install
```

The above will build the application and install it to your local maven repository.

{% hint style="info" %}
**Building with Java 11 or Beyond?** The sample application is implemented such that it can be built as is using Java 8. If you are building using Java 11 or beyond, you will need to add the extra dependencies specified in the [Building Using Java 11 and Beyond](/get-started/set-up-your-dev-environment.md#building-using-java11-and-beyond) section.
{% endhint %}

## The Starter Application

The starter aplication is comprised of three microservices

* Processor
* Receiver
* Sender

![19628218](/files/6IBzhqcFt8fRT02HLz8C)

The Processor is a clustered, stateful, highly available and fault tolerant service. *Stateful* means it stores data that is durably persisted over time. *Fault tolerant* means that it will continue to operate without data or message loss in the event a resource failure. *Highly available* means that the MTTR to recovery on failure is minimal and *clustered* means that it implements high availability by means of hot standby clustering.

In the starter application, the Sender service sends messages which are received by the Processor. The Processor stores a count of messages it has received from the sender. Upon receipt of a message, the Processor increments its messages count in its store and sends another message. This message is received by the downstream Receiver microservice.

## Run the Application

This section describes how to run the starter application. A successful launch and run of the application effectively means that your environment is set up correctly to build and run X applications.

### Download and Install the Messaging Bus

X applications need a messaging bus for message passing betweeen the application's microservices. We use the ActiveMQ messaging bus with the starter application to sanity test your environment.

{% hint style="info" %}
**Support for Other Messaging Providers:** Out of the box, the X Platform supports several messaging bus providers such as Solace, JMS, ActiveMQ and Kafka. There is also a high performance messaging system being developed natively in the X Platform.
{% endhint %}

#### Install and Run ActiveMQ

[Download](https://activemq.apache.org/components/classic/download/) a binary distribution of ActiveMQ and unpack it into some directory. Then, type the following commands from the directory in which you have just unpacked the ActiveMQ distribution

```
cd bin
activemq
```

The ActiveMQ broker should launch and be ready ready for messaging..

### Launch the Starter Microservices

{% hint style="info" %}
**Running with Java 11 or Beyond?:** If you are using Java 11 or beyond to run the application, then please refer to the [Supported OS and Runtimes](/get-started/supported-os-and-runtimes.md) for instructions on Java modules to enable.
{% endhint %}

#### Start the Receiver

Execute the following from a *new* command shell

{% tabs %}
{% tab title="Linux/OSX" %}

```
$JAVA_HOME/java -Djava.net.preferIPv4Stack=true -cp "target/*:target/dependency/*" com.neeve.server.Main -n receiver 
-p desktop,activemq
```

{% endtab %}

{% tab title="Windows" %}

```
 %JAVA_HOME\java -Djava.net.preferIPv4Stack=true -cp "target\*;target\dependency\*" com.neeve.server.Main -n receiver 
-p desktop,activemq 
```

{% endtab %}
{% endtabs %}

You should see the trace similar to the following. This indicates that the receiver has successfully started.

```
...
<1,9705,My-MacBook-Pro.local> 20161101-07:34:25:476 (inf)...[AepEngine<receiver>] Engine started [Standalone, Non-Persistent, ICR Off].
<1,9705,My-MacBook-Pro.local> 20161101-07:34:25:476 (inf)...Server (NAME=receiver) startup complete.
.
.
.
<31,9705,My-MacBook-Pro.local> 20161101-07:34:25:500 (inf)...[AepEngine<receiver>] Messaging started. 
```

#### Start the Processor Cluster

Execute the following from a *new* command shell

{% tabs %}
{% tab title="Linux/OSX" %}

```
$JAVA_HOME/java -Djava.net.preferIPv4Stack=true -cp "target/*:target/dependency/*" com.neeve.server.Main -n processor-1 
-p desktop,activemq 
```

{% endtab %}

{% tab title="Windows" %}

```
%JAVA_HOME\java -Djava.net.preferIPv4Stack=true -cp "target\*;target\dependency\*" com.neeve.server.Main -n processor-1 
-p desktop,activemq 
```

{% endtab %}
{% endtabs %}

You should see the trace similar to the following. This indicates that the processor has successfully started.

```
<32,8456,My-MacBook-Pro.local> 20161030-16:22:59:083 (inf)...[RogLog->'processor'] Live transaction log file is 'processor.log'...
<32,8456,My-MacBook-Pro.local> 20161030-16:22:59:397 (inf)...Log preallocation (length=1073741824, mode=setLength) took 309 milliseconds.
<32,8456,My-MacBook-Pro.local> 20161030-16:22:59:405 (inf)...[RogLog->'processor'] Scavenging old log files....
<32,8456,My-MacBook-Pro.local> 20161030-16:22:59:405 (inf)...[RogLog->'processor'] ....scavenged 0 files (0 failed).
<1,8456,My-MacBook-Pro.local> 20161030-16:22:59:408 (inf)...[RogLog->'processor'] Materialized 0 entries (0 transactions) from the transaction log (in < 1 second).
<1,8456,My-MacBook-Pro.local> 20161030-16:22:59:409 (inf)...Initialization complete. Synchronized to transaction id #0 in the store.
<31,8456,My-MacBook-Pro.local> 20161030-16:22:59:710 (inf)...[AepEngine<processor>] Retransmitted 0 messages.
<1,8456,My-MacBook-Pro.local> 20161030-16:22:59:710 (inf)...[AepEngine<processor>] Engine started [Clustered, Primary, Persistent, ICR Off].
.
.
.
<31,8456,My-MacBook-Pro.local> 20161030-16:22:59:712 (inf)...[AepEngine<processor>] Messaging started.
```

The processor is a clustered service. Execute the following from a *new* command shell to start the second instance in the Processor cluster

{% tabs %}
{% tab title="Start the Cluster Backup (Linux/OSX)" %}

```
$JAVA_HOME/java -Djava.net.preferIPv4Stack=true -cp "target/*:target/dependency/*" com.neeve.server.Main -n processor-2 
-p desktop,activemq 
```

{% endtab %}

{% tab title="Start the Cluster Backup (Windows)" %}

```
%JAVA_HOME\java -Djava.net.preferIPv4Stack=true -cp "target\*;target\dependency\*" com.neeve.server.Main -n processor-2 
-p desktop,activemq 
```

{% endtab %}
{% endtabs %}

You should see trace similar to the following on the newly launched cluster instance:

```
<1,12030,My-MacBook-Pro.local> 20161102-23:59:46:258 (inf)...[AepEngine<processor>] Engine started [Clustered, Backup, Persistent, ICR Off].
```

and the trace similar to the following on the first instance

```
<31,11825,My-MacBook-Pro.local> 20161102-23:58:03:891 (inf)...[B->processor-11cdf912-f6a6-46c3-b74f-7578cf453652] Initializing member '4a2fd486-68da-47d5-95e6-b70ffab08086'...
<31,11825,My-MacBook-Pro.local> 20161102-23:59:46:231 (inf)...[B->processor-11cdf912-f6a6-46c3-b74f-7578cf453652] Member '4a2fd486-68da-47d5-95e6-b70ffab08086' initialization complete (transaction id=-1)...
<31,11825,My-MacBook-Pro.local> 20161102-23:59:46:231 (inf)...[RogLog->'processor'] Initialization complete. Synchronized to transaction id #20808 on the primary.
```

#### Start the Sender

Execute the following from a *new* command shell

{% tabs %}
{% tab title="Linux/OSX" %}

```
$JAVA_HOME/java -Djava.net.preferIPv4Stack=true -cp "target/*:target/dependency/*" com.neeve.server.Main -n sender -p 
desktop,activemq 
```

{% endtab %}

{% tab title="Windows" %}

```
%JAVA_HOME\java -Djava.net.preferIPv4Stack=true -cp "target\*;target\dependency\*" com.neeve.server.Main -n sender -p 
desktop,activemq 
```

{% endtab %}
{% endtabs %}

You should see the trace similar to the following. This indicates that the sender has successfully started.

```
<1,10110,My-MacBook-Pro.local> 20161101-09:30:18:827 (inf)...[AepEngine<sender>] Engine started [Standalone, Non-Persistent, ICR Off].
.
.
.
<31,10110,My-MacBook-Pro.local> 20161101-09:30:18:829 (inf)...[AepEngine<sender>] Messaging started.
Press Enter to send 10000 messages...
```

#### Run the Sender

The sender is programmed to wait for user input before sending any messages. Hit once you see the "Press Enter to send 10000 messages" message above. This will trigger the sending of 10k messages at 1k msgs/sec. You should see the following trace on the sender, processor, and receiver

{% tabs %}
{% tab title="Sender" %}

```
Press Enter to send 10000 messages...
Sent 1000 messages
Sent 2000 messages
.
.
.
Sent 10000 messages
Press Enter to send 10000 messages...
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Processor" %}

```
Processed 1000 messages
Processed 2000 messages
.
.
.
Processed 10000 messages
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Processor" %}

```
Received 1000 messages
Received 2000 messages
.
.
.
Received 10000 messages
```

{% endtab %}
{% endtabs %}

👏 Congratulations! You have just sanity tested your environment and succesfully built and run your first X application!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.xplatform.com/get-started/sanity-test-your-environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
