This repository gathers Akka code examples coming from various websites and books. It also includes several build scripts (Ant files, bash scripts, batch files, Make scripts) for experimenting with Akka on a Windows machine. |
Ada, C++, COBOL, Dafny, Dart, Deno, Docker, Flix, Go, GraalVM, Haskell, Kafka, Kotlin, LLVM, Modula-2, Node.js, Rust, Scala 3, Spark, Spring, Standard ML, TruffleSqueak, WiX Toolset and Zig are other topics we are continuously investigating.
☛ Read the document "What is Akka?" from the Akka Guide for a quick overview of the Akka toolkit.
This project depends on the following external software for the Microsoft Windows platform:
- Git 2.47 (release notes)
- Scala 2.13 (requires Java 8+) (release notes)
- Temurin OpenJDK 17 LTS (release notes, bug fixes)
☛ Maven packages
We present the Maven package dependencies in documentPACKAGES.md
.
Optionally one may also install the following software:
- Apache Ant 1.10 (requires Java 8+) (release notes)
- Apache Maven 3.9 (requires Java 8+) (release notes)
- ConEmu 2023 (release notes)
- GNU Make 3.81
- Gradle 8.12 1 (requires Java 8+) (release notes)
- grpcurl 1.9 (release notes)
- sbt 1.10 (requires Java 8+) (release notes)
- Scala 3.3 LTS (release notes)
- Temurin OpenJDK 21 LTS 1 (release notes, Java 21 API)
- Visual Studio Code 1.96 (release notes)
🔎 Git for Windows provides a Bash emulation used to run
git
from the command line (as well as over 250 Unix commands likeawk
,diff
,file
,grep
,more
,mv
,rmdir
,sed
andwc
).
For instance our development environment looks as follows (January 2025) 2:
C:\opt\apache-ant\ ( 43 MB) C:\opt\apache-maven\ ( 10 MB) C:\opt\ConEmu\ ( 26 MB) C:\opt\Git\ (387 MB) C:\opt\gradle\ (144 MB) C:\opt\grpcurl\ ( 24 MB) C:\opt\jdk-temurin-17.0.13.11\ (304 MB) C:\opt\jdk-temurin-21.0.5_11\ (329 MB) C:\opt\make-3.81\ ( 2 MB) C:\opt\sbt\ (110 MB) C:\opt\scala-2.13.15\ ( 25 MB) C:\opt\scala3-3.3.5\ ( 38 MB) C:\opt\VSCode\ (341 MB)
☛ Installation policy
When possible we install software from a Zip archive rather than via a Windows installer. In our case we definedC:\opt\
as the installation directory for optional software tools (in reference to the/opt/
directory on Unix).
Directory structure ▴
This project is organized as follows:
bin\ alexandreesl-examples\{README.md, akka-stream-lab} akka\ (Git submodule) akka-concurrency\{README.md, Avionics, BadSharespearean, etc.} akka-cookbook\{README.md, HelloAkka, PriorityMailbox, etc.} akka-essentials\{README.md, FirstAkkaApplication, etc.} docs\ effective-akka\{README.md, ExtraPattern, etc.>} examples\{README.md, akka-quickstart-java, akka-quickstart-kotlin, ..} pekko-examples\{README.md, HelloWorld, etc.>} PACKAGES.md README.md RESOURCES.md setenv.bat
where
- directory
bin\
provides several utility batch files - directory
alexandreesl-examples\
contains Akka code examples from Alexandre's blog post. - directory
akka\
contains our fork of the akka/akka repository as a Github submodule. - directory
akka-concurrency\
contains Akka code examples from Wyatt's book. - directory
akka-cookbook\
contains Akka code examples from Ortiz's book. - directory
akka-essentials\
contains Akka code examples from Gupta's book. - directory
docs\
contains Akka related papers/articles. - directory
effective-akka\
contains Akka code examples from Allen's book. - directory
examples\
contains Akka examples grabbed from various websites (see fileexamples\README.md
). - directory
pekko-examples\
contains Akka code examples from the Pekko project. - file
PACKAGES.md
presents the Maven packages our projects depend on. - file
README.md
is the Markdown document for this page. - file
RESOURCES.md
is the Markdown document presenting external resources. - file
setenv.bat
is the batch command for setting up our environment.
setenv.bat
3
We execute command setenv.bat
once to setup our development environment; it makes external tools such as ant.bat
, git.exe
or sbt.bat
directly available from the command prompt.
> setenv Tool versions: javac 17.0.13, scalac 2.13.15, sbt 1.10.7, ant 1.10.15, gradle 8.12, mvn 3.9.9, grpcurl v1.9.2, make 3.81, git 2.47.1, diff 3.10, bash 5.2.37(1) > where ant git sbt C:\opt\apache-ant\bin\ant C:\opt\apache-ant\bin\ant.bat C:\opt\apache-ant\bin\ant.cmd C:\opt\Git\bin\git.exe C:\opt\Git\mingw64\bin\git.exe C:\opt\sbt\bin\sbt C:\opt\sbt\bin\sbt.bat
Command searchjars.bat
prints the list of all JAR files containing a specific class or method name among the locally available libraries. In the following example we search for occurrences of class NotUsed
:
> searchjars.bat NotUsed Warning: Search all directories (no option specified) Searching for class "NotUsed" in files "C:\opt\scala3-3.3.5\lib\*.jar" Searching for class "NotUsed" in files "C:\opt\scala-2.13.15\lib\*.jar" Searching for class "NotUsed" in files "C:\opt\jdk-temurin-17.0.13.11\lib\*.jar" Searching for class "NotUsed" in files "%USERPROFILE%\.ivy2\cache\*.jar" akka-actor_2.13-2.10.0.jar:akka/NotUsed$.class akka-actor_2.13-2.10.0.jar:akka/NotUsed.class Searching for class "NotUsed" in files "%USERPROFILE%\.m2\repository\*.jar" akka-actor_2.13-2.10.0.jar:akka/NotUsed$.class akka-actor_2.13-2.10.0.jar:akka/NotUsed.class akka-stream_2.13-2.10.0.jar:akka/stream/impl/PushNotUsed$.class akka-stream_2.13-2.10.0.jar:akka/stream/impl/PushNotUsed.class pekko-actor_2.13-1.0.3.jar:org/apache/pekko/NotUsed$.class pekko-actor_2.13-1.0.3.jar:org/apache/pekko/NotUsed.class
Footnotes ▴
[1] Gradle Support for Java ↩
-
a) Version 8.0.2 or newer is required for use with Scala 2.13 (see issue 23962).Gradle version Java version 8.11, 8.12 23 8.10 23 8.9 22 8.7, 8.8 22 8.4, 8.5, 8.6 21 8.3 20 7.6, 8.0 a), 8.1, 8.2 19 7.5 18 7.3 17 7.0 16 6.7 15 6.3 14 6.0 13
[2] Downloads ↩
- In our case we downloaded the following installation files (see section 1):
-
apache-ant-1.10.15-bin.zip ( 9 MB) apache-maven-3.9.9-bin.zip ( 10 MB) ConEmuPack.230724.7z ( 5 MB) gradle-8.12-bin.zip (130 MB) grpcurl_1.9.2_windows_x86_64.zip ( 6 MB) make-3.81-bin.zip ( 10 MB) OpenJDK17U-jdk_x64_windows_hotspot_17.0.13.11.zip (188 MB) OpenJDK21U-jdk_x64_windows_hotspot_21.0.5_11.zip (191 MB) PortableGit-2.47.1-64-bit.7z.exe ( 47 MB) sbt-1.10.7.zip ( 45 MB) scala-2.13.15.zip ( 21 MB) scala3-3.3.5-RC1.zip ( 34 MB) VSCode-win32-x64-1.96.2.zip (131 MB)
[3] setenv.bat
usage ↩
-
Batch file
setenv.bat
has specific environment variables set that enable us to use command-line developer tools more easily. - It is similar to the setup scripts described on the page "Visual Studio Developer Command Prompt and Developer PowerShell" of the Visual Studio online documentation.
-
For instance we can quickly check that the two scripts
Launch-VsDevShell.ps1
andVsDevCmd.bat
are indeed available in our Visual Studio 2019 installation :> where /r "C:\Program Files (x86)\Microsoft Visual Studio" *vsdev* C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\Launch-VsDevShell.ps1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\vsdevcmd_end.bat C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\vsdevcmd_start.bat
-
Concretely, in our GitHub projects which depend on Visual Studio (e.g.
michelou/cpp-examples
),setenv.bat
does invokeVsDevCmd.bat
(resp.vcvarall.bat
for older Visual Studio versions) to setup the Visual Studio tools on the command prompt.