On Wed, Feb 21, 2018 at 7:18 PM, Alan Burlison <alan.burli...@gmail.com>
wrote:

> On 21/02/18 15:52, Konrad “ktoso” Malawski wrote:
>
> You’re attempting to send a function.
>>
>> remote ! Identify  <<< Identify here is wrong
>>
>> Note that it is a case class, that takes a parameter:
>>
>> final case class Identify(messageId: Any)
>>
>> remote ! Identify(“hello”)
>>
>> should work just fine.
>>
>
> Ahah, my assessment of my stupidity was spot on, thanks ;-)
>
> I had also tried:
>
>     remote ! Identify(remote)
>
> but that didn't work either, following your hint:
>
>     remote ! Identity(remote.toSerializationFormat)
>
> also works. Is there a list anywhere of what Akka/Scala types have default
> protobuf serializers?
>

Search for serialization-bindings in reference.conf, which you find here:
https://doc.akka.io/docs/akka/current/general/configuration.html#listing-of-the-reference-configuration


>
> On a related note, I enabled "akka.actor.serialize-creators" but that
> triggered:
>
> [WARN] [SECURITY][02/21/2018 18:01:29.021] [main]
> [DisabledJavaSerializer(akka://RITA)] Outgoing message attempted to use
> Java Serialization even though `akka.actor.allow-java-serialization =
> off` was set! Message type was: [class java.lang.Class]
>
> which isn't exactly helpful in identifying the error. I suspect it's cause
> by the companion object Props creator pattern that's recommended in the
> docs, e.g.
>
>     object Controller {
>       def props = Props(new Controller)
>     }
>
> If I use the
>
>     system.actorOf(Props(classOf[MyActor], arg1, arg2))
>
> alternative I get a slightly different error:
>
> [WARN] [SECURITY][02/21/2018 18:16:18.205] [main]
>> [DisabledJavaSerializer(akka://RITA)] Outgoing message attempted to use
>> Java Serialization even though `akka.actor.allow-java-serialization =
>> off` was set! Message type was: [class akka.actor.ActorSelection$$anon$1]
>>
>
> Doesn't this mean that "akka.actor.serialize-creators" is pretty much
> useless in practice?


Serailization of Props and its parameters are only needed for the remote
deployment feature and that is something that we in general don't encourage
(so much anymore).

akka.actor.serialize-creators = on and akka.actor.serialize-messages = on
are testing facilities that are a bit too blunt in practice, since there
are typically many messages and Props that are only intended to be used
locally and doesn't have to be serializable. Even though Akka actors have
location transparency as one of its core traits you typically design your
system with local and possibly remote actors in mind.

That said, if you anyway want to use these testing tools anyway you have to
provide serializers for everything or mark things
with NoSerializationVerificationNeeded.

/Patrik


>
>
> --
> Alan Burlison
> --
>
> --
>
>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>>      Check the FAQ: http://doc.akka.io/docs/akka/c
>>>>>>>>>>> urrent/additional/faq.html
>>>>>>>>>>>      Search the archives: https://groups.google.com/grou
>>>>>>>>>>> p/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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to