Application Layer
GremlinService
ALFI is currently in an open beta.
To create a com.gremlin.GremlinService
, you need a com.gremlin.GremlinCoordinatesProvider
, which needs a com.gremlin.ApplicationCoordinates.
To construct a GremlinService using the alfi-aws library:
java
1final GremlinServiceFactory factory = new GremlinServiceFactory(new GremlinCoordinatesProvider() {2 @Override3 public ApplicationCoordinates initializeApplicationCoordinates() {4 ApplicationCoordinates coords = AwsApplicationCoordinatesResolver.inferFromEnvironment()5 .orElseThrow(IllegalStateException::new);6 return coords;7 }8 });9final GremlinService gremlinService = factory.getGremlinService();
Design
com.gremlin.GremlinService
should be a singleton.
Injecting Fault
Once you have a reference to the com.gremlin.GremlinService
singleton and have defined your Custom com.gremlin.TrafficCoordinates, you can inject fault like this:
java
1gremlinService.applyImpact(trafficCoordinates);