Coder Social home page Coder Social logo

nashtech-labs / lagom-scala-sbt-standalone Goto Github PK

View Code? Open in Web Editor NEW
7.0 9.0 2.0 23 KB

A basic example of building a Lagom Scala project to run outside of the Lightbend Production Suite (aka ConductR).

License: Apache License 2.0

Scala 100.00%
scala lagom sbt devops

lagom-scala-sbt-standalone's Introduction

lagom-scala-sbt-standalone

A basic example of building a Lagom project (in Scala) to run outside of the Lightbend Production Suite (aka ConductR). This was initially created from the lagom-scala template (sbt new lagom/lagom-scala.g8), with the following changes:

  • Set lagomKafkaEnabled & lagomCassandraEnabled to false.
  • Added a static service location to hello-impl for cas_native (the Cassandra server).
  • Added a static service location to hello-stream-impl for Kafka service (unnamed).

To test this:

  1. Open a terminal and clone the repository to your workstation (git clone https://github.com/knoldus/lagom-scala-sbt-standalone.git)
  2. cd lagom-scala-sbt-standalone
  3. sbt to enter the sbt console
  4. project knol-impl to select knol-impl module.
  5. dist (from the sbt prompt) to create distribution package.
  6. Press control-C to exit sbt console.
  7. Start Cassandra Server - https://www.datastax.com/2012/01/getting-started-with-cassandra
  8. Start Kafka Server - https://kafka.apache.org/quickstart#quickstart_download
  9. cd lagom-scala-sbt-standalone/knol-impl/target/universal
  10. unzip knol-impl-0.1.0-SNAPSHOT.zip
  11. Set the following environment varaibles:
    1. export APP_LIB=knol-impl-0.1.0-SNAPSHOT/lib
    2. export APP_CLASSPATH=$APP_LIB/*
    3. export JAVA_OPTS=""
    4. export JMX_CONFIG=""
    5. export PLAY_SECRET=none
    6. export CONFIG_FILE=/path/to/lagom-scala-sbt-standalone/knol-impl/src/main/resources/application.conf
    7. export CONFIG="-Dplay.crypto.secret=$PLAY_SECRET -Dlagom.cluster.join-self=off -Dorg.xerial.snappy.use.systemlib=true -Dconfig.file=$CONFIG_FILE"
    8. export PLAY_SERVER_START="play.core.server.ProdServerStart"
  12. At last run the Lagom service - java -cp "$APP_CLASSPATH" $JAVA_OPTS $JMX_CONFIG $CONFIG $PLAY_SERVER_START

This runs each of the services as single-node clusters.

You can press control-C to exit the services.

lagom-scala-sbt-standalone's People

Contributors

gupta-himanshu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.