Springboot - MongoDB - ValueObject unavailable in mapreduce package - spring

Im doing the mapReduce example provided in spring mongodb documentation, however, the class ValueObject is not available in spring mongodb package:
org.springframework.data.mongodb.core.mapreduce
Eventhough, it is available in the spring github repo
I am using spring boot version 1.5.9.RELEASE
EDIT: One can easily implement it and use it. I am just wondering, did they remove it because it is easy to implement?

Related

Correct the classpath of your application so that it contains a single, compatible version of org.elasticsearch.client.IndicesClient

Getting Error Like
An attempt was made to call the method org.elasticsearch.client.IndicesClient.create(Lorg/elasticsearch/action/admin/indices/create/CreateIndexRequest;[Lorg/apache/http/Header;)
Lorg/elasticsearch/action/admin/indices/create/CreateIndexResponse; but it does not exist. Its class, org.elasticsearch.client.IndicesClient, is available from the following locations:
jar:file:/audit.jar!/BOOT-INF/lib/elasticsearch-rest-high-level-client-6.7.0.jar!/org/elasticsearch/client/IndicesClient.class
It was loaded from the following location:
jar:file:/audit.jar!/BOOT-INF/lib/elasticsearch-rest-high-level-client-6.7.0.jar!
Please Help me out to solve this issue
Spring Boot 2.1.x uses Spring Data Elasticsearch 3.1.x which in turn is built against the libraries of Elasticsearch 6.2.2.
If you want to use Elasticsearch 6.8.5 you need to upgrade your Spring Data Elasticsearch version to 3.2.3 which is built against Elasticsearch 6.8.4.
I don't know if Spring Boot 2.1.0 can handle this in it's autoconfiguration, you might have to annotate your application with:
#SpringBootApplication(exclude = ElasticsearchDataAutoConfiguration.class)
and configure Spring Data Elasticsearch by yourself.

Spring Boot 2.0.2 - Missing classes MetricRepositoryAutoConfiguration, MetricFilterAutoConfiguration

in Spring Boot 1.5 application the application class was annotated with:
#EnableAutoConfiguration(exclude = {MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class})
These classes were I believe in the package:
import org.springframework.boot.actuate.autoconfigure.*;
Now upgrade to Spring Boot 2.0.2 but those classes are missing, can't find them anywhere.
What changed? How to solve?
Thanks!
Spring Boot’s own metrics have been replaced with support, including
auto-configuration, for Micrometer and dimensional metrics.
if you want to disable metrics set management.endpoint.metrics.enabled=false
there is a complete guide that makes migration a lot easier
Spring Boot 2.0 Migration Guide

Spring Boot 2.x Metrics classes

I have started using spring boot 2.0.0-Snapshot and I see that all Metric related classes and interfaces does not exists ?
Example:
The jar spring-boot-actuator-2.0.0.BUILD-SNAPSHOT.jar does not have package
org.springframework.boot.actuate.metrics.writer at all
Are they moved to somewhere else?
In Spring Boot 2 the previous metrics implementation has been replaced by integration with Micrometer. From the release notes:
Spring Boot’s own metrics have been replaced with support, including auto-configuration, for Micrometer and dimensional metrics. You can learn more about Micrometer in its user manual and Spring Boot’s reference guide
I can't find any guide for migrating from 1.x Spring Boot Metrics to 2.x Spring Boot Metrics but this change is quite recent so I suspect any such docs are a TODO. In the meantime, you could perhaps dig into the Pull Request or follow the Spring Boot 2 docs ...
Micrometer provides a separate module for each supported monitoring system. Depending on one (or more) of these modules is sufficient to get started with Micrometer in your Spring Boot application. To learn more about Micrometer’s capabilities, please refer to its reference documentation.

Does #NodeEntityScan exist in Spring Boot 1.4.0.RELEASE?

According to http://docs.spring.io/spring-boot/docs/1.4.0.RELEASE/reference/htmlsingle/#boot-features-neo4j there is a #NodeEntityScan annotation that:
You can customize entity scanning locations using the #NodeEntityScan annotation.
According to http://docs.spring.io/spring-boot/docs/1.4.0.M3/api/org/springframework/boot/neo4j/NodeEntityScan.html it existed in version spring-boot 1.4.0.M3
But http://docs.spring.io/spring-boot/docs/1.4.0.RELEASE/api/org/springframework/boot/neo4j/NodeEntityScan.html suggests it doesn't exist in 1.4.0.RELEASE and I can't find any mention of it.
Does this annotation exist in spring boot 1.4.0.RELEASE ? Is this a case where the documentation has not been updated? What should be used instead?
Spring Boot 1.4 has the generic annotation org.springframework.boot.autoconfigure.domain.EntityScan (JavaDoc), which registers the packages to scan for entities for JPA, Neo4J, MongoDB, Cassandra and Couchbase.

Spring configuration using Java annotations

I have started working on an inventory management system (web application) using Spring Framework 3.1.1** and would like to configure Spring Framework using Java annotations. I searched Google, but I could not find a suitable example showing how to configure Spring Framework using Java annotations in a web application. Where is there a proper example or tutorial?
Spring Framework references are comprehensive. Refer to the Spring reference material, 3.11 Java-based container configuration.
Another option to consider is to use Java based configuration. It is more readable, and is easier than annotations.
Spring Documentation
Simple Example using Java based configuration

Resources