Giter VIP home page Giter VIP logo

akka-persistence-example-with-protocol-buffers-serialization's Introduction

Akka Persistence example with Protocol Buffers serialization

Build Status

Build Status

Overview

This example uses ScalaPB in order to obtain case class support for Scala when generating code from *.proto files. ScalaPB uses the protoc-jar internally to compile your protocol buffer files.

Execute sbt run in order to run the Main application. The Calculator actor is used to persist events across runs using Event Sourcing. We define a custom serializer that makes use of the generated class' (from proto) serialization mechanisms to easily serialize and deserialize events.

The Main application fires events at the Calculator actor. Since Calculator actor is Persistent, it makes use of the Serializer (set up in application.conf) when reading and persistent events to/from the event journal.

We also have a test that exercises the Persistent Calculator Actor by sending it events, killing it and making sure it uses Event Sourcing to bring the Calculator up to the current state. You can use sbt test to run the test.

If you are using IntelliJ and want syntax highlighting, then make sure your directory setup looks like this: image

External Libraries

  • ScalaPB is used to generate Scala case classes from proto files. These case classes have the ability to convert to and from binary
  • Akka for its actor framework, persistence module and test kit

Warning: Make sure you have Python 2.7 installed (accessible via python) otherwise the protocol buffers compiler will give you errors and will not compile your project

akka-persistence-example-with-protocol-buffers-serialization's People

Contributors

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