@@ -13,9 +13,9 @@ Auditing, health and metrics gathering can be automatically applied to your appl
[[production-ready-enabling]]
== Enabling production-ready features.
The https://github.com/spring-projects/spring-boot/tree/master/spring-boot-actuator[`spring-boot-actuator`] module provides all of Spring Boot'sproduction-ready
http://redis.io/[Redis] is a cache, message broker and richly-featured key-value store. Spring Boot offers basic autoconfiguration for the https://github.com/xetorthio/jedis/[Jedis] client library and abstractions on top of it provided by https://github.com/spring-projects/spring-data-redis[Spring Data Redis]. There is a `spring-boot-starter-redis` ``Starter POM`` for collecting the dependencies in a convenient way.
http://redis.io/[Redis] is a cache, message broker and richly-featured key-value store.
Spring Boot offers basic auto-configuration for the https://github.com/xetorthio/jedis/[Jedis]
client library and abstractions on top of it provided by
https://github.com/spring-projects/spring-data-redis[Spring Data Redis]. There is a
`spring-boot-starter-redis` ``Starter POM'' for collecting the dependencies in a
convenient way.
[[boot-features-connecting-to-redis]]
==== Connecting to Redis
You can inject an auto-configured `RedisConnectionFactory`, `StringRedisTemplate` or vanilla `RedisTemplate` instance as you would any other
Spring Bean. By default the instance will attempt to connect to a Redis server using
`localhost:6379`:
You can inject an auto-configured `RedisConnectionFactory`, `StringRedisTemplate` or
vanilla `RedisTemplate` instance as you would any other Spring Bean. By default the
instance will attempt to connect to a Redis server using `localhost:6379`:
[source,java,indent=0]
----
...
...
@@ -1462,9 +1471,11 @@ Spring Bean. By default the instance will attempt to connect to a Redis server u
}
----
If you add a `@Bean` of your own of any of the autoconfigured types it will replace the default
(except in the case of `RedisTemplate` the exlcusion is based on the bean name "redisTemplate" not its type).
If `commons-pool2` is on the classpath you will get a pooled connection factory by default.
If you add a `@Bean` of your own of any of the auto-configured types it will replace the
default (except in the case of `RedisTemplate` the exclusion is based on the bean name
``redisTemplate'' not its type). If `commons-pool2` is on the classpath you will get a
pooled connection factory by default.
[[boot-features-mongodb]]
...
...
@@ -1581,22 +1592,33 @@ TIP: For complete details of Spring Data MongoDB, including its rich object mapp
technologies, refer to their http://projects.spring.io/spring-data-mongodb/[reference
documentation].
[[boot-features-gemfire]]
=== Gemfire
https://github.com/spring-projects/spring-data-gemfire[Spring Data Gemfire] provides convenient Spring-friendly
tools for accessing the http://www.gopivotal.com/big-data/pivotal-gemfire#details[Pivotal Gemfire] data management platform.
There is a `spring-boot-starter-data-gemfire` ``Starter POM`` for collecting the dependencies in a convenient way. There is currently no autoconfig support for Gemfire but you can enable Spring Data Repositories with a https://github.com/spring-projects/spring-data-gemfire/blob/master/src/main/java/org/springframework/data/gemfire/repository/config/EnableGemfireRepositories.java[single annotation].
https://github.com/spring-projects/spring-data-gemfire[Spring Data Gemfire] provides
convenient Spring-friendly tools for accessing the http://www.gopivotal.com/big-data/pivotal-gemfire#details[Pivotal Gemfire]
data management platform. There is a `spring-boot-starter-data-gemfire` ``Starter POM''
for collecting the dependencies in a convenient way. There is currently no auto=config
support for Gemfire, but you can enable Spring Data Repositories with a
http://lucene.apache.org/solr/[Apache Solr] is a search engine. Spring Boot offers basic autoconfiguration for the solr client library and abstractions on top of it provided by https://github.com/spring-projects/spring-data-elasticsearch[Spring Data Solr]. There is a `spring-boot-starter-data-solr` ``Starter POM`` for collecting the dependencies in a convenient way.
http://lucene.apache.org/solr/[Apache Solr] is a search engine. Spring Boot offers basic
auto-configuration for the solr client library and abstractions on top of it provided by
https://github.com/spring-projects/spring-data-elasticsearch[Spring Data Solr]. There is
a `spring-boot-starter-data-solr` ``Starter POM'' for collecting the dependencies in a
convenient way.
[[boot-features-connecting-to-solr]]
==== Connecting to Solr
You can inject an auto-configured `SolrServer` instance as you would any other
Spring Bean. By default the instance will attempt to connect to a server using
You can inject an auto-configured `SolrServer` instance as you would any other Spring
Bean. By default the instance will attempt to connect to a server using
`http://localhost:8983/solr`:
[source,java,indent=0]
...
...
@@ -1618,32 +1640,41 @@ Spring Bean. By default the instance will attempt to connect to a server using
If you add a `@Bean` of your own of type `SolrServer` it will replace the default.
[[boot-features-spring-data-solr-repositories]]
==== Spring Data Solr repositories
Spring Data includes repository support for Apache Solr. As with the JPA repositories
discussed earlier, the basic principle is that queries are constructed for you
automatically based on method names.
In fact, both Spring Data JPA and Spring Data Solr share the same common
infrastructure; so you could take the JPA example from earlier and, assuming that
`City` is now a `@SolrDocument` class rather than a JPA `@Entity`, it will work in the
same way.
In fact, both Spring Data JPA and Spring Data Solr share the same common infrastructure;
so you could take the JPA example from earlier and, assuming that `City` is now a
`@SolrDocument` class rather than a JPA `@Entity`, it will work in the same way.
TIP: For complete details of Spring Data Solr, refer to their
TIP: For complete details of Spring Data Solr, including its rich object mapping
technologies, refer to their http://projects.spring.io/spring-data-solr/[reference
documentation].
[[boot-features-elasticsearch]]
=== Elasticsearch
http://www.elasticsearch.org/[Elastic Search] is a search engine. Spring Boot offers basic autoconfiguration for the solr client library and abstractions on top of it provided by [Spring Data Solr](https://github.com/spring-projects/spring-data-elasticsearch). There is a `spring-boot-starter-data-elasticsearch` ``Starter POM`` for collecting the dependencies in a convenient way.
http://www.elasticsearch.org/[Elastic Search] is an open source, distributed,
real-time search and analytics engine. Spring Boot offers basic auto-configuration for
the Elasticsearch and abstractions on top of it provided by
[Spring Data Elasticsearch](https://github.com/spring-projects/spring-data-elasticsearch).
There is a `spring-boot-starter-data-elasticsearch` ``Starter POM'' for collecting the
dependencies in a convenient way.
[[boot-features-connecting-to-elasticsearch]]
==== Connecting to Elasticsearch
You can inject an auto-configured `ElasticsearchTemplate` or Elasticsearch `Client` instance as you would any other
Spring Bean. By default the instance will attempt to connect to a local in-memory server (a `NodeClient` in Elasticsearch
terms), but you can switch to a remote server (i.e. a `TransportClient`) by setting `spring.data.elasticsearch.clusterNodes`
to a comma-separated "host:port" list.
You can inject an auto-configured `ElasticsearchTemplate` or Elasticsearch `Client`
instance as you would any other Spring Bean. By default the instance will attempt to
connect to a local in-memory server (a `NodeClient` in Elasticsearch terms), but you can
switch to a remote server (i.e. a `TransportClient`) by setting
`spring.data.elasticsearch.clusterNodes` to a comma-separated "host:port" list.
[source,java,indent=0]
----
...
...
@@ -1662,7 +1693,10 @@ to a comma-separated "host:port" list.
}
----
If you add a `@Bean` of your own of type `ElasticsearchTemplate` it will replace the default.
If you add a `@Bean` of your own of type `ElasticsearchTemplate` it will replace the