- NixMash Jangles - small backend for cloud configuration and shared components (GitHub)
- Bootique - a lightweight Java Framework http://bootique.io/
- Jetty - embedded web server
- Jersey - REST services for JAX-RS
- Jackson - JSON/POJO binding
- Apache Shiro - user authentication and authorization, including using a BearerAuthenticationToken in REST (v0.2.0)
- Google Guice - injection
- Mustache - the Spullara Java Mustache Implementation for "logic free" templating (GitHub)
- Bootstrap - responsive web theming
- Multiple Bootique Module Shaded Jars with Maven
- Testing MVC Controller Methods with REST Endpoints in JUnit
- Localized Resource Properties with Java Mustache
- Adding Static Paths in Bootique
- Roll Your Own Mustache Template Resolver in Bootique MVC
- Configuring Jersey Declarative Linking in Bootique
- Custom REST Links with Jersey Conditional Link Injection
- Retrieving REST Data Object Lists with Jersey and Jackson
- Microservice Applications with Bootique
- REST Notes: JAX-RS, Jersey and Jackson
The Jangles Module sets the application configuration in External Property and Config files.
- Create a MySQL database.
- MySQL Setup scripts are located in jangles:/install/sql. Run schema.sql and data.sql.
- Copy external files in /install/external to a subdirectory of your /home/user directory. Enter the path to those files in jangles:/resources/jangles.properties and update the MySQL Connection settings in connections.xml.
NixMash Microservices currently consists of a User Microservice and a Web Client. Use Maven or your IDE to run the Userservice
module followed by theWeb
REST Client.
If running the application with Maven, the following will produce JARs for userservice
and webclient
{PROJECT_ROOT}/$ mvn clean install
Then run the resulting JARs in two terminal windows.
{PROJECT_ROOT}/$ java -jar userservice/target/userservice.jar
{PROJECT_ROOT}/$ java -jar web/target/webclient.jar
Userservice
displays a list of users from the MySQL database in JSON. The URL for the User Service is http://localhost:8000.
The initial JSON output from the REST User Service looks like this.
{
"applicationId": "userservice",
"serviceName": "User Microservice",
"users": {
"params": {
"rel": "users"
},
"href": "http://localhost:8000/users"
}
}
The JSON output at http://localhost:8000/users
would look like this.
[
{
"userId": 1,
"applicationId": "Jim",
"serviceName": "Jim Johnson",
"lastUpdated": "06-12-2017 09:00:21",
"isActive": true,
"link": "http://localhost:8000/users/1"
},
{
"userId": 2,
"applicationId": "Bill",
"serviceName": "Bill Blaster",
"lastUpdated": "06-12-2017 09:00:21",
"isActive": true,
"link": "http://localhost:8000/users/2"
}
]
The Web
client module URL is http://localhost:9001.
This is the page with url http://localhost:9001/users
displaying users from Users Service
.
Last Updated: 4/23/18