Skip to content

Commit

Permalink
Updated readme and port #
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Hoffer committed Oct 31, 2019
1 parent 8125ec1 commit 7b51b45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
## Simulated Job Status Endpoint
A endpoint for testing polling

Instructions
1. Start the Spring Application
2. In a browser, go to `http://localhost:8080/job/1`
###Instructions
1. Start the Spring application
2. In a browser, go to `http://localhost:9000/job/1`
3. The current status of job #1 is dipslayed in the browser, e.g. **INPROGRESS**
4. Refresh the browser several times until the status changes. Some jobs are stuck in the INPROGRESS and never complete. This is part of the simulation.

* The endpoint's path is `/job/{id}`, where `id` can be any string. If the string is unrecognized, a new job is created. If `id` is recognized, its current status is returned.
### How it works
The endpoint's path is `/job/{id}`, where `id` can be any string. If the string is unrecognized, a new job is created. If `id` is recognized, its current status is returned.

The lifecycle of a job is:
```
Expand All @@ -16,4 +17,5 @@ The lifecycle of a job is:
+----> FAILED
```

The lifecycle of a `Job` is determined randomly by the `JobFactory` when the `Job` is created.
* The lifecycle of a `Job` is determined randomly by the `JobFactory` when the `Job` is created.
* The probability of moving from one state to the next is hardcoded in the `JoStateMachine` class.
2 changes: 0 additions & 2 deletions src/main/java/status/StatusEndpointApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
@SpringBootApplication
public class StatusEndpointApplication {


public static void main(String[] args) {
SpringApplication.run(StatusEndpointApplication.class, args);
}

}
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#logging.level.web=DEBUG
server.port=9000

0 comments on commit 7b51b45

Please # to comment.