Protobuf Serialization in Akka

Knoldus Blogs

Before Protobuf, lets have a look at what role does serialization play in Akka.

The messages that Akka actors send to each other are JVM objects (e.g. instances of Scala case classes). Message passing between actors that live on the same JVM is straightforward. It is simply done via reference passing. However, messages that have to escape the JVM to reach an actor running on a different host have to undergo some form of serialization (i.e. the objects have to be converted to and from byte arrays).

Akka itself uses Protocol Buffers to serialize internal messages (i.e. cluster gossip messages).

However, the serialization mechanism in Akka allows you to write custom serializers and to define which serializer to use for what.

But why should we really use this Protobuf Serialization?

As we all know, Java serialization is the default in Akka which is pretty bad for us because of theā€¦

View original post 792 more words


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s