GithubHelp home page GithubHelp logo

write2munish / akka-essentials Goto Github PK

View Code? Open in Web Editor NEW
710.0 114.0 374.0 465 KB

Java/Scala Examples from the book - Akka Essentials

Home Page: http://akka-essentials.blogspot.com

Java 65.12% Scala 34.68% HTML 0.20%
actors java scala testkit remote-actors akka supervisor

akka-essentials's Introduction

Akka Essentials (refer http://akka-essentials.blogspot.com/ for more details)

Build Status

You will find examples of Akka in Java & Scala, talking of one concept along with a problem solved

ClientServerExample : This example demonstrates how the remote actors works in a client / server mode. The client sends the message to the server and server replies back to the client. The example also demonstrates various methods of creating remote actor references on the client side.

LoadGeneratorExample : This example generates 10 million messages and calculates the time it takes to process them. The program demonstrated the Routing concept where a roundrobinrouter is used to distribute the load on to a set of workers

WordCountMapReduce : This examples implements the Word Count Map Reduce model. The client system reads a text file and sends each line of text as a message to the Server. The server reads the line, maps the words, reduces the words and finally does an inmemory aggregation of the result. The example also implemented a prioritymailbox, which is used to segregate the message requests between the mapreduce requests and getting the list of results from the aggregate actor

GridPatternExample : Grid Computing pattern is where a control node distributes the work to other nodes. Idea is to make use of the nodes on the network for their computing power. It is analogous to Master Slave Pattern with certain differences. The idea behind the Master Slave pattern is to partition the work into identical sub tasks which are then delegated to Slaves. The example demonstrates how an WorkerActor system sends a request for registration. The RegisterRemoteWorker recieves the request and forwards the same to JobController where the RoundRobinRouter is updated for the new worker information. The WorkScheduler sends a periodic request to JobController, who then sends packets to all the registered worker actors.

AkkaSerializableExample : Akka by default supports 2 serializer options - java and protobuf. In addition, Akka provides an API to write you owns serializable. In this example, i have used google gson library to convert your value object into json string representation which is then converted to bytes and transported across the wire

AkkaSupervisorExample : Akka provides two supervisor strategies - One-For-One or All-For-One that are used to monitor the actors and build the fault tolerance in the actor model. There are 3 examples that demonstrate the strategies and their usage. In addition, the java section has unit testing code also for testing your supervisor code

AkkaWithZeroMQ - Akka provides native support for ZeroMQ libraries and provide different connectors (Pub-Sub, Req-Rep,Router-Dealer and Pull-Push). There are four examples that demonstrated their usage

AkkaUnitTest : Unit testing toolkit is provided via TestKit in Akka. The scala side of unit testing is well covered. For java, TestKit provides limited constructs. The various examples implemented by Ray Roestenburg have ported to Java world, with couple of more scenario's added. This can be good starting point for Java programmers to start unit testing their actors

AkkaPersistentExample : Akka provides persistent model for stateful actors. The example uses a simple example of Integer (which carries the ) and operations (ADD, SUBTRACT, MULTIPLY, DIVIDE) along with operand acts on the state object

akka-essentials's People

Contributors

linkerlin avatar write2munish avatar

Stargazers

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

akka-essentials's Issues

Akka configuration file is not attached in jar file

application.conf is not attached in jar file. GridPattern project is throwing following exception

Exception in thread "main" com.typesafe.config.ConfigException$Missing: No configuration setting found for key ....

This happens because default maven directory layout takes resources from src/main/resources and these projects are using src/resource directory.

To fix this issue add following code into pom.xml

 <build>
    <resources>
     <resource>
         <directory>src/resource</directory>
     </resource>
    </resources>
</build>

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.