https://github.com/colinbut/exclusion-service
A microservice that manages a blacklist of excluded users - Java - JAX-RS - Jetty - Jedis
https://github.com/colinbut/exclusion-service
docker docker-compose java jax-rs jedis jersey jetty microservice redis
Last synced: 3 months ago
JSON representation
A microservice that manages a blacklist of excluded users - Java - JAX-RS - Jetty - Jedis
- Host: GitHub
- URL: https://github.com/colinbut/exclusion-service
- Owner: colinbut
- Created: 2018-02-14T10:12:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-03T22:48:12.000Z (over 7 years ago)
- Last Synced: 2025-02-01T14:46:15.864Z (4 months ago)
- Topics: docker, docker-compose, java, jax-rs, jedis, jersey, jetty, microservice, redis
- Language: Java
- Homepage:
- Size: 143 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Exclusion Service
[](https://travis-ci.org/colinbut/exclusion-service)
## Table of Contents
- [Summary](#summary)
- [Overview](#overview)
- [Usage](#usage)
- [Deployment](#deployment)
- [Local](#local)
- [Web Container - Explode War Deployment](#web-container-explode-war-deployment)
- [Maven Jetty Plugin - mvn jetty:run](#maven-jetty-plugin-run)
- [Maven Jetty Plugin - mvn jetty:run-forked](#maven-jetty-plugin-run-forked)
- [Containerization - Docker](#docker)
- [QA](#qa)
- [Staging](#staging)
- [Production](#production)### 1. Summary
A microservice that encapsulates a blacklist of excluded users.- Java 7
- JAXB
- JAX-RS (Jersey as the implementation)
- Jedis (a Redis client java library)
- Jetty (a lightweight web server/container)Maven build tool.
Application is packaged up in a war file which then gets run in Jetty by using the maven jetty plugin.
Built using vanilla Java with Java EE (J2EE)'s JAX-RS technology - using the reference implementation Jersey. It runs inside a Jetty server (a lightweight web container/server). Application connects to
Redis datastore (NoSQL)Below:

Hit the endpoint URL*:
```
http://localhost:8080/rest/exclusion/validate/1234566SSN/2018-01-01
```*_the URL will be slightly different depending on how the microservice is deployed._
You should get back a response like:
```xml
NOT BLACKLISTED
```
This section details the different ways to deploy this microservice for usage
There are numerous ways to bring up this microservice locally.
##### 4.1.1 Web Container - Explode War Deployment
After building the artifact with `mvn clean install` - copy the built exclusion-service.war file
to the deployment directory of the web container.for example, if using Jetty:
copy `exclusion-service.war` to `/var/lib/jetty/webapps`
or whereever the `webapps` folder is under the Jetty installation.
start Redis Server
note - using this method you would access the URL endpoint as:
```
http://localhost:8080/exclusion-service/rest/exclusion/validate/1234566SSN/2018-01-01
```##### 4.1.2 Maven Jetty Plugin - mvn jetty:run
to run:
start Redis Server. Then:
```bash
mvn -Djetty.http.port=[port number] jetty:run
```where port number is a port you specify (by default its on port 8080 if you don't specify)
note, using this method you will need to manually set the following environment variables as it uses these env variables to specifiy connection details to Redis.
- REDIS_HOST
- REDIS_PORT##### 4.1.3 Maven Jetty Plugin - mvn jetty:run-forked
start Redis Server. Then:
similar to above command but...
```bash
mvn -Djetty.http.port=[port number] jetty:run-forked
```with this method, the 2 environment variables are already configured in the `pom.xml`
##### 4.1.4 Containerization - Docker
Using both Docker and Docker Compose you can bring up this microservice easily.
This deployment method is the way used in QA/Staging. So therefore you can do this way as well
to mimic the deployment setup on your local Dev environment as if it was a (QA/Staging) Test Environment.```bash
chmod +x; ./install.sh
cd docker
docker-compose up
```[TBD]