On an interesting note, it seems that if I send my actor processor a
regular non-Persistant wrapped message and then I have the actor wrap the
message in a Persistent object and send it to itself, it works! The problem
then appears to be when another actor trie to send it a Persistent message.
Here are some additional details about my setup:
// Setup
ClusterSharding.get(system).start("Streams",
StreamSupervisor.props(),
new MessageExtractor());
//Sending Persistent message
ActorRef region = ClusterSharding.get(system).shardRegion("Streams");
region.tell(new ShardMessage(Persistent.create(props), id), self());
//MessageExtractor returns the first arg of a ShardMessage as the
entryMessage
public class MessageExtractor implements ShardRegion.MessageExtractor {
...
@Override
public Object entryMessage(Object message) {
if (message instanceof ShardMessage) {
return ((ShardMessage) message).getMessage();
} else {
return message;
}
}
...
}
//StreamSupervisor
public class StreamSupervisor extends UntypedProcessor {
...
public static Props props() {
return Props.create(StreamSupervisor.class);
}
@Override
public void onReceive(Object message) {
if (message instanceof Persistent) {
onMessage((Persistent) message);
}
}
public void onMessage(Persistent message) {
Object payload = message.payload();
if (payload instanceof Props) {
props = (Props) payload;
// do stuff
}
}
...
}
--
>>>>>>>>>> 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.