Fork me on GitHub

Examples - Administration Console

Running the example

The example consists of 5 separate applications:

  • mock-database
  • mock-zookeeper
  • goodbye
  • hello
  • admin

You will run 1 instance of mock-database and mock-zookeeper. Run one or more versions of goodbye and hello. Lastly, run one instance of admin.

From the soabase directory (assuming a *nix system):

# Run the mock database in the background
java -jar ./target/mock-database.jar &

# Run the mock zookeeper in the background
java -jar ./target/mock-zookeeper.jar &

# Run any number instances of the goodbye app in the background
java -jar ./target/goodbye.jar &
java -jar ./target/goodbye.jar &

# Run any number instances hello app in the background
java -jar ./target/hello.jar &
java -jar ./target/hello.jar &

# Run the admin app in the background
java -jar ./target/admin.jar &

When the goodbye and hello apps start, they will write their ports to the console. Write down the admin ports as they are needed in the examples below.

Performing the example tasks

Services Screen

Open the main page in a browser: http://localhost:8080. You will see the main admin console page:

From this screen you will see all services. Clicking on a service will advance to a list of all instances for the service grouped by deployment group. For each instance:

  • There is a green or red light. Green means the instance will be returned as available in Discovery. Red means it will not be returned.
  • Healthy/unhealthy and forced state. Shows whether the instance is healthy, unhealthy or forced.
  • Deployment Group activation button.
  • Action buttons:
    • Logs - displays the log files for the instance
    • Stack Trace - displays a full stack trace for the instance
    • Force - allows forcing the registration state of the instance in Discovery
    • Details - displays the real time system monitoring screen


Attributes Screen

Click on "Attributes" to see the attributes screen. This screen shows the Soabase global dynamic attributes. In this example, the attributes are stored in an in-memory database. In a production environment, you'd store them in a Mysql database, AWS storage, etc.

You should see three attributes. The example hard codes these values when the mock-database starts. Notice that the attribute "test" has no scope. This means that all instances will see the same value. Notice that the attribute "test2" is different for scopes "goodbye" and "hello". This means that the hello and goodbye apps will see different values. You can see this by using curl:

curl http://localhost:HelloAdminPort/api/soa/attributes/test
curl http://localhost:GoodbyeAdminPort/api/soa/attributes/test
curl http://localhost:HelloAdminPort/api/soa/attributes/test2
curl http://localhost:GoodbyeAdminPort/api/soa/attributes/test2

You'll see that the result for "test" is the same for hello and goodbye, but "test2" is different.

From the attributes screen, you can create, update and delete attributes and scopes. Try various changes and curl to see the affect on the example applications.


Custom Screen

The administration console supports custom tabs with any content you like. Click on "Custom Tab" to see an example.


Details Screen

Clicking the "Details" button for an instance shows real time monitoring of various metrics for the instance. You can also define your own metrics. Note the "Custom" metric displayed on this screen (only for the Goodbye service).


Logs Screen

Clicking the "Logs" button for an instance shows the list of all log files for the instance. Clicking any of the log file names will display the contents of the file.