Giter Club home page Giter Club logo

datastax-astra-db-spring-boot-app's Introduction

Spring Data Cassandra + DataStax Astra DB

  • SignUp / SignIn in Datastax Astra to get your DB for free
  • Create datastax_astra_db_spring_boot_app_database database with datastax_astra_db_spring_boot_app_keyspace keyspace
  • Click connect on your database
  • Chose Java in Connect using a driver section
  • Click Download Bundle button and save zip archive as src/main/resources/secure-connect-datastax-astra-db-spring-boot-app-database.zip
  • Create token for Administrator User, grab your ClientID and ClisentSecret
  • Add src/main/resources/application-datastax.properties file with content:
    datastax.astra.secure-connect-bundle=/path/to/project/src/main/resources/secure-connect-datastax-astra-db-spring-boot-app-database.zip
    datastax.astra.client-id=$yourClientID
    datastax.astra.client-secret=$yourClientSecret
    datastax.astra.keyspace=datastax_astra_db_spring_boot_app_keyspace
  • Add dependency to your pom.xml file:
    <dependency>
      <groupId>com.datastax.oss</groupId>
      <artifactId>java-driver-core</artifactId>
      <version>4.13.0</version>
    </dependency>
  • Run app:
    mvn compile spring-boot:run
  • Post few messages and load them via rest api
    http :8080/api/v1/messages content=Hello,\ World\!
    http :8080/api/v1/messages content=Hello,\ again...
    http :8080/api/v1/messages
  • Done

RTFM

datastax-astra-db-spring-boot-app's People

Watchers

 avatar  avatar  avatar

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.