* It's mostly technical concern that is blurring the business logic in the entity
* Async interactions before stopping is often not needed
* Implemented with an internal PoisonPill signal that is added by sharding,
* Persistent actors handle PoisonPill and run side effects after persist
and process stashed messages before stopping.
* remove unecessary stop messages
* reference docs
* Makes the combination more visable
* You don't have to worry about the persistenceId, only EntityTypeKey and entityId
* The glue is stronger in the javadsl because of two reasons
* Couldn't realisticly create a PersistentEntity class extending PersistenBehavior (which
contains all the optional parameters and functions) since that would duplicate too much.
* The ActorContext would be needed in the ShardedEntityContext parameter and because of the
additional M type parameters the type inference breaks down when using the factory. Would
require specifying the type of the ShardedEntityContex[M] parameter. That problem doesn't
seem to exist in Java.
renamed:
s/ShardedEntityContext/EntityContext/
s/ShardedEntity/Entity/
* PersistenceId type to differentiate between persistenceId and entityId, #25703
* both entityId (for sharding) and persistenceId as String types was easy
mix-up
* utility method in EntityTypeKey to concatenaty the type and entityId to
a unique persistenceId
* support custom separator to enable compatilbility with Lagom's javadsl
* The replies didn't change after the leaving
* I see two reason why it could have failed
* The test is sending the same messages as the very first thing
earlier in the test and then sharding might not now about the
two nodes and therefore allocated all to one node
* All messages are hashed to the same node/shard
* to make it possible to use ActorContext.ask also with EntityRef
destinations
* this abstraction will probably be useful for other things, where a
full ActorRef is not required
* a RecipientRef only has to support tell (and ask), while a full ActorRef
is watchable (destination has a lifecycle) and location transparent (serializable)
* composition is the basic building block for ActorTestKit
* ActorTestKitWordSpec for integration with ScalaTest
(automatic shutdown)
* Use ActorTestKitWordSpec in our own tests
* doc TestException
Default is 5s which means if the first Read is lost and
a test ddata have any secondary nodes to query it'll
timeout waiting to get the state.
E.g. read being ignored due to loading durable state then
never gets retries
The test failed as the Register message is ignored the first time and
the timeout (3s) doesn't give much time for further retries.
Reduce the retry interval rahter than incrase the timeout.
timeout is explicitly a message of Command
persitAll and chainable side effects work well
more tests pasing
additional sanity check that mutable behaviors work as expected
unstashing needs to "loop through" the AdapterActor otherwise Stopped
won't work
solve unstashing/stop issue, by not randomly init()ing, but unstashing
snapshotting works
all tests green
rebased
nicer log source
remove IncomingCommand wrapper, we dont need it
no need for shared counter
remove not needed methods and state
more state cleanup, using Behaviors.same
reminder that we DO need that same alias, since stash does not work with
the Behavior.same
introduce config for stash buffer
stopping now works after persisting
compile fix
cleanup
reduced number of adapter styles needed for co-existence of persistence
final cleanup done, less passing around 40 objects, carriers provided
now
* Java specific testkit
* Separate all the APIs
* Dilate the default timeouts
* TestKit -> ActorTestKit to be consistent with BehaviorTestKit
* Only have stuff in packages expected for this module
* Auto testkit-system-naming that works (verified)
* Separate actually working apis for manual timer
* More docs
* Separate apis for BehaviorTestKit effects
* Moved the example tests into the testkit, added samples for JUnit/ScalaTest
* TestKitJunitResource: No need to explicitly provide class, also overload for just custom config
* fail fast if Typed Cluster.sharding.spawn is called several times with different parameters
* fix a bug in ClusterShardingImpl.spawnWithMessageExtractor - actually use allocationStrategy param