I would not encourage setting scala.Product or java.lang.Object as kryo serialized - pick specific classes (this is also for security reasons actually). Or create a marker type that you’d include in your messages that are to be serialized using kryo and use that.
Sure you can use Artery if you want to, read it’s docs about how to configure http://doc.akka.io/docs/akka/current/scala/remoting-artery.html PS: I’d recommend upgrading to 2.5.x, it’s fully binary compatible with 2.4.x so it will be very simple and it includes many new features and hardening updates in Artery specifically. — Konrad `kto.so` Malawski Akka <http://akka.io> @ Lightbend <http://lightbend.com> On 29 August 2017 at 01:31:55, Muthu Jayakumar ([email protected]) wrote: Hello there, I am building a micro-service that uses akka-cluster. I am running into an issue with serialization. I am using akka 2.4.16 and scala 2.11. These warnings have started to come when I switched from default java-serialization to kryo. I am using "com.github.romix.akka:akka-kryo-serialization_211:0.4.2" of akka-kryo and have added the following into the config... kryo { type = "graph" idstrategy = "default" resolve-subclasses = true kryo-custom-serializer-init = "com.wd.perf.scheduler.swh.utils.KryoInit" } serializers { akka-cluster = "akka.cluster.protobuf.ClusterMessageSerializer" java = "akka.serialization.JavaSerializer" kryo = "com.romix.akka.serialization.kryo.KryoSerializer" //proto = "akka.remote.serialization.ProtobufSerializer" } serialization-bindings { "akka.cluster.ClusterMessage" = akka-cluster //"akka.cluster.routing.ClusterRouterPool" = akka-cluster "java.io.Serializable" = none "java.lang.String" = kryo "java.lang.Boolean" = kryo //"com.google.protobuf.Message" = proto "scala.Product" = kryo "akka.actor.ActorRef" = kryo "scala.collection.immutable.TreeMap" = kryo "[Lscala.collection.immutable.TreeMap;" = kryo "scala.collection.mutable.HashMap" = kryo "[Lscala.collection.mutable.HashMap;" = kryo "scala.collection.immutable.HashMap" = kryo "[Lscala.collection.immutable.HashMap;" = kryo "scala.collection.mutable.AnyRefMap" = kryo "[Lscala.collection.mutable.AnyRefMap;" = kryo "scala.collection.immutable.LongMap" = kryo "[Lscala.collection.immutable.LongMap;" = kryo "scala.collection.mutable.LongMap" = kryo "[Lscala.collection.mutable.LongMap;" = kryo "scala.collection.immutable.HashSet" = kryo "[Lscala.collection.immutable.HashSet;" = kryo "scala.collection.immutable.TreeSet" = kryo "[Lscala.collection.immutable.TreeSet;" = kryo "scala.collection.immutable.BitSet" = kryo "[Lscala.collection.immutable.BitSet;" = kryo "scala.collection.mutable.HashSet" = kryo "[Lscala.collection.mutable.HashSet;" = kryo "scala.collection.mutable.TreeSet" = kryo "[Lscala.collection.mutable.TreeSet;" = kryo "scala.collection.mutable.BitSet" = kryo "[Lscala.collection.mutable.BitSet;" = kryo "scala.collection.immutable.Vector" = kryo "[Lscala.collection.immutable.Vector;" = kryo "[Ljava.lang.Object;" = kryo "[[I" = kryo } serialization-identifiers { "akka.cluster.protobuf.ClusterMessageSerializer" = 5 } I could only get it past errors to the following warnings, after I had added "akka-cluster" in the application.conf (which I copied from reference.conf of akka-cluster). [WARN] [SECURITY][08/28/2017 09:19:03.286] [sftp-scheduler-akka.remote.default-remote-dispatcher-14] [akka.serialization.Serialization(akka://sftp-scheduler)] Multiple serializers found for class akka.cluster.InternalClusterAction$InitJoin$, choosing first: Vector((interface scala.Product,com.romix.akka.serialization.kryo.KryoSerializer@40d4d844), (interface akka.cluster.ClusterMessage,akka.cluster.protobuf.ClusterMessageSerializer@36ccff98 )) [WARN] [SECURITY][08/28/2017 09:19:03.355] [sftp-scheduler-akka.remote.default-remote-dispatcher-15] [akka.serialization.Serialization(akka://sftp-scheduler)] Multiple serializers found for class akka.cluster.InternalClusterAction$Join, choosing first: Vector((interface scala.Product,com.romix.akka.serialization.kryo.KryoSerializer@40d4d844), (interface akka.cluster.ClusterMessage,akka.cluster.protobuf.ClusterMessageSerializer@36ccff98 )) [WARN] [SECURITY][08/28/2017 09:19:03.369] [sftp-scheduler-akka.remote.default-remote-dispatcher-15] [akka.serialization.Serialization(akka://sftp-scheduler)] Multiple serializers found for class akka.cluster.ClusterHeartbeatSender$HeartbeatRsp, choosing first: Vector((interface scala.Product,com.romix.akka.serialization.kryo.KryoSerializer@40d4d844), (interface akka.cluster.ClusterMessage,akka.cluster.protobuf.ClusterMessageSerializer@36ccff98 )) Also, I wonder if I may be able to use Remoting-Artery in-place of netty while using clustering? Please advice on what could be the next steps. Thanks, Muthu -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
