Commit 04fd262
authored
[Java] Add API for testing downstream error code (#436)
## Changes
Adding a new API `/status/{code}?ip=...` that calls the downstream
service similar to `/remote-service` and specifies the code it wants the
remote service to respond with. The remote service now accepted
`/status/{code}` and responds with status code `{code}`. The main
service will respond with OK and the trace ID in any case.
## Testing
Built and ran the applications locally, confirming functionality of the
new APIs.
## Risks
New API does not change any functionality of old ones. Could cause build
issues, but we use other imports from the same dependencies and the same
logic in `/remote-service` so there is little to no risk.
## Rollback procedure
Revert commit and rerun sample app deployment script.
#### By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.1 parent c7bbd26 commit 04fd262
File tree
2 files changed
+23
-0
lines changed- sample-apps/java
- springboot-main-service/src/main/java/com/amazon/sampleapp
- springboot-remote-service/src/main/java/com/amazon/sampleapp
2 files changed
+23
-0
lines changedLines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
167 | 183 | | |
168 | 184 | | |
169 | 185 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
0 commit comments