How to disable any write operations in Spring Data Elasticsearch? - spring-data-elasticsearch

I have microservice which just reads data from elasticsearch cluster. I want to disable all PUT operations related to mappings at boot time for the index. How can I achieve this?

No way to do this in Spring Data Elasticsearch. But if it's your microservice that accesses the cluster, why do any changing calls at all?
You can use the user and role management from Elasticsearch (xpack) to create a Elasticsearch user that can only read from indices, and then use the basic authentication (available as of Spring Data Elasticsearch 3.2) in Spring Data Elastcsearch to authenticate against Elasticsearch.

Related

How to use date_detection and numeric_detection in spring data elasticsearch

I am using spring data elasticsearch. I have a business requirement to use date_detection:false and numeric_detection:false to disable auto date and numeric detection by elasticsearch.
Can some one please help or instruct how to use date_detection:false and numeric_detection:false in spring data elasticsearch?

Spring Cloud data flow does not show Spring cloud task execution details

The Spring cloud dataflow documentation mentions
When executing tasks externally (i.e. command line) and you wish for Spring Cloud Data Flow to show the TaskExecutions in its UI, be sure that common datasource settings are shared among the both. By default Spring Cloud Task will use a local H2 instance and the execution will not be recorded to the database used by Spring Cloud Data Flow.
I am new to Spring cloud dataflow and spring cloud task. Can somebody help me how to setup a common datasource for both. For my development purpose I'm using the embedded H2 database. Can I use the embedded one to see task execution details in Spring Flo/Dashboard?
A common "datasource" must be shared between Spring Cloud Data Flow (SCDF) and your Spring Cloud Task (SCT) applications in order to track and monitor task executions. If the datasource is not shared, both SCDF and SCT applications by default use a individual H2 database. And because they are on different databases, the task-executions in SCDF won't have visibility to independent execution history of SCT microservice applications.
Make sure to supply common DB properties to both. In your case, you can supply the same H2 DB properties. It is as simple as Spring Boot DB property overrides.

Using rescore when building queries with Spring data elasticsearch?

Is it possible to make use of rescore when building a query with Spring data elastic? I'm using Spring boot 1.4.0.RC1
Spring Data Elasticsearch has a RescoreBuilder class that you can use to do this.

Can ElasticSearch Be Used To Index and Query Private (Not Publicly Exposed) Data?

I'm considering implementing Elasticsearch into a Content Management System (CMS) web app built using Ruby on Rails. However, since the app requires user account creation, none of the data is publicly exposed. When I'm indexing and quering this private data, will I be able to use Elasticsearch?
Yes, although Elasticsearch does not consider security at all, so you would need to handle this via your data access layer.

Spring Data Neo4j load balancing

I'm working on an application using Spring Data Neo4j that works with an embedded Neo4j Server. I would like for my application to be able to work with a cluster containing 3 Neo4j nodes, one of this nodes being the embedded server.
I am trying to accomplish some sort of load balancing within the cluster: 1. round-robin requests on each server or 2. write requests on the master embedded server and read requests on the other two servers.
Does Spring Data Neo4j have any kind of load balancing mechanism out of the box? What configuration is necessary to achieve this? Do I need additional tools like HAProxy or mod_proxy? Is there any example of how they can be integrated with the Neo4j cluster and Spring Data Neo4j?
A load balancer component is not part of Neo4j nor part of Spring Data Neo4j. For a sample setup using Neo4j as server is documented at http://docs.neo4j.org/chunked/stable/ha-haproxy.html.
Since your application uses SDN in embedded HA mode, you need to expose the status of your local instance (master or slave) yourself to achieve the same like /db/manage/server/ha/master does in server mode. You might use HighlyAvailableGraphDatabase.isMaster() in your implementation.

Resources