val shardRegion = ClusterSharding(context.system).start(
typeName = ShardName,
entityProps = ShardEntity.props(appConfig),
settings = ClusterShardingSettings(context.system),
extractEntityId = ShardEntity.idExtractor,
extractShardId = ShardEntity.shardResolver)
persist(Message(data)) { _ =>
// Is this the correct way to send
// persistent messages to shard region??
deliver(shardRegion.path) { deliveryId =>
MsgWithId(deliveryId, data)
}
}
--
>>>>>>>>>> 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+unsubscribe@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
Hmm. Where is the deliver() method coming from? Normally you send messages to sharded entities with the normal tell() method on the ShardRegion, same as any other Actor...
On Fri, Jan 20, 2017 at 9:39 AM, <dave....@threatstack.com> wrote:
Hi All,Im using cluster sharding and I also have a use case for AtLeastOnce guaranteed message delivery (which of course requires persistence). The problem is that the deliver() method is not actually sending my messages to the shard region. Here's some code for the shard region:val shardRegion = ClusterSharding(context.system).start(
typeName = ShardName,
entityProps = ShardEntity.props(appConfig),
settings = ClusterShardingSettings(context.system),
extractEntityId = ShardEntity.idExtractor,
extractShardId = ShardEntity.shardResolver)
Here's the delivery code:persist(Message(data)) { _ =>
// Is this the correct way to send
// persistent messages to shard region??
deliver(shardRegion.path) { deliveryId =>
MsgWithId(deliveryId, data)
}
}For some reason, the shard region entities never see the messages from the call to deliver(). Am I doing something wrong?
--
>>>>>>>>>> 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+...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.