Apache Cassandra For Persistency Layer
The generation of the executable jar file can be performed by issuing the following command
mvn clean package
This will create an executable jar file wlsmon.jar within the target maven folder. This can be started by executing the following command
java -jar target/demo-mp.jar
During development, you can use Liberty's development mode (dev mode) to code while observing and testing your changes on the fly. With the dev mode, you can code along and watch the change reflected in the running server right away; unit and integration tests are run on pressing Enter in the command terminal; you can attach a debugger to the running server at any time to step through your code.
mvn liberty:dev
To launch the test page, open your browser at the following URL, please change server.xml file accordingly for different customer env.
http://localhost:9080/index.html
Leave the wlsmon server running and proceed with the instructions contained in readme.md.
By default, there is always the creation of a JAX-RS application class to define the path on which the JAX-RS endpoints are available.
Also, a simple Hello world endpoint is created, have a look at the class HelloController.
More information on MicroProfile can be found here
Configuration of your application parameters. Specification here
The example class ConfigTestController shows you how to inject a configuration parameter and how you can retrieve it programmatically.
Add resilient features to your applications like TimeOut, RetryPolicy, Fallback, bulkhead and circuit breaker. Specification here
The example class ResilienceController has an example of a FallBack mechanism where an fallback result is returned when the execution takes too long.
The Metrics exports Telemetric data in a uniform way of system and custom resources. Specification here
The example class MetricController contains an example how you can measure the execution time of a request. The index page also contains a link to the metric page (with all metric info)
Using the OpenId Connect JWT token to pass authentication and authorization information to the JAX-RS endpoint. Specification here
Have a look at the TestSecureController class which calls the protected endpoint on the secondary application. The ProtectedController (secondary application) contains the protected endpoint since it contains the @RolesAllowed annotation on the JAX-RS endpoint method.
The TestSecureController code creates a JWT based on the private key found within the resource directory. However, any method to send a REST request with an appropriate header will work of course. Please feel free to change this code to your needs.
Allow the participation in distributed tracing of your requests through various micro services. Specification here
To show this capability, you need to download Jaeger and run ./jaeger-all-in-one.
Alternatively, you can download the docker image of all-in-one using docker pull jaegertracing/all-in-one:${version},
followed by running the docker image. Refer to Jaeger doc for more info.
Open http://localhost:16686/ to see the traces. You have to invoke your demo app endpoint for any traces to show on Jaeger UI.
A type safe invocation of HTTP rest endpoints. Specification here
The example calls one endpoint from another JAX-RS resource where generated Rest Client is injected as CDI bean.