-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README, enable Spring Boot auto-reload and change APIs URL
- Loading branch information
Showing
11 changed files
with
124 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,58 @@ | ||
# Spring Boot Samples | ||
|
||
<!-- TOC --> | ||
* [Spring Boot Samples](#spring-boot-samples) | ||
* [Run Locally](#run-locally) | ||
* [Run Camunda locally](#run-camunda-locally) | ||
* [Add permissions to the `zeebe` application](#add-permissions-to-the-zeebe-application) | ||
* [Run a mock API server](#run-a-mock-api-server) | ||
* [Run the application](#run-the-application) | ||
<!-- TOC --> | ||
|
||
## Run Locally | ||
|
||
### Run Camunda locally | ||
|
||
Run Camunda locally as explained [here](../docker/README.md). | ||
|
||
#### Add permissions to the `zeebe` application | ||
|
||
The `zeebe` client is configured in `application-local.yaml` and used to access the Tasklist. | ||
|
||
```yaml | ||
zeebe: | ||
client: | ||
cloud: | ||
client-id: zeebe | ||
|
||
tasklist: | ||
client-id: ${zeebe.client.cloud.client-id} | ||
``` | ||
We therefore need to: | ||
* log in to [Identity](http://localhost:8084), | ||
* edit the `zeebe` application, | ||
* and add Tasklist read/write permissions. | ||
|
||
![](./docs/res/Tasklist-Permission.png) | ||
|
||
### Run a mock API server | ||
|
||
If the sample calls any external APIs, run [a mock API server](./mock-api/README.md) locally. | ||
|
||
### Run the application | ||
|
||
The [Spring Boot Maven Plugin](https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/) is configured in this [`pom.xml`](./pom.xml) to use the `local` profile by default. | ||
|
||
In each module, the `application-local.yaml` file is configured to run against a local deployment of Camunda. | ||
The [`Camunda Platform 8` repository](https://github.com/camunda/camunda-platform) documents how to run a complete Camunda Platform 8 Self-Managed environment locally. | ||
In each module, the `application-local.yaml` file is configured to run against a [local deployment of Camunda](#run-camunda-locally). | ||
|
||
The following command will therefore run using that profile. | ||
|
||
> `mvn spring-boot:run` | ||
|
||
It is possible to run using another profile by setting the `spring-boot.run.profiles` property, e.g. `-Dspring-boot.run.profiles=dev`. | ||
It is possible to run using another profile by setting the `spring-boot.run.profiles` property, e.g. `-Dspring-boot.run.profiles=dev`, as documented [here](https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#using.overriding-command-line). | ||
|
||
The `APIS_HOST` environment variable contains the external APIs' host. | ||
It is set to `localhost` by default to point to [the local mock API server](#run-a-mock-api-server). | ||
The mock API server is assumed to run on port `9999`. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Mock API Server | ||
|
||
This is used to mock external APIs that might be used in the samples. | ||
|
||
We use the [Wiremock Docker image](https://wiremock.org/docs/standalone/docker/). | ||
|
||
As mentioned in the documentation, the server can be started as follows: | ||
|
||
> `docker run -it --rm -p 9999:8080 -v $PWD:/home/wiremock --name mock-api-server wiremock/wiremock` | ||
The mock server is configured to respond without error to the external API calls. | ||
|
||
You can customize the responses by editing the files located in the [`__files`](./__files) and [`mappings`](./mappings) folders. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"orderId": "O-1234" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"orderId": "O-1234" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"orderId": "O-1234" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"orderId": "O-1234" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"mappings": [ | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"urlPath": "/order" | ||
}, | ||
"response": { | ||
"status": 201, | ||
"bodyFileName": "order.json" | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"urlPath": "/invoice" | ||
}, | ||
"response": { | ||
"status": 201, | ||
"bodyFileName": "invoice.json" | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"urlPath": "/notification" | ||
}, | ||
"response": { | ||
"status": 201, | ||
"bodyFileName": "notification.json" | ||
} | ||
}, | ||
{ | ||
"request": { | ||
"method": "POST", | ||
"urlPath": "/dispatch" | ||
}, | ||
"response": { | ||
"status": 201, | ||
"bodyFileName": "dispatch.json" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters