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.
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.
Download the Application
Execute the following to download the repository:
This will download the samples repository to a folder named nvx-samples
relative to the directory from where the above command was executed.
Don't have Git on your local machine?
If you do not have git installed on your local machine, go the samples repository, click on the "Clone or Download" button and follow instructions to download the application to your machine.
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
The above will build the application and install it to your local maven repository.
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 section
The Starter Application
The starter application is comprised of three microservices
- Processor
- Receiver
- Sender
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 is has received from the sender. Upon receipt of a message, the Processr increments its messages count in irs 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 between the application's microservices. We use the ActiveMQ messaging bus with the starter application to sanity test your environment.
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.
Install and Run ActiveMQ
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
The ActiveMQ broker should launch and be ready ready for messaging.
Launch the Starter Microservices
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 for instructions on Java modules to enable.
Start the Receiver
Execute the following from a new command shell
You should see the trace similar to the following. This indicates that the receiver has successfully started.
Start the Processor Cluster
Execute the following from a new command shell
You should see the trace similar to the following. This indicates that the processor has successfully started.
The processor is a clustered service. Execute the following from a new command shell to start the second instance in the Processor cluster
You should see trace similar to the following on the newly launched cluster instance:
and the trace similar to the following on the first instance
Start the Sender
Execute the following from a new command shell
You should see the trace similar to the following. This indicates that the sender has successfully started.
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.