Skip to content
regunathb edited this page Nov 2, 2012 · 4 revisions

This page is a quick introduction to get you started writing your application on Trooper.

A quick read of the Trooper Design approach is recommended in order to understand the notion of a Runtime Profile.

Choose a Trooper Runtime Profile for your app

The Runtime Profile is simply a container for developing, testing and running application components that may be stereotyped by the workload it handles - for e.g. Batch jobs, user interactions implemented as Services or Workflow comprising a number of stages. An application may comprise one or more Trooper runtime instances (independent JVMs) as described in the example below:

Example: Trooper runtime profiles for an eCommerce web-site

Consider an e-Commerce web-site that broadly has the following types of work-loads:

  1. Scan newly added digital contents for products
  2. Index the digital content to create a Catalog of products, items
  3. API/Service for updating/retrieving items to/from the Catalog

Each of the above have distinctly different computational needs abstracted as follows:

  1. Scan - periodic and trigger based (cron say), asynchronous batch based work load
  2. Index - parse individual content and store it. May be executed asynchronously and in parallel, distributed for scaling
  3. API/Service - Synchronous request-response API that may be invoked natively or using a generic transport (XML or JSON over Http)

Additionally, each of these runtimes may be further characterized by needs of High Availability, Throughput and Low Latency respectively.

The eCommerce application's workloads may be mapped to the following Trooper runtime profiles:

  1. Scan - Batch profile with HA if required (see batch examples below)
  2. Index - Orchestration Profile (see service orchestration examples below)
  3. API/Search - Service Profile (see Simple Service example below)

The application developer would therefore build 3 sub-systems, each on a distinct Trooper runtime profile.

Trooper Examples

The Trooper Examples is a good place to start using Trooper. Examples are regularly being added to this code base. The following examples are available currently:

Simple examples

  • Simple batch job (see /examples/example-batch/src/main/resources/external/shellTaskletsJob)
  • Simple Service (see /examples/example-services/src/main/resources/external)

More involved examples

  • Multi-threaded batch jobs (see /examples/example-batch/src/main/resources/external/greetingWorkSchedulerJob)
  • High availability in batch jobs (see /examples/example-batch-HA/src/main/resources/external/shellTaskletsJobHA)
  • High throughput service orchestration (see /examples/example-seda/src/main/resources/external)
  • Complex Event processing integrated with high throughput service orchestration (see /examples/example-seda-cep/src/main/resources/external)

See Building and running Trooper examples for instructions to build and run examples on a runtime profile that best suits your application needs. The easiest way to experiment is to modify existing Trooper example projects to include your application specific implementations.