audit-server is a spring-boot REST API which accepts user events as JSON objects and delegates them to a remote server to handle it appropriately.
Sample JSON payload (endpoint: /api/user/event
, Method: POST
) :
{
"timestamp": 15623276532,
"userId": 1029,
"event": "something happened. Please log this in a file"
}
- Eureka server endpoint in
application.properties
(Defaulthttp://localhost:8761/eureka
)
Ensure logger-eureka-server instance is up and running on your local machine. Then,
- clone the repository to your machine [
git clone https://github.com/JudeNiroshan/audit-server.git
] - move to
audit-server
[cd audit-server
] - execute
./mvnw install
- execute
./mvnw spring-boot:run
(submit POST request tohttp://localhost:8080/api/user/event
)
- Application is using google protocol buffers as protocol for calling remote servers.
There are several frameworks available which uses
.protoc
as protocol. By default audit-server is using gRPC. It is possible to change it by implementingMeditator
interface and configuring relevant type inapplication.properties
file. (Defaultgpb.type=grpc
) - audit-server is performing application load-balancing by using client service discovery through an Eureka server.