Coder Social home page Coder Social logo

spring-boot-cassandra-restful's Introduction

Spring Boot - Cassandra

Its sample project with Spring Boot and Cassandra and uses RestFul services

Easy Way to install Cassandra

Cassandra Install

Cassandra Configuration

In application.properties, you can change 'keyspace' for your configuration.

In the application keyspace name uses 'myks'.

After Cassandra installation, create a new keyspace and create a new table in Cassandra with following commands.

CREATE KEYSPACE myks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };

CREATE TABLE myks.user (id TimeUUID PRIMARY KEY, name text, surname text, age int);
	CREATE INDEX usernameindex ON myks.user (name);
	CREATE INDEX usersurnameindex ON myks.user (surname);
	CREATE INDEX userageindex ON myks.user (age);
How To Run Project

The project is a spring boot project. For this reason, you can run the Application class by running it.

Application starts normally and inserts one data at user table.

http:127.0.0.1:8080/user

GET, POST, PUT, DELETE operations can be done with restful services.

License

The MIT License (MIT) Copyright (c) 2017 Fatih Totrakanlı

spring-boot-cassandra-restful's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-boot-cassandra-restful's Issues

How to change cassandra contact point?

Thank you for the great getting started repo for spring boot Cassandra.

I am using this repo as my getting started API development. The repository works perfectly fine on a local environment. I have a docker cassandra container running locally and it connects with spring boot application on start up.

I dockerize this springboot application and I am trying to connect cassandra docker with springboot using --link argument of docker. However, the springboot application cannot connect to cassandra because it cannot find the localhost. I tried searching for Cassandra contact point host variable but I can't find it within the springboot application.

Can you help me to find cassandra contact point so I can update that variable by passing it's value as environment variable?
Thank you

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.