You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/db_starters.adoc
+113-7Lines changed: 113 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
// Copyright (c) 2024, Oracle and/or its affiliates.
2
2
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
3
3
4
-
[#AQ/JMS]
5
-
== AQ/JMS
4
+
[[database-spring-starters]]
5
+
== Database Spring Boot Starters
6
+
7
+
=== AQ/JMS
6
8
7
9
This starter provides support for Oracle Transactional Event Queues (TxEventQ) and Oracle Advanced Queuing (AQ) as Java Message Service (JMS) providers. It depends on the Universal Connection Pool (UCP) starter.
8
10
@@ -28,13 +30,13 @@ dependencies {
28
30
}
29
31
----
30
32
31
-
=== Using AQ/JMS
33
+
==== Using AQ/JMS
32
34
33
35
To configure your application to use Oracle Transactional Event Queues or Oracle Advanced Queuing, you must annotate you application with the `@EnableJms` annotation, and create the
34
36
two following beans:
35
37
36
38
* A `JmsListenerContainerFactory<?>` bean, which can be created as shown in the following example. Note that you can override settings if you need to. Also, note that the name of the method defines the name of the factory, which you will use when creating JMS listeners.
37
-
* A `MessageConverter` bean to map objects of your class representing the payload into a text based format (like JSON) that can be used in the actual messages.
39
+
* A `MessageConverter` bean to map objects of your class representing the payload into a text based format (like JSON) that can be used in the actual messages.
38
40
39
41
**Note**: Any queues or topics that you want to use must be pre-created in the database. See [Sample Code](https://www.oracle.com/database/advanced-queuing/#rc30sample-code) for
40
42
examples.
@@ -71,19 +73,19 @@ public class JmsSampleApplication {
71
73
// You could override some of Boot's defaults here if necessary
72
74
return factory;
73
75
}
74
-
76
+
75
77
@Bean
76
78
public MessageConverter jacksonJmsMessageConverter() {
77
79
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
**Note**: The starter uses the configuration for `spring.datasource` as the connection details for the Oracle Database hosting the queues and topics. If you wish to use a different configuration, you must use a named configuration, for example `spring.datasource.txeventq` and use Java configuration and annotate the configuration with the standard Spring `@Qualifier` annotation, specifying the correct name, for example `txevevntq`.
122
+
123
+
=== Universal Connection Pool
124
+
125
+
This starter provides a connection (data source) to an Oracle Database using Universal Connection Pool, which provides an efficient way to use database connections.
126
+
127
+
To add this starter to your project, add this Maven dependency:
An Oracle data source is injected into your application and can be used normally. You must configure the data source as shown below, and you should also add either Spring Data JDBC or Spring Data JPA to your project.
150
+
151
+
To configure the data source, provide a `spring.datasource` object in your Spring `application.yaml`, or equivalent, as shown in the following example. The `oracleucp` entry is optional, and can be used to fine tune the configuration of the connection pool, if desired. For details of available settings, refer to the [JavaDoc](https://docs.oracle.com/en/database/oracle/oracle-database/21/jjuar/oracle/ucp/jdbc/UCPDataSource.html).
The `spring.datasource.url` can be in the basic format (as previously shown), or in TNS format if your application uses Transparent Network Substrate (TNS).
179
+
180
+
Note that the connections to the database use the `DEDICATED` server by default. If you wish to use `SHARED` or `POOLED`, you can append that to the basic URL, or add it to the TNS names entry. For example, to use database resident pooled connections, you would change the URL shown in the previous example to the following:
181
+
182
+
[source,yaml]
183
+
----
184
+
datasource:
185
+
url: jdbc:oracle:thin:@//myhost:1521/pdb1:pooled
186
+
----
187
+
188
+
If you are using TNS, add `server=pooled` to the `connect_data`. For example:
189
+
190
+
[source,text]
191
+
----
192
+
mydb_tp = (description=
193
+
(retry_count=20)
194
+
(retry_delay=3)
195
+
(address=(protocol=tcps)(port=1521)(host=myhost))
196
+
(connect_data=(service_name=pdb1)(server=pooled))
197
+
(security=(ssl_server_dn_match=yes)))
198
+
----
199
+
200
+
If you prefer to use Java configuration, the data source can be configured as shown in the following example:
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/vault.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
// Copyright (c) 2024, Oracle and/or its affiliates.
2
2
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
3
3
4
-
[#vault]
5
-
== Vault
4
+
[#oci-vault]
5
+
== OCI Vault
6
6
7
7
https://docs.oracle.com/en-us/iaas/Content/KeyManagement/home.htm[Vault] can be used as a Spring property source for Vault secrets, and as an application bean for creating, updating, listing, and deleting secrets from a Vault.
0 commit comments