Code Monkey home page Code Monkey logo

spring-elastic-genie's Introduction

Build Status

spring-elastic-genie

Intro

This project will showcase how to use Elasticsearch and Kibana with Spring Boot. You can add movies fetched from OMDB to your PostgreSQL database through a simple CRUD REST interface, which will in turn be indexed by Elasticsearch. Once indexed, you can visualize your data with Kibana.

Config

In order to configure this app you should look at:

  • core.env.dist and create a core.env file with those variables (used by docker-compose etc.)
  • application.properties contains all the bindings for the defined ENV variables for the DB and Elasticsearch.
  • /logstash/config-dir/ contains all the standard configs from Logstash with a custom logstash.conf, which has the DB credentials etc. and drivers/ contains the pgjdbc driver needed to connect to PostgreSQL

Logstash Disclaimer: currently Logstash is only configured to get data from PostgreSQL with a simple SQL query but it does not have filters for duplicates etc. There are numerous Logstash tutorials you can follow to filter your data.

Local build with gradle

./gradlew build && java -jar build/libs/spring-elastic-genie-0.0.1.jar

Docker build

./gradlew build
docker-compose build
docker-compose up

Using the API

Here is how you can use the app. This POST request will send a search query to OMDB's API and save the movies in your local PostgreSQL DB, which can in turn be indexed by Elasticsearch.

curl -X POST \
  http://localhost:8080/movie/add \
  -H 'Content-Type: application/json' \
  -d '{
    "search": "Rush Hour 3"
}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.