Skip to content

Commit 27b49cd

Browse files
authored
Project structure and cfg server update (#798)
* Project structure and cfg server update * typo * Rhonda updates * Rhonda fix
1 parent 4e25c9d commit 27b49cd

File tree

2 files changed

+65
-44
lines changed

2 files changed

+65
-44
lines changed

docs-source/spring/content/development/project.md

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,32 @@
22
title: "Project Structure"
33
---
44

5-
To take advantage of the built-in platform services, Oracle recommends
6-
using the following project structure.
5+
To take advantage of the built-in platform services, Oracle recommends using the following project structure.
76

87
Recommended versions:
98

10-
* Spring Boot 3.1.5
9+
* Spring Boot 3.1.6
1110
* Spring Cloud 2022.0.4
1211
* Java 17 or 21
1312

14-
### Dependencies
13+
Table of Contents:
1514

16-
Oracle recommends adding the following dependencies to your application so that it
17-
can take advantage of the built-in platform services:
15+
* [Dependencies](#dependencies)
16+
* [Spring Application Configuration](#spring-application-configuration)
17+
* [Data Sources](#data-sources)
18+
* [Liquibase](#liquibase)
19+
* [Oracle Transaction Manager for Microservices](#oracle-transaction-manager-for-microservices)
20+
* [Spring Config Server](#spring-config-server)
21+
22+
## Dependencies
23+
24+
Oracle recommends adding the following dependencies to your application so that it can take advantage of the built-in platform services. For example:
1825

1926
```xml
2027
<properties>
2128
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2229
<java.version>17</java.version>
23-
<spring.boot.dependencies.version>3.1.5</spring.boot.dependencies.version>
30+
<spring.boot.dependencies.version>3.1.6</spring.boot.dependencies.version>
2431
<spring-cloud.version>2022.0.4</spring-cloud.version>
2532
</properties>
2633

@@ -63,11 +70,9 @@ can take advantage of the built-in platform services:
6370
</dependencyManagement>
6471
```
6572

66-
### Spring Application Configuration
73+
## Spring Application Configuration
6774

68-
Oracle recommends the following configuration in order for the application access to
69-
use the built-in services, including the Spring Boot Eureka Service Registry and the
70-
observability tools:
75+
Oracle recommends the following configuration in order for the application to access the built-in services, including the Spring Boot Eureka Service Registry and the observability tools:
7176

7277
```yaml
7378
spring:
@@ -100,13 +105,11 @@ management:
100105
application: ${spring.application.name}
101106
```
102107
103-
The variables in this configuration are automatically injected to your deployment
104-
and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application.
108+
The variables in this configuration are automatically injected to your deployment and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application.
105109
106-
#### Data Sources
110+
### Data Sources
107111
108-
If your application uses a data source, then add the following configuration. Note that this
109-
example shows Java Persistence API (JPA), if you are using JDBC you should use the appropriate configuration.
112+
If your application uses a data source, then add the following configuration. Note that this example shows Java Persistence API (JPA). If you are using JDBC you should use the appropriate configuration. For example:
110113
111114
```yaml
112115
spring:
@@ -133,17 +136,15 @@ spring:
133136
max-pool-size: 30
134137
```
135138
136-
The variables in this configuration are automatically injected to your deployment
137-
and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application.
139+
The variables in this configuration are automatically injected to your deployment and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application.
138140
139-
#### Liquibase
141+
### Liquibase
140142
141-
If you are using Liquibase to manage your database schema and data, then you should
142-
add the following dependency:
143+
If you are using Liquibase to manage your database schema and data, then you should add the following dependency:
143144
144145
```xml
145146
<properties>
146-
<liquibase.version>4.24.0</liquibase.version>
147+
<liquibase.version>4.25.0</liquibase.version>
147148
</properties>
148149

149150
<dependencies>
@@ -167,39 +168,50 @@ spring:
167168
enabled: ${LIQUIBASE_ENABLED:true}
168169
```
169170
170-
The variables in this configuration are automatically injected to your deployment
171-
and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application.
172-
When you use the `deploy` command, you must specify the `liquibase-db` parameter and
173-
provide a user with sufficient privileges, generally this will be premissions to create and alter
174-
users and to grant roles and privileges. If your service uses JMS, this use may also
175-
need execute permissions on `dbms.aq_adm`, `dbms.aq_in` and `dbms.aq_jms`.
176-
171+
The variables in this configuration are automatically injected to your deployment and pods when you use the Oracle Backend for Spring Boot and Microservices CLI to deploy your application. When you use the `deploy` command, you must specify the `liquibase-db` parameter and provide a user with sufficient privileges. Generally this will be permissions to create and alter users and to grant roles and privileges. If your service uses Java Messaging Service (JMS), this use may also need execute permission on `dbms.aq_adm`, `dbms.aq_in` and `dbms.aq_jms`.
177172

178-
#### Oracle Transaction Manager for Microservices
173+
### Oracle Transaction Manager for Microservices
179174

180-
If you are using Oracle Transaction Manager for Microservices (MicroTx) to manage
181-
data consistency across microservices data stores, then add the following
182-
dependency:
175+
If you are using Oracle Transaction Manager for Microservices (MicroTx) to manage data consistency across microservices data stores, then add the following dependency:
183176

184177
```xml
185178
<dependency>
186-
<groupId>com.oracle.microtx.lra</groupId>
187-
<artifactId>microtx-lra-spring-boot-starter-3x</artifactId>
188-
<version>23.4.1</version>
179+
<groupId>com.oracle.microtx.lra</groupId>
180+
<artifactId>microtx-lra-spring-boot-starter-3x</artifactId>
181+
<version>23.4.1</version>
189182
</dependency>
190183
```
191184

192-
Add the following configuration to your Spring application configuration:
185+
Add the following configuration to your Spring application configuration. The variables in this configuration are automatically injected to your deployment and pods when you use the Oracle Backend for Spring Boot and Microservices CLI or the Visual Studio Code Extension to deploy your application. For example:
193186

194187
```yaml
195188
spring:
196189
microtx:
197190
lra:
198-
coordinator-url: http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator
191+
coordinator-url: ${MP_LRA_COORDINATOR_URL}
199192
propagation-active: true
200193
headers-propagation-prefix: "{x-b3-, oracle-tmm-, authorization, refresh-}"
201194
202195
lra:
203196
coordinator:
204-
url: http://otmm-tcs.otmm.svc.cluster.local:9000/api/v1/lra-coordinator
205-
```
197+
url: ${MP_LRA_COORDINATOR_URL}
198+
```
199+
200+
### Spring Config Server
201+
202+
If you are using Spring Config Server to manage configurations, then add the following dependency:
203+
204+
```xml
205+
<dependency>
206+
<groupId>org.springframework.cloud</groupId>
207+
<artifactId>spring-cloud-starter-config</artifactId>
208+
</dependency>
209+
```
210+
211+
Add the following configuration to your Spring application configuration. The variables in this configuration are automatically injected to your deployment and pods when you use the Oracle Backend for Spring Boot and Microservices CLI or the Visual Studio Code Extension to deploy your application. For example:
212+
213+
```yaml
214+
spring:
215+
config:
216+
import=optional:configserver:${config.server.url}
217+
```

docs-source/spring/content/platform/config/_index.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ When building applications using Spring Config Server, the Spring Cloud Config c
1818
```yaml
1919
spring:
2020
config:
21-
import: optional:configserver:http://config-server.config-server.svc.cluster.local:8080
21+
import: optional:configserver:${config.server.url}
2222
```
2323
24-
Configuration is stored in the `CONFIGSERVER` schema in the `PROPERTIES` table. Managing the data for the Spring Cloud Config server should be done using the CLI or the REST API endpoints. If you prefer, you can also work directly with the `CONFIGSERVER.PROPERTIES` table in the database. How to access the database is documented here, ([Accessing the database](../../database/)).
24+
You also need to add the following dependency to your Spring Boot application `pom.xml`:
25+
26+
```xml
27+
<dependency>
28+
<groupId>org.springframework.cloud</groupId>
29+
<artifactId>spring-cloud-starter-config</artifactId>
30+
</dependency>
31+
```
32+
33+
The configuration is stored in the `CONFIGSERVER` schema in the `PROPERTIES` table. Managing the data for the Spring Cloud Config server should be done using the CLI or the REST API endpoints. If you prefer, you can also work directly with the `CONFIGSERVER.PROPERTIES` table in the database. How to access the database is documented here, ([Accessing the database](../../database/)).
2534

2635
During setup of Oracle Backend for Spring Boot and Microservices, the following data is loaded into `CONFIGSERVER.PROPERTIES`. This data can be deleted.
2736

@@ -40,7 +49,7 @@ During setup of Oracle Backend for Spring Boot and Microservices, the following
4049
| application-b | development | 23cbeta | db-dev-connection | connectionstring-b-dev |
4150
| application-c | secret | 23.4 | json-db | 23c-json-db |
4251
| application-c | secret | 23.4 | json-sdb-conn | 23c-mongo-conn |
43-
| application-c | secret | 23.4 | txenventq | 23c-conn-string |
52+
| application-c | secret | 23.4 | txeventq | 23c-conn-string |
4453
| application-c | secret | 23.4 | txeventq | 23c-kafka-name |
4554
```
4655

@@ -384,6 +393,6 @@ INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALU
384393
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-b','development','23cbeta','db-dev-connection','connectionstring-b-dev');
385394
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-c','secret','23.4','json-db','23c-json-db');
386395
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-c','secret','23.4','json-sdb-conn','23c-mongo-conn');
387-
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-c','secret','23.4','txenventq','23c-conn-string');
396+
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-c','secret','23.4','txeventq','23c-conn-string');
388397
INSERT INTO CONFIGSERVER.PROPERTIES (APPLICATION, PROFILE, LABEL, PROP_KEY, VALUE) VALUES ('application-c','secret','23.4','txeventq','23c-kafka-name');
389398
```

0 commit comments

Comments
 (0)