1

I was following the akka-in-action code-base remoting (https://github.com/RayRoestenburg/akka-in-action/tree/master/chapter-remoting). In the example, it explains remoting with sender actor and a receiver actor. Both the actors are started separately (via separate Main) and they are able to communicate as explained (Note:- both the actors are part of same code base).

I wanted to see how it behaves if the sender actor is part of a different project(independent code base). I created a Play web-app which sends a message to the above mentioned receiver actor upon getting a POST call thru some rest client (I used Postman).

What I observed is that, even though the message sent (a Case Class) is available in both the sender and receiver code base, the receiver complains a class not found error (its not able to understand the Case Class object that I sent from sender)

Is it an expected behavior that, if remoting has to work, the distributed actors should share same code-base?

Anand
  • 601
  • 2
  • 7
  • 17
  • I got an update from Ray that if the codebase is different, the normal java serialization does not suffice. We need to use some other serialization (ex: Kryo or Chill ) – Anand Jul 19 '16 at 06:23
  • Question: Could your Case Objects be in a third (single) code base (library) somehow? I mean you have to define them once anyways. Perhaps just importing THAT library into both ends of the project will solve the problem more gracefully? – Techmag Jul 22 '16 at 19:23
  • This is a good idea but not sure if thats possible, lets see if some one can throw some light on that – Anand Jul 27 '16 at 03:44

1 Answers1

1

Moving to Kryo/Chill will partially solve your problem, as long as you use the same exact version of Akka underneath. These binary serialization formats are inherently fragile. Avro does a better job at solving lifecycle issues of binary serialization; but alas, I have never seen Avro used as for serialization in Akka.

Jeffrey Aguilera
  • 1,284
  • 11
  • 8