@@ -3964,25 +3964,16 @@ TIP: The "`How-to`" section includes a <<howto.adoc#howto-initialize-a-database-
...
@@ -3964,25 +3964,16 @@ TIP: The "`How-to`" section includes a <<howto.adoc#howto-initialize-a-database-
To customize the connections created by a `ConnectionFactory`, i.e., set specific parameters that you do not want (or cannot) configure in your central database configuration, you can use a `ConnectionFactoryOptionsBuilderCustomizer` `@Bean`.
To customize the connections created by a `ConnectionFactory`, i.e., set specific parameters that you do not want (or cannot) configure in your central database configuration, you can use a `ConnectionFactoryOptionsBuilderCustomizer` `@Bean`.
The following example shows how to manually override the database port while the rest of the options is taken from the application configuration:
The following example shows how to manually override the database port while the rest of the options is taken from the application configuration:
TIP: We have barely scratched the surface of Spring Data R2DBC. For complete details, see the {spring-data-r2dbc-docs}[Spring Data R2DBC reference documentation].
TIP: We have barely scratched the surface of Spring Data R2DBC. For complete details, see the {spring-data-r2dbc-docs}[Spring Data R2DBC reference documentation].
...
@@ -4110,21 +4075,9 @@ You can inject an auto-configured `RedisConnectionFactory`, `StringRedisTemplate
...
@@ -4110,21 +4075,9 @@ You can inject an auto-configured `RedisConnectionFactory`, `StringRedisTemplate
By default, the instance tries to connect to a Redis server at `localhost:6379`.
By default, the instance tries to connect to a Redis server at `localhost:6379`.
The following listing shows an example of such a bean:
The following listing shows an example of such a bean:
If you have defined your own `MongoClient`, it will be used to auto-configure a suitable `MongoDatabaseFactory`.
If you have defined your own `MongoClient`, it will be used to auto-configure a suitable `MongoDatabaseFactory`.
...
@@ -4219,23 +4152,9 @@ The auto-configuration configures this factory automatically if Netty is availab
...
@@ -4219,23 +4152,9 @@ The auto-configuration configures this factory automatically if Netty is availab
{spring-data-mongodb}[Spring Data MongoDB] provides a {spring-data-mongodb-api}/core/MongoTemplate.html[`MongoTemplate`] class that is very similar in its design to Spring's `JdbcTemplate`.
{spring-data-mongodb}[Spring Data MongoDB] provides a {spring-data-mongodb-api}/core/MongoTemplate.html[`MongoTemplate`] class that is very similar in its design to Spring's `JdbcTemplate`.
As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the template, as follows:
As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the template, as follows:
See the {spring-data-mongodb-api}/core/MongoOperations.html[`MongoOperations` Javadoc] for complete details.
See the {spring-data-mongodb-api}/core/MongoOperations.html[`MongoOperations` Javadoc] for complete details.
...
@@ -4251,20 +4170,9 @@ As with the JPA repositories discussed earlier, the basic principle is that quer
...
@@ -4251,20 +4170,9 @@ As with the JPA repositories discussed earlier, the basic principle is that quer
In fact, both Spring Data JPA and Spring Data MongoDB share the same common infrastructure.
In fact, both Spring Data JPA and Spring Data MongoDB share the same common infrastructure.
You could take the JPA example from earlier and, assuming that `City` is now a MongoDB data class rather than a JPA `@Entity`, it works in the same way, as shown in the following example:
You could take the JPA example from earlier and, assuming that `City` is now a MongoDB data class rather than a JPA `@Entity`, it works in the same way, as shown in the following example:
You can configure various aspects of the driver using `spring.neo4j.*` properties.
You can configure various aspects of the driver using `spring.neo4j.*` properties.
...
@@ -4348,19 +4244,9 @@ For complete details of Spring Data Neo4j, refer to the {spring-data-neo4j-docs}
...
@@ -4348,19 +4244,9 @@ For complete details of Spring Data Neo4j, refer to the {spring-data-neo4j-docs}
Spring Data Neo4j shares the common infrastructure with Spring Data JPA as many other Spring Data modules do.
Spring Data Neo4j shares the common infrastructure with Spring Data JPA as many other Spring Data modules do.
You could take the JPA example from earlier and define `City` as Spring Data Neo4j `@Node` rather than JPA `@Entity` and the repository abstraction works in the same way, as shown in the following example:
You could take the JPA example from earlier and define `City` as Spring Data Neo4j `@Node` rather than JPA `@Entity` and the repository abstraction works in the same way, as shown in the following example:
public MyBean(ElasticsearchRestTemplate template) {
this.template = template;
}
// ...
}
----
----
In the presence of `spring-data-elasticsearch` and the required dependencies for using a `WebClient` (typically `spring-boot-starter-webflux`), Spring Boot can also auto-configure a <<boot-features-connecting-to-elasticsearch-reactive-rest,ReactiveElasticsearchClient>> and a `ReactiveElasticsearchTemplate` as beans.
In the presence of `spring-data-elasticsearch` and the required dependencies for using a `WebClient` (typically `spring-boot-starter-webflux`), Spring Boot can also auto-configure a <<boot-features-connecting-to-elasticsearch-reactive-rest,ReactiveElasticsearchClient>> and a `ReactiveElasticsearchTemplate` as beans.
...
@@ -4608,20 +4471,9 @@ NOTE: If you're using `CqlSessionBuilder` to create multiple `CqlSession` beans,
...
@@ -4608,20 +4471,9 @@ NOTE: If you're using `CqlSessionBuilder` to create multiple `CqlSession` beans,
The following code listing shows how to inject a Cassandra bean:
The following code listing shows how to inject a Cassandra bean:
This example demonstrates the use of caching on a potentially costly operation.
This example demonstrates the use of caching on a potentially costly operation.
...
@@ -4937,19 +4744,9 @@ If you add dependencies manually, you must include `spring-context-support` in o
...
@@ -4937,19 +4744,9 @@ If you add dependencies manually, you must include `spring-context-support` in o
If the `CacheManager` is auto-configured by Spring Boot, you can further tune its configuration before it is fully initialized by exposing a bean that implements the `CacheManagerCustomizer` interface.
If the `CacheManager` is auto-configured by Spring Boot, you can further tune its configuration before it is fully initialized by exposing a bean that implements the `CacheManagerCustomizer` interface.
The following example sets a flag to say that `null` values should be passed down to the underlying map:
The following example sets a flag to say that `null` values should be passed down to the underlying map:
@@ -5446,28 +5198,9 @@ TIP: See https://spring.io/blog/2010/06/14/understanding-amqp-the-protocol-used-
...
@@ -5446,28 +5198,9 @@ TIP: See https://spring.io/blog/2010/06/14/understanding-amqp-the-protocol-used-
==== Sending a Message
==== Sending a Message
Spring's `AmqpTemplate` and `AmqpAdmin` are auto-configured, and you can autowire them directly into your own beans, as shown in the following example:
Spring's `AmqpTemplate` and `AmqpAdmin` are auto-configured, and you can autowire them directly into your own beans, as shown in the following example: