Overview of Cloud Module - Skullabs/kikaha GitHub Wiki
Overview of Cloud Module
The Cloud Module contains a set of conventions and APIs that helps the developer to design an application well suited to cloud environments. Its core features is provided by kikaha-cloud
module and its main APIs are described on the following topics.
ApplicationData API
This API provides a simple way to gather the basic identification data regarding your application and its runtime environment. All cloud-related modules depends on this configuration in order to provide a better experience configuring your application on a cloud environment.
The bellow snippet code shows how one can have access to this API.
public class SampleService {
@Inject ApplicationData appData;
// print sibling nodes on your cluster application
public void printSiblingNodesLocalAddress(){
applicationData.getSiblingNodesOnTheCluster()
.forEach( n -> System.out.println( n.getLocalAddress() ) );
}
}
Only a few configuration parameters should be properly configured before start a kikaha application that uses the kikaha-cloud
module:
- Name (
server.smart-server.application.name
): It is highly recommended that you override this with an unique identifier of your application cluster on your Data Center. It helps the cloud module to distinguish your application on an environment that have more than one micro-service running on the same Data Center. - Version (
server.smart-server.application.name
): If you have more than one version of your application running at the same time on the same Data Center it is also highly recommended that you use override version attribute with its respective value for the same reason described above.
Here is how your application.yml
file should look like:
server:
smart-server:
application:
name: "capacitor"
version: "1.0.0"
ServiceRegistry API
Responsible for a manual cluster management of your application.
TODO
MachineIdentification API
Identify which node your application is actually running.
TODO
TraceID API
Identify if the current request was already started on other application or node.
TODO
Out-of-box Cloud-Related Modules
Kikaha is shipped with a few cloud-related modules which may be very handy while deploying a cloud application:
- DropWizard/Codahale's Metrics
- Consul.io
- Hazelcast
- AWS Integration Modules
DropWizard/Codahale's Metrics
Codahale's team did an impressive job designing a very good API to deal with application metrics. The kikaha-cloud-metrics
is a tiny layer for the following features:
- Metric API - Allows you to measure and aggregate data and report it to a Metric Store
- Health Check API - Create Health-Check points to verify if your application node still healthy
Consul.io
Consul.io is probably the most interesting Service Discovery application available at the market. The kikaha-cloud-consul
module provide tight integration with the following Consul.io features:
- Service Discovery
- Key-Value Configuration
Hazelcast
TODO
AWS Integration Modules
TODO