GitXplorerGitXplorer
h

ujug2017

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
404eace89ee8bdce95f5d35df0851c131136b0da

Updated the README with some info.

hhenrikengstrom committed 7 years ago
Unverified
19ec71974c216d58c5d173d43cf3a3eba7e3a346

Slides for presentation.

hhenrikengstrom committed 7 years ago
Unverified
ed20ce9574c0905cd66ef6ce7e735640a7fdccc5

Misc improvments, clean up, etc.

hhenrikengstrom committed 7 years ago
Unverified
adb139c73cd747bac76fae766541a5e28a5fb7a5

Initial version of UJUG source code.

hhenrikengstrom committed 7 years ago
Unverified
b4828f61c808c66699c9e8509800a517fd8bb97f

Initial commit

committed 7 years ago

README

The README file for this repository.

ujug2017

Source code and slides for Utah JUG presentation.

The intention of the source code and slides is to show some part of Akka Actors and Streams.

It also showcases the power of the Akka Streams API and how it can be used to simplify a lot of logic that you have to hand craft when using Akka Actors.

The demo code

This demo uses a naive implementation of two services: A and B. Both services are implemented with Akka Http. A consumes data from B utilizing HTTP calls.

To run

To drive the different scenarios you should always have Service B running. There is no need to restart it, as its business logic remains the same throughout the demo.

Run Service B

Open up a Terminal window:

> sbt
> run

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 4

[info] Running sample.service_b.Main
Server online at http://localhost:8081/
Press RETURN to stop...

Run demo 0 - plain vanilla Akka app

Run in a Terminal:

> sbt
> run 0
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 2

[info] Running sample.service_a.ActorMain 0
Server online at http://localhost:8080/
Press RETURN to stop...

Run demo 1 - batch the calls

Run in a Terminal:

> sbt
> run 1
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 2

[info] Running sample.service_a.ActorMain 0
Server online at http://localhost:8080/
Press RETURN to stop...

Run demo 2 - batch and schedule

Run in a Terminal:

> sbt
> run 2
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 2

[info] Running sample.service_a.ActorMain 0
Server online at http://localhost:8080/
Press RETURN to stop...

Run demo 3 - limit in-flight calls

Run in a Terminal:

> sbt
> run 3
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 2

[info] Running sample.service_a.ActorMain 0
Server online at http://localhost:8080/
Press RETURN to stop...

Run the Akka Streams implementation

Run in a Terminal:

> sbt
> run
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] example.RSExample1
 [2] sample.service_a.ActorMain
 [3] sample.service_a.StreamMain
 [4] sample.service_b.Main

Enter number: 3

[info] Running sample.service_a.StreamMain
Server online at http://localhost:8080/
Press RETURN to stop...

Credits and insiration

Make sure to check out Colin Breck's awesome blog post about Akka Streams.

Thanks to my colleagues for your help with all my silly questions:

  • Johan Andrén
  • Björn Antonsson
  • Konrad Malawski
  • Peter Vlugter