Hi John,

There is no standard way to get hold of the ExtendedActorSystem outside of the 
ActorSystem, since it's not something that you should normally do.

Your serializer should get the extended actor system as an argument to its 
constructor. You can take a look at this Kryo serializer by romix.

B/

On 1 November 2014 at 08:47:48, John Stephen ([email protected]) wrote:

Hi Endre,

Thank you for the reply.
But my question is more - is there a standard way to obtain the reference for 
our extended actor system from outside the actor system ?

You can determine the ActorRef from the actor system and the serialized actor 
path.
We were trying to use the JavaSerializer form the Serialization extension to 
obtain the actor system but this does not work as the "currentSystem" property 
is thread local and is null for our customized serializer e.g.

ActorRef ref = 
JavaSerializer.currentSystem().value().provider().resolveActorRef(identifier);

We could try and provide this information via a static method but we were 
wondering if there is a standard way to provide this reference to the actor 
system to classes outside of the actor system ?

Thanks
John


On Wednesday, 29 October 2014 10:25:27 UTC, Akka Team wrote:
Hi John,

The main problem with serializing ActorRefs directly is that they contain a 
unique identifier that identifies a current inhabitant of the corresponding 
actor path (see 
http://doc.akka.io/docs/akka/2.3.6/scala/actors.html#Actor_Lifecycle). Once the 
system is restarted and starts to replay the stored events the old UIDs will 
not match with the newly created actors. If you need to serialize references to 
certain actors you must serialize their path (ActorPath) and create an 
ActorSelection from them when you deserialize. Unfortunately you will need to 
resolve the ActorSelection with an Identify message to get the current ActorRef 
back, but there is no other way to do it. Of course this also relies on certain 
actors existing at a given path -- you might want to create them if they don't, 
but this depends on your use case.

-Endre

On Tue, Oct 28, 2014 at 4:48 PM, John Stephen <[email protected]> wrote:
Hi,

We are using Java, sharding and Akka persistence for our application
We have decided to use json serialisation of our objects / classes to resolve 
sharding serialisation issues that we encountered in the cloud.
We are now trying to get Akka persistence to work by storing the journal in 
DynamoDB.
We are using Jackson to perform the json serialisation.

The serialisation does not seem to be a problem. We can store it in DynamoDB as 
a string (so that we can view it manually).
But we have hit a problem when deserialising / replaying the journal items.
The classes have an actor reference that needs to be instantiated.
We tried to get access to the ExtendedActorSystem by calling 
"JavaSerializer.currentSystem().value()" but this is returning a null pointer 
(see snippet of code below) 

      ActorRef deserializedActorRef = 
JavaSerializer.currentSystem().value().provider().resolveActorRef(identifier);

Does anybody know how to get access to the ExtendedActorSystem from a custom 
serialiser ?
Or another way of resolving this problem ?

Thanks

John 

Notice:  This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message may 
not necessarily reflect the opinions and views of the members of the Ocado 
Group.

If you are not the intended recipient, please notify us immediately and delete 
all copies of this message. Please note that it is your responsibility to scan 
this message for viruses. 

References to the “Ocado Group” are to Ocado Group plc (registered in England 
and Wales with number 7098618) and its subsidiary undertakings (as that 
expression is defined in the Companies Act 2006) from time to time.  The 
registered office of Ocado Group plc is Titan Court, 3 Bishops Square, Hatfield 
Business Park, Hatfield, Herts. AL10 9NE.

--
>>>>>>>>>> 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.



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

Notice:  This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message may 
not necessarily reflect the opinions and views of the members of the Ocado 
Group.

If you are not the intended recipient, please notify us immediately and delete 
all copies of this message. Please note that it is your responsibility to scan 
this message for viruses. 

References to the “Ocado Group” are to Ocado Group plc (registered in England 
and Wales with number 7098618) and its subsidiary undertakings (as that 
expression is defined in the Companies Act 2006) from time to time.  The 
registered office of Ocado Group plc is Titan Court, 3 Bishops Square, Hatfield 
Business Park, Hatfield, Herts. AL10 9NE.

--
>>>>>>>>>> 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.

-- 
Björn Antonsson
Typesafe – Reactive Apps on the JVM
twitter: @bantonsson

-- 
>>>>>>>>>>      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