When looking into the source code, I have a few questions:

- Does the following instruction indicate that the serialization mechanism 
is simply changed from java serializable to protobuf?

- When creating a new serializer, it seems that mediator is also needed. 
Wouldn't it be duplicated? Or we only need to add the new (ProxyReliable) 
message type to existing DistributedPubSubMessageSerializer.scala and 
modify DistributedPubSubMediator? Or any brief instruction about the flow 
(a bit lost in the source code). 

Thanks 


On Thursday, 20 March 2014 17:07:55 UTC+8, Patrik Nordwall wrote:
>
>
>
>
> On Thu, Mar 20, 2014 at 8:46 AM, lee json <[email protected]<javascript:>
> > wrote:
>
>> Yes. Can you please tell me how to do that for messages in ReliableProxy? 
>> I would like to make contribution. 
>>
>
> Great.
>
>    1. Create a protobuf representation of ReliableProxy.Message, 
>    see Send in 
>    akka-contrib/src/main/protobuf/DistributedPubSubMessages.proto
>    
>    2. Create a seraializer, 
>    see sendToProto and sendFromBinary in 
>    
> akka-contrib/src/main/scala/akka/contrib/pattern/protobuf/DistributedPubSubMessageSerializer.scala
>    Serialize actor ref as described here: 
>    
> http://doc.akka.io/docs/akka/2.3.0/scala/serialization.html#Serializing_ActorRefs
>    
>    3. Add serializer to akka-contrib/src/main/resources/reference.conf
>
> Bonus points if you also make protobuf for ReliableProxy.Ack.
>
> Thank you for contributing.
>
> /Patrik
>
>  
>
>>
>> Thanks for help. 
>>
>>
>>
>> On Tuesday, 18 March 2014 17:17:26 UTC+8, Patrik Nordwall wrote:
>>
>>> Hi,
>>>
>>> That is because the original message is wrapped in a 
>>> ReliableProxy.Message, which only has java serialization. It would be a 
>>> great contribution to provide a serializer for ReliableProxy.Message that 
>>> use the configured serializer for the wrapped message. If you are up for 
>>> the job I can guide you how to do it.
>>>
>>> Cheers,
>>> Patrik
>>>
>>>
>>> On Tue, Mar 18, 2014 at 10:03 AM, lee json <[email protected]> wrote:
>>>
>>>> My custom serialization object with remoting works without a problem. 
>>>> The NotSerializableException is thrown when adding ReliableProxy. 
>>>>
>>>> val proxy = context.system.actorOf(Props(classOf[ReliableProxy], 
>>>> remoteRef, 100.millis), "proxy") 
>>>> // remoteRef ! customSerializedObject // <- this works fine, remote 
>>>> can receive the message correctly. 
>>>> proxy ! customSerializedObject // <- this throws 
>>>> NotSerializableException.
>>>>
>>>> From the stack trace, it looks like inside the FSM, it can't select the 
>>>> correct serializer ( it always selects JavaSerializer ) in ReliableProxy 
>>>> class. Is there any work around or what might be the root cause for this 
>>>> issue? 
>>>>
>>>> akka version is 2.2.3 
>>>> java version is 1.6.x
>>>> scala is 2.10.x
>>>>
>>>> Thanks
>>>>  
>>>> Transient association error (association remains live)
>>>> java.io.NotSerializableException: sample.model.CustomSerializedObject
>>>> at java.io.ObjectOutputStream.writeObject0(
>>>> ObjectOutputStream.java:1164)
>>>>  at java.io.ObjectOutputStream.defaultWriteFields(
>>>> ObjectOutputStream.java:1518)
>>>>  at java.io.ObjectOutputStream.writeSerialData(
>>>> ObjectOutputStream.java:1483)
>>>> at java.io.ObjectOutputStream.writeOrdinaryObject(
>>>> ObjectOutputStream.java:1400)
>>>>  at java.io.ObjectOutputStream.writeObject0(
>>>> ObjectOutputStream.java:1158)
>>>> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
>>>>  at akka.serialization.JavaSerializer$$anonfun$toBinary$1.apply$mcV$sp(
>>>> Serializer.scala:129)
>>>> at akka.serialization.JavaSerializer$$anonfun$
>>>> toBinary$1.apply(Serializer.scala:129)
>>>>  at akka.serialization.JavaSerializer$$anonfun$
>>>> toBinary$1.apply(Serializer.scala:129)
>>>> at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
>>>>  at akka.serialization.JavaSerializer.toBinary(Serializer.scala:129)
>>>> at akka.remote.MessageSerializer$.serialize(MessageSerializer.scala:36)
>>>>  at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$
>>>> serializeMessage$1.apply(Endpoint.scala:672)
>>>> at akka.remote.EndpointWriter$$anonfun$akka$remote$EndpointWriter$$
>>>> serializeMessage$1.apply(Endpoint.scala:672)
>>>>  at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
>>>> at akka.remote.EndpointWriter.akka$remote$EndpointWriter$$
>>>> serializeMessage(Endpoint.scala:671)
>>>>  at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(
>>>> Endpoint.scala:559)
>>>> at akka.remote.EndpointWriter$$anonfun$7.applyOrElse(
>>>> Endpoint.scala:544)
>>>>  at scala.runtime.AbstractPartialFunction.apply(
>>>> AbstractPartialFunction.scala:33)
>>>> at akka.actor.FSM$class.processEvent(FSM.scala:595)
>>>>  at akka.remote.EndpointWriter.processEvent(Endpoint.scala:443)
>>>> at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:589)
>>>>  at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:583)
>>>> at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
>>>>  at akka.actor.ActorCell.invoke(ActorCell.scala:456)
>>>> at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
>>>>  at akka.dispatch.Mailbox.run(Mailbox.scala:219)
>>>> at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(
>>>> AbstractDispatcher.scala:386)
>>>>  at scala.concurrent.forkjoin.ForkJoinTask.doExec(
>>>> ForkJoinTask.java:260)
>>>> at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.
>>>> runTask(ForkJoinPool.java:1339)
>>>>  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(
>>>> ForkJoinPool.java:1979)
>>>> at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
>>>> ForkJoinWorkerThread.java:107)
>>>>
>>>>  -- 
>>>> >>>>>>>>>> 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 http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>>
>>> Patrik Nordwall
>>> Typesafe <http://typesafe.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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to