Skip to content

Commit fea6ad8

Browse files
authored
CB fixes (#832)
* CB fixes * remove customer32 from CB (LL) * README update
1 parent f6195d9 commit fea6ad8

File tree

11 files changed

+20
-61
lines changed

11 files changed

+20
-61
lines changed

cloudbank-v32/README.md

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Version 3.2 of CloudBank is under development. This document and application is
3232
[INFO] account ............................................ SUCCESS [ 2.904 s]
3333
[INFO] checks ............................................. SUCCESS [ 1.168 s]
3434
[INFO] customer ........................................... SUCCESS [ 1.198 s]
35-
[INFO] customer32 ......................................... SUCCESS [ 1.133 s]
3635
[INFO] creditscore ........................................ SUCCESS [ 0.956 s]
3736
[INFO] transfer ........................................... SUCCESS [ 0.463 s]
3837
[INFO] testrunner ......................................... SUCCESS [ 1.009 s]
@@ -98,8 +97,6 @@ Schema {account} was successfully Not_Modified and Kubernetes Secret {applicatio
9897
Database/Service Password: *************
9998
Schema {customer} was successfully Created and Kubernetes Secret {application/customer} was successfully Created.
10099
Database/Service Password: *************
101-
Schema {customer} was successfully Not_Modified and Kubernetes Secret {application/customer32} was successfully Created.
102-
Database/Service Password: *************
103100
Schema {account} was successfully Not_Modified and Kubernetes Secret {application/testrunner} was successfully Created.
104101
uploading: account/target/account-0.0.1-SNAPSHOT.jar
105102
building and pushing image...
@@ -116,12 +113,6 @@ NOTICE: service not accessible outside K8S
116113
uploading: customer/target/customer-0.0.1-SNAPSHOT.jar
117114
building and pushing image...
118115
119-
creating deployment and service...
120-
obaas-cli [deploy]: Application was successfully deployed.
121-
NOTICE: service not accessible outside K8S
122-
uploading: customer32/target/customer32-0.0.1-SNAPSHOT.jar
123-
building and pushing image...
124-
125116
creating deployment and service...
126117
obaas-cli [deploy]: Application was successfully deployed.
127118
NOTICE: service not accessible outside K8S
@@ -151,12 +142,10 @@ The following commands are executed:
151142
bind --service-name account
152143
bind --service-name checks --username account
153144
bind --service-name customer
154-
bind --service-name customer32 --username customer
155145
bind --service-name testrunner --username account
156146
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
157147
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
158148
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
159-
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
160149
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
161150
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
162151
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
@@ -198,7 +187,6 @@ The following commands are executed:
198187
create-autoscaler --service-name account --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
199188
create-autoscaler --service-name checks --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
200189
create-autoscaler --service-name customer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
201-
create-autoscaler --service-name customer32 --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
202190
create-autoscaler --service-name creditscore --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
203191
create-autoscaler --service-name testrunner --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
204192
create-autoscaler --service-name transfer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
@@ -276,27 +264,6 @@ This is an example of the `customer32` application:
276264
]
277265
```
278266
279-
1. Test `customer32` service
280-
281-
1. REST endpoint
282-
283-
```shell
284-
curl -s http://<EXTERNAL-IP>/api/v2/customer | jq
285-
```
286-
287-
Should return:
288-
289-
```json
290-
[
291-
{
292-
"email": "andy@andy.com",
293-
"id": "qwertysdwr",
294-
"name": "Andy"
295-
},
296-
{...}
297-
]
298-
```
299-
300267
1. Test `creditscore` service
301268
302269
1. REST endpoint
@@ -529,9 +496,9 @@ This is an example of the `customer32` application:
529496
530497
![Jaeger Dashboard Login](images/jaeger.png " ")
531498
532-
1. Choose `customer32` Service and click *Find Traces*
499+
1. Choose `customer` Service and click *Find Traces*
533500
534-
![Customer32](images/j-traces.png " ")
501+
![Customer](images/j-traces.png " ")
535502
536503
1. Check the Grafana Dashboard
537504

cloudbank-v32/apisix-routes/create-all-routes.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ fi
1010
source ./create-accounts-route.sh $1
1111
source ./create-creditscore-route.sh $1
1212
source ./create-customer-route.sh $1
13-
source ./create-customer32-route.sh $1
1413
source ./create-testrunner-route.sh $1
1514
source ./create-transfer-route.sh $1

cloudbank-v32/customer32-mongo/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Example of "customer32" reimplemented to use the Oracle Database API for MongoDB
1+
# Example of "customer32" reimplemented to use the Oracle Database API for MongoDB
22

33
This directory provides an example of the [customer32](../customer32/) service reimplmented using [Oracle Database API for MongoDB](https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/mongo-using-oracle-database-api-mongodb.html) and [Spring Data MongoDB](https://docs.spring.io/spring-data/mongodb/reference/index.html).
44

@@ -20,33 +20,33 @@ Once that configuration is done, you can run the application using `mvn spring-b
2020

2121
- Create a customer
2222

23-
```
23+
```shell
2424
curl -i -X POST -H 'Content-Type: application/json' \
2525
-d '{"name":"Bob Jones","email":"bob@job.com"}' \
2626
http://localhost:8080/api/v1mongo/customer
2727
```
2828

2929
- List customers
30-
31-
```
32-
curl http://localhost:8080/api/v1mongo/customer|jq .
30+
31+
```shell
32+
curl -s http://localhost:8080/api/v1mongo/customer | jq .
3333
```
3434

3535
- Update a customer - make sure you use the correct ID from the output of the previous example
3636

37-
```
37+
```shell
3838
curl -i -X PUT -H 'Content-Type: application/json' \
3939
-d '{"name":"Bob Jackson","email":"bob@jackson.com"}' \
4040
http://localhost:8080/api/v1mongo/customer/65cb9ad3d0538471e9fb5f27
4141
```
4242

4343
- Find a customer by email
4444

45-
```
45+
```shell
4646
curl -i http://localhost:8080/api/v1mongo/customer/email/bob@jackson.com
4747
```
4848

49-
### Notes on the MongoDB connection
49+
## Notes on the MongoDB connection
5050

5151
Please refer to the [Spring Data MongoDB documentation](https://docs.spring.io/spring-data/mongodb/reference/mongodb/configuration.html) for details of how to configure the connection and database.
5252

cloudbank-v32/customer32-mongo/pom.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Copyright (c) 2023, Oracle and/or its affiliates. -->
3+
<!-- Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -->
24
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
35
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
46
<modelVersion>4.0.0</modelVersion>
@@ -8,25 +10,16 @@
810
<version>0.0.1-SNAPSHOT</version>
911
</parent>
1012

11-
<groupId>com.example</groupId>
1213
<artifactId>customer32-mongo</artifactId>
1314
<version>0.0.1-SNAPSHOT</version>
1415
<name>customer32-mongo</name>
1516
<description>Customer32 service implemented with Oracle Database MongoDB API</description>
1617

17-
<properties>
18-
<java.version>17</java.version>
19-
</properties>
20-
2118
<dependencies>
2219
<dependency>
2320
<groupId>org.springframework.boot</groupId>
2421
<artifactId>spring-boot-starter-data-mongodb</artifactId>
2522
</dependency>
26-
<dependency>
27-
<groupId>org.springframework.boot</groupId>
28-
<artifactId>spring-boot-starter-web</artifactId>
29-
</dependency>
3023
</dependencies>
3124

3225
<build>

cloudbank-v32/customer32-mongo/src/main/java/com/example/customer32mongo/model/Customer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
package com.example.customer32mongo.model;
55

66
import org.springframework.data.annotation.Id;
7+
import org.springframework.data.mongodb.core.mapping.Document;
78

9+
@Document("customers")
810
public class Customer {
911

1012
@Id

cloudbank-v32/customer32-mongo/src/main/resources/application.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
1+
# Copyright (c) 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
23
#
3-
# You must update the URI to match your Oracle Database instance - the USER, PASSWORD, HOSTNAME, and region need to be udpated.
4+
# NOTE:
5+
# You must update the URI to match your Oracle Database instance - the USER, PASSWORD, HOSTNAME, and region need to be udpated.
46
#
57

68
spring:
9+
application:
10+
name: customer32-mongodb
711
data:
812
mongodb:
913
uri: 'mongodb://USER:PASSWORD@HOSTNAME-MONGO1.adb.us-phoenix-1.oraclecloudapps.com:27017/USER?authMechanism=PLAIN&authSource=$external&ssl=true&retryWrites=false&loadBalanced=true'
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
create-autoscaler --service-name account --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
22
create-autoscaler --service-name checks --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
33
create-autoscaler --service-name customer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
4-
create-autoscaler --service-name customer32 --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
54
create-autoscaler --service-name creditscore --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
65
create-autoscaler --service-name testrunner --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
76
create-autoscaler --service-name transfer --min-replicas 1 --max-replicas 4 --cpu-request 100m --cpu-percent 80
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
delete-autoscaler --service-name account
22
delete-autoscaler --service-name checks
33
delete-autoscaler --service-name customer
4-
delete-autoscaler --service-name customer32
54
delete-autoscaler --service-name creditscore
65
delete-autoscaler --service-name testrunner
76
delete-autoscaler --service-name transfer
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
22
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
33
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
4-
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
54
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
65
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
76
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
bind --service-name account
22
bind --service-name checks --username account
33
bind --service-name customer
4-
bind --service-name customer32 --username customer
54
bind --service-name testrunner --username account
65
deploy --service-name account --artifact-path account/target/account-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
76
deploy --service-name checks --artifact-path checks/target/checks-0.0.1-SNAPSHOT.jar --image-version 0.0.1
87
deploy --service-name customer --artifact-path customer/target/customer-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
9-
deploy --service-name customer32 --artifact-path customer32/target/customer32-0.0.1-SNAPSHOT.jar --image-version 0.0.1 --liquibase-db admin
108
deploy --service-name creditscore --artifact-path creditscore/target/creditscore-0.0.1-SNAPSHOT.jar --image-version 0.0.1
119
deploy --service-name testrunner --artifact-path testrunner/target/testrunner-0.0.1-SNAPSHOT.jar --image-version 0.0.1
1210
deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SNAPSHOT.jar --image-version 0.0.1

0 commit comments

Comments
 (0)