Skip to content

Commit 1600273

Browse files
authored
Cloudbank updates (#835)
1 parent 4af7a09 commit 1600273

File tree

9 files changed

+284
-40
lines changed

9 files changed

+284
-40
lines changed

cloudbank-v32/README.md

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# CloudBank Version 3.2
22

3-
Version 3.2 of CloudBank is under development. This document and application is WIP.
3+
**NOTE:** This document and application is WIP.
4+
5+
To run Cloud Bank you need OBaaS version 1.1.1 [Oracle Backend for Spring Boot and Microservices](https://cloudmarketplace.oracle.com/marketplace/en_US/listing/138899911)
46

57
## Build CloudBank
68

@@ -10,7 +12,7 @@ Version 3.2 of CloudBank is under development. This document and application is
1012
git clone https://github.com/oracle/microservices-datadriven.git
1113
```
1214

13-
1. Got to the `CloudBank` directory
15+
1. Got to the `CloudBank-v32` directory
1416

1517
```shell
1618
cd microservices-datadriven/cloudbank-v32
@@ -57,25 +59,23 @@ Version 3.2 of CloudBank is under development. This document and application is
5759
kubectl get secret -n azn-server oractl-passwords -o jsonpath='{.data.admin}' | base64 -d
5860
```
5961

60-
1. Start `oractl` and login.
62+
1. Start `oractl` from the `cloudbank-v32` directory and login as the `obaas-admin` user.
6163

6264
```text
63-
_ _ __ _ ___
65+
_ _ __ _ ___
6466
/ \ |_) _. _. (_ / | |
6567
\_/ |_) (_| (_| __) \_ |_ _|_
6668
========================================================================================
6769
Application Name: Oracle Backend Platform :: Command Line Interface
68-
Application Version: (1.1.0)
69-
:: Spring Boot (v3.2.0) ::
70-
70+
Application Version: (1.1.1)
71+
:: Spring Boot (v3.2.1) ::
7172
Ask for help:
72-
- Slack: https://oracledevs.slack.com/archives/C03ALDSV272
73-
- email: obaas_ww@oracle.com
74-
73+
- Slack: https://oracledevs.slack.com/archives/C03ALDSV272
74+
- email: obaas_ww@oracle.com
7575
oractl:>connect
76-
username: obaas-admin
77-
password: **************
78-
obaas-cli: Successful connected.
76+
? username obaas-admin
77+
? password *************
78+
Credentials successfully authenticated! obaas-admin -> welcome to OBaaS CLI.
7979
oractl:>
8080
```
8181
@@ -164,13 +164,13 @@ deploy --service-name transfer --artifact-path transfer/target/transfer-0.0.1-SN
164164
```shell
165165
kubectl port-forward -n apisix svc/apisix-admin 9180
166166
```
167-
167+
168168
1. Create routes
169169
170170
In the CloudBank directory run the following command. *NOTE*, you must add the API-KEY to the command
171171
172172
````shell
173-
cd apisix-routes; source ./create-all-routes.sh <YOUR-API-KEY>; cd ..
173+
(cd apisix-routes; source ./create-all-routes.sh <YOUR-API-KEY>)
174174
```
175175
176176
## Optional - autoscaling
@@ -194,22 +194,29 @@ create-autoscaler --service-name transfer --min-replicas 1 --max-replicas 4 --cp
194194
195195
## OpenAPI
196196
197-
All services has OpenAPI documentation and can be reached via the Swagger UI. For example after starting a port forward to anyone of the services you can got to the URL http://localhost:\<port\>/swagger-ui/index.html to see the documentation. Replace \<port\> with the port used in the port forward command.
197+
All services have OpenAPI documentation and can be reached via the Swagger UI. For example after starting a port forward to anyone of the services you can the URL http://localhost:*port*/swagger-ui/index.html to see the documentation. Replace *port* with the port used in the port forward command.
198+
For example, to see the API documentation for the `customer32` application do the following:
199+
200+
```shell
201+
kubectl port-forward -n application svc/customer32 8080
202+
```
203+
204+
And open a browser window and go to [Swagger UI](http://localhost:8080)
198205
199206
This is an example of the `customer32` application:
200207
201-
![Eureka Dashboard Login](images/swagger-example.png " ")
208+
![Swagger UI](images/swagger-example.png " ")
202209
203210
## Test CloudBank Services
204211
205212
1. Get the external IP address
206-
213+
207214
```shell
208215
kubectl -n ingress-nginx get service ingress-nginx-controller
209216
```
210-
217+
211218
Result. Make a note of the EXTERNAL-IP it will be used in the tests.
212-
2.
219+
213220
```text
214221
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
215222
ingress-nginx-controller LoadBalancer 10.96.172.148 146.235.207.230 80:31393/TCP,443:30506/TCP 158m
@@ -297,7 +304,7 @@ This is an example of the `customer32` application:
297304
Transfer-Encoding: chunked
298305
Date: Thu, 02 Nov 2023 18:02:06 GMT
299306
300-
{"accountId":21,"amount":256}
307+
{"accountId":1,"amount":256}
301308
```
302309
303310
1. Check application log
@@ -309,7 +316,7 @@ This is an example of the `customer32` application:
309316
Should contain:
310317
311318
```log
312-
Received deposit <CheckDeposit(accountId=21, amount=256)>
319+
Received deposit <CheckDeposit(accountId=1, amount=256)>
313320
```
314321
315322
1. Check journal entries. Replace '1' with the account number you used.
@@ -326,7 +333,7 @@ This is an example of the `customer32` application:
326333
Transfer-Encoding: chunked
327334
Date: Thu, 02 Nov 2023 18:06:45 GMT
328335
329-
[{"journalId":7,"journalType":"PENDING","accountId":21,"lraId":"0","lraState":null,"journalAmount":256}]
336+
[{"journalId":7,"journalType":"PENDING","accountId":1,"lraId":"0","lraState":null,"journalAmount":256}]
330337
```
331338
332339
1. Clearance of check - Note the JournalID from earlier step
@@ -363,7 +370,7 @@ This is an example of the `customer32` application:
363370
1. Check journal -- DEPOSIT
364371
365372
```shell
366-
curl -i http://<EXTERNAL-IP>/api/v1/account/21/journal
373+
curl -i http://<EXTERNAL-IP>/api/v1/account/1/journal
367374
```
368375
369376
Output should look like this -- DEPOSIT
@@ -374,7 +381,7 @@ This is an example of the `customer32` application:
374381
Transfer-Encoding: chunked
375382
Date: Thu, 02 Nov 2023 18:36:31 GMT
376383
377-
[{"journalId":7,"journalType":"DEPOSIT","accountId":21,"lraId":"0","lraState":null,"journalAmount":256}]`
384+
[{"journalId":7,"journalType":"DEPOSIT","accountId":1,"lraId":"0","lraState":null,"journalAmount":256}]`
378385
```
379386
380387
1. Run LRA Test Cases
@@ -411,7 +418,7 @@ This is an example of the `customer32` application:
411418
1. Perform transfer between two accounts. Note account numbers
412419
413420
```shell
414-
curl -X POST "http://<EXTERNAL-IP>/transfer?fromAccount=22&toAccount=21&amount=100"
421+
curl -X POST "http://<EXTERNAL-IP>/transfer?fromAccount=2&toAccount=1&amount=100"
415422
```
416423
417424
Output should look like this:
@@ -459,10 +466,10 @@ This is an example of the `customer32` application:
459466
460467
```text
461468
2023-12-26T16:50:45.138Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : Started new LRA/transfer Id: http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator/ea98ebae-2358-4dd1-9d7c-09f4550d7567
462-
2023-12-26T16:50:45.139Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : withdraw accountId = 22, amount = 100
469+
2023-12-26T16:50:45.139Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : withdraw accountId = 2, amount = 100
463470
2023-12-26T16:50:45.139Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : withdraw lraId = http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator/ea98ebae-2358-4dd1-9d7c-09f4550d7567
464471
2023-12-26T16:50:45.183Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : withdraw succeeded
465-
2023-12-26T16:50:45.183Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : deposit accountId = 21, amount = 100
472+
2023-12-26T16:50:45.183Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : deposit accountId = 1, amount = 100
466473
2023-12-26T16:50:45.183Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : deposit lraId = http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator/ea98ebae-2358-4dd1-9d7c-09f4550d7567
467474
2023-12-26T16:50:45.216Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : withdraw succeeded deposit succeeded
468475
2023-12-26T16:50:45.216Z INFO 1 --- [transfer] [nio-8080-exec-9] [] com.example.transfer.TransferService : LRA/transfer action will be confirm

cloudbank-v32/account/src/main/resources/db/changelog/txeventq.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
grant execute on dbms_aq to account;
55
grant execute on dbms_aqadm to account;
66
grant execute on dbms_aqin to account;
7+
grant execute on dbms_aqjms TO account;
78
grant execute on dbms_aqjms_internal to account;
89

910
--rollback revoke dbms_aq from ACCOUNT;
1011
--rollback revoke dbms_aqadm from ACCOUNT;
1112
--rollback revoke dbms_aqin from ACCOUNT;
13+
--rollback revoke dbms_aqjms from ACCOUNT;
1214
--rollback revoke dbms_aqjms_internal from ACCOUNT;
1315

14-
1516
--changeset atael:2 endDelimiter:/
1617
begin
1718
-- deposits
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# Copyright (c) 2024, Oracle and/or its affiliates.
3+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
5+
if [ $# -eq 0 ]; then
6+
echo "You must supply the API key as an argument"
7+
exit 1
8+
fi
9+
10+
curl http://localhost:9180/apisix/admin/routes \
11+
-H "X-API-KEY: $1"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
____ _ _________ __ __ _ _
2+
/ ___| _ ___| |_ ___ _ __ ___ ___ _ _|___ /___ \ | \/ | ___ _ __ __ _ ___ __| | |__
3+
| | | | | / __| __/ _ \| '_ ` _ \ / _ \ '__||_ \ __) |____| |\/| |/ _ \| '_ \ / _` |/ _ \ / _` | '_ \
4+
| |__| |_| \__ \ || (_) | | | | | | __/ | ___) / __/_____| | | | (_) | | | | (_| | (_) | (_| | |_) |
5+
\____\__,_|___/\__\___/|_| |_| |_|\___|_| |____/_____| |_| |_|\___/|_| |_|\__, |\___/ \__,_|_.__/
6+
|___/
7+
8+
${application.title} ${application.version}
9+
Powered by Spring Boot ${spring-boot.version}

0 commit comments

Comments
 (0)