Coder Social home page Coder Social logo

akka-quickstart-java.g8's Introduction

Akka Quickstart with Java

Quickstart guide

This example is described in the Akka Quickstart with Java guide

The Hello World example illustrates Akka basics. Within 30 minutes, you should be able to download and run the example and use this guide to understand how the example is constructed. This will get your feet wet, and hopefully inspire you to dive deeper into the wonderful sea of Akka!

Giter8 template

It can also be used as a Giter8 template for Akka with Java.

Prerequisites:

Open a console and run the following command to apply this template:

sbt new akka/akka-quickstart-java.g8

This template will prompt for the name of the project. Press Enter if the default values suit you.

Once inside the project folder, run the application with:

sbt run

This template also provides build descriptors for maven and gradle. You can use any of the following commands to run the application:

mvn compile exec:exec

or

gradle run

Template license

Written in 2017 by Lightbend, Inc.

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. This template is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/.

The Akka family of projects is managed by teams at Lightbend with help from the community.


License

Akka is licensed under the Business Source License 1.1, please see the Akka License FAQ.

akka-quickstart-java.g8's People

Contributors

2m avatar alewando avatar aludwiko avatar beritou avatar chbatey avatar corruptmemory avatar dependabot[bot] avatar eed3si9n avatar ennru avatar havocp avatar henrikengstrom avatar ignasi35 avatar jiminhsieh avatar johanandren avatar ktoso avatar martinandersson avatar octonato avatar patriknw avatar pravinbhat avatar raboof avatar rstento avatar sebastian-alfers avatar warry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akka-quickstart-java.g8's Issues

build.gradle uses mavenLocal repository

The build.gradle file in this project uses mavenLocal:

repositories {
    mavenLocal()
}

This means that the command gradle run will fail if you haven't already downloaded the necessary akka jars into your .m2 cache. The build.gradle file should use mavenCentral() instead.

attribute akka_version isn't defined

I am running this on a windows 7 machine. What am I doing wrong?

{ t }  » which sbt                                                                                                                                    /d/temp/t
/cygdrive/c/Program Files (x86)/sbt/bin/sbt
{ t }  » java -version                                                                                                                                /d/temp/t
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)


{ t }  » sbt new akka/akka-java-seed.g8                                                                                                               /d/temp/t
[info] Set current project to t (in build file:/D:/temp/t/)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Exiting due to error in the template
File: D:\dev\apps\.babun\cygwin\tmp\giter8-6791571998485\src\main\g8\project\Dependencies.scala, context [anonymous] 4:27 internal error: org.stringtemplate.v4.compiler.STException: context [anonymous] 4:27 attribute akka_version isn't defined
        at giter8.G8$STErrorHandler.runTimeError(g8.scala:110)
        at giter8.G8$STErrorHandler.runTimeError(g8.scala:105)
        at org.stringtemplate.v4.misc.ErrorManager.runTimeError(ErrorManager.java:133)
        at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:193)
        at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:145)
        at org.stringtemplate.v4.ST.write(ST.java:427)
        at org.stringtemplate.v4.ST.render(ST.java:497)
        at org.clapper.scalasti.ST.render(ST.scala:286)
        at giter8.G8$.applyTemplate(g8.scala:102)
        at giter8.G8$.write(g8.scala:154)
        at giter8.G8$.write(g8.scala:138)
        at giter8.G8$$anonfun$writeTemplates$2$$anonfun$apply$11.apply(g8.scala:396)
        at giter8.G8$$anonfun$writeTemplates$2$$anonfun$apply$11.apply(g8.scala:396)
        at scala.util.control.Exception$Catch$$anonfun$opt$1.apply(Exception.scala:118)
        at scala.util.control.Exception$Catch$$anonfun$opt$1.apply(Exception.scala:118)
        at scala.util.control.Exception$Catch.apply(Exception.scala:102)
        at scala.util.control.Exception$Catch.opt(Exception.scala:118)
        at giter8.G8$$anonfun$writeTemplates$2.apply(g8.scala:395)
        at giter8.G8$$anonfun$writeTemplates$2.apply(g8.scala:386)
        at scala.collection.immutable.Stream.foreach(Stream.scala:547)
        at giter8.G8$.writeTemplates(g8.scala:386)
        at giter8.G8$$anonfun$applyT$1.apply(g8.scala:256)
        at giter8.G8$$anonfun$applyT$1.apply(g8.scala:249)
        at scala.util.Either$RightProjection.flatMap(Either.scala:523)
        at giter8.G8$.applyT(g8.scala:249)
        at giter8.G8$.fromDirectory(g8.scala:62)
        at giter8.JgitHelper$$anonfun$run$2.apply(JgitHelper.scala:67)
        at giter8.JgitHelper$$anonfun$run$2.apply(JgitHelper.scala:66)
        at scala.util.Either$RightProjection.flatMap(Either.scala:523)
        at giter8.JgitHelper$.run(JgitHelper.scala:66)
        at giter8.JgitHelper$.run(JgitHelper.scala:78)
        at giter8.Giter8$$anonfun$2.apply(giter8.scala:34)
        at giter8.Giter8$$anonfun$2.apply(giter8.scala:33)
        at scala.Option.map(Option.scala:145)
        at giter8.Giter8.run(giter8.scala:33)
        at sbtgiter8resolver.Giter8TemplateResolver.run(Giter8TemplateResolver.scala:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sbt.TemplateCommandUtil$.call(TemplateCommand.scala:68)
        at sbt.TemplateCommandUtil$.sbt$TemplateCommandUtil$$runTemplate(TemplateCommand.scala:59)
        at sbt.TemplateCommandUtil$$anonfun$2.apply(TemplateCommand.scala:45)
        at sbt.TemplateCommandUtil$$anonfun$2.apply(TemplateCommand.scala:41)
        at scala.collection.LinearSeqOptimized$class.find(LinearSeqOptimized.scala:100)
        at scala.collection.immutable.List.find(List.scala:84)
        at sbt.TemplateCommandUtil$.sbt$TemplateCommandUtil$$run(TemplateCommand.scala:41)
        at sbt.TemplateCommandUtil$$anonfun$templateCommandParser$1.apply(TemplateCommand.scala:34)
        at sbt.TemplateCommandUtil$$anonfun$templateCommandParser$1.apply(TemplateCommand.scala:28)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$.process(Command.scala:93)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
        at sbt.State$$anon$1.process(State.scala:184)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:96)
        at sbt.MainLoop$.run(MainLoop.scala:89)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
        at sbt.MainLoop$.runLogged(MainLoop.scala:22)
        at sbt.StandardMain$.runManaged(Main.scala:57)
        at sbt.xMain.run(Main.scala:29)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)

The quickstart example is broken on Gradle 7

Following the instructions on this page:

https://developer.lightbend.com/guides/akka-quickstart-java/

Output of gradle run is:

FAILURE: Build failed with an exception.

* Where:
Build file '/mnt/c/Habib/hello-akka/build.gradle' line: 12

* What went wrong:
A problem occurred evaluating root project 'hello-akka'.
> Could not find method compile() for arguments [com.typesafe.akka:akka-actor-typed_2.13:2.6.14] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

Using Gradle 7.0 and Java 11.

Room for improvement:

  • Document supported versions of the environment (Gradle, Java)
  • Use Gradle wrapper
  • Make the build file minimal (remove the idea plugin, and more?)

Edit: Found that it does work on Gradle 6.9. So I have a feeling Akka doesn't work at all on Gradle 7?

Weird comments in Java files

Printer.java has this comment repeated six times:

//#printer-messages

What is this for? Greeter.java is similar.

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.