Commit graph

64 commits

Author SHA1 Message Date
Johan Andrén
f66ee1cbe8
Handle lost typed receptionist removals #24887
Keep track of removed actors and re-remove them when ORMultiMap conflict has reintroduced them
2018-11-09 10:58:18 +01:00
Patrik Nordwall
42adfd781c
Merge pull request #25801 from akka/wip-25794-ClusterShardingSpec-patriknw
Hardening of typed./ClusterShardingSpec, #25794
2018-11-09 09:53:14 +01:00
Patrik Nordwall
4d115f19a6 rename ClusterSharding start to init, #25711 (#25867)
* rename ClusterSharding start to init, #25711

* fix test
2018-11-06 19:43:55 +01:00
Patrik Nordwall
9c1153b1a6 Make the stop message in sharding optional, #25642
* 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
2018-11-06 19:43:55 +01:00
Johan Andrén
133c41375f Automatic passivation for typed sharding, #25512 2018-11-06 19:15:23 +01:00
Patrik Nordwall
3ccc67b3d6
Merge pull request #25812 from akka/wip-25706-thenRun-patriknw
align Effect API between scaladsl and javadsl, #25706
2018-11-06 16:09:39 +01:00
Patrik Nordwall
a948f5572b align Effect API between scaladsl and javadsl, #25706
scaladsl:
* stop => stop()
* andThenStop() => thenStop()

javadsl:
* andThen => thenRun
2018-11-06 15:02:08 +01:00
Arnout Engelen
7bbac405c3 Widen timeout waiting for sharding to initialize (#25752) (#25856) 2018-11-05 14:15:49 +01:00
kerr
fafc59b19d update headers to regular comment (#25807) 2018-10-29 05:19:37 -04:00
Patrik Nordwall
2672bd7a95 PersistentEntity to glue together Sharding and PersistentBehavior better
* 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/
2018-10-18 11:47:51 +02:00
Patrik Nordwall
1691961a10
AccountExample in Scala in a few flavors, #25485
* AccountExample in Scala in a few flavors
* include Account examples in reference docs
* cleanup BlogPost example
* include reply doc snippets
2018-10-18 11:37:06 +02:00
Patrik Nordwall
81c7adf4a1 thenReply Effect, #25482
* enforce ReplyEffect
2018-10-17 14:02:16 +02:00
Patrik Nordwall
4131036a12
PersistenceId type to differentiate between persistenceId and entityId, #25703 (#25704)
* 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
2018-10-17 13:53:50 +02:00
Patrik Nordwall
baf14589d2 Hardening of typed./ClusterShardingSpec, #25794
* 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
2018-10-17 12:09:52 +02:00
Patrik Nordwall
d9af08757e rename PersistentBehaviors.receive to PersistentBehavior.apply 2018-10-09 13:47:22 +02:00
Patrik Nordwall
f2ad055c77 Improve AskTimeoutException message, #25644 2018-09-26 08:00:11 +02:00
Patrik Nordwall
824e4196e7 Introduce RecipientRef interface for ActorRef and EntityRef, #24463
* 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)
2018-09-21 14:39:18 +02:00
Patrik Nordwall
6d8d646fe5
Merge pull request #25539 from akka/wip-25480-sharding-start-patriknw
Simplify signature of ClusterSharding.spawn, #25480
2018-09-21 14:21:33 +02:00
Johan Andrén
a8cfe1e0ff
Merge pull request #25654 from johanandren/wip-25620-remove-typed-persistence-ctx-param-johanandren
Remove the ActorContext parameter from the scaladsl command handler
2018-09-21 13:51:09 +02:00
Johan Andrén
10fc413238 Some usages of the removed signatures 2018-09-21 10:34:41 +02:00
Patrik Nordwall
0804daf1a5 Simplify signature of ClusterSharding.spawn, #25480 2018-09-20 11:11:33 +02:00
Patrik Nordwall
0f56a6d1ed Passivate for Typed Sharding, #24478
* also moved singleton doc sample to own file
* and mv /doc/ to /docs/ as in other places
2018-09-20 11:04:32 +02:00
Patrik Nordwall
82bcbb68d2
Merge pull request #25572 from akka/wip-25481-EntityRef-scheduler-patriknw
Remove Scheduler param in EntityRef.ask, #25481
2018-09-18 19:48:59 +02:00
Christopher Batey
1d0603dab9 make scalatest suite type agnostic 2018-09-17 17:54:54 +02:00
Patrik Nordwall
b16e4d5e4d ActorTestKit overhaul, #24598
* composition is the basic building block for ActorTestKit
* ActorTestKitWordSpec for integration with ScalaTest
  (automatic shutdown)

* Use ActorTestKitWordSpec in our own tests

* doc TestException
2018-09-17 17:00:15 +02:00
Patrik Nordwall
64fa8f5ccd Remove Scheduler param in EntityRef.ask, #25481 2018-09-06 09:52:25 +02:00
Patrik Nordwall
a98191289d fix negative math.abs in Sharding Typed, #25034 2018-08-28 14:27:49 +02:00
Christopher Batey
ee7e699d23 Cluster sharding: Set waiting for state timeout for tests
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
2018-07-02 12:50:29 +01:00
Christopher Batey
989e59406e Harden typed MultiDcClusterSharding
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.
2018-06-04 08:18:39 +01:00
Richard Imaoka
84d53d1ad1 Persistence: replace initialState with emptyState (#25129) 2018-05-25 14:29:22 +02:00
Patrik Nordwall
f750f73e1f define interfaces for all Typed extensions, #24776 2018-05-22 09:23:50 +03:00
Patrik Nordwall
b08d3acb4b Rename Typed TestKit, #25084
Artifact:
akka-testkit-typed -> akka-actor-testkit-typed

Package:
akka.testkit.typed -> akka.actor.testkit.typed

Config:
akka.typed -> akka.actor.typed
akka.testkit.typed -> akka.actor.testkit.typed
2018-05-21 11:51:51 +02:00
jorgesg1986
1b83e339f4 Removed not used UntypedPropsBehavior (#25054)
Removed unnecessary pattern matching
2018-05-07 11:15:52 +09:00
Song Kun
e8a955cdef Define ! and ? in EntityRef. ticket #24922 2018-05-04 15:17:17 +02:00
Patrik Nordwall
74eb7999d8
Merge pull request #24958 from akka/wip-typed-extension-setup-patriknw
Possibility to replace Typed extensions via ActorSystemSetup, #24954
2018-05-03 11:04:32 +02:00
Christopher Batey
188b74a013 Remove application.conf from typed test projects (#25015)
It breaks assembly for multi-jvm jobs. Only needs to be in
the tests project.
2018-04-30 10:58:35 +02:00
Christopher Batey
23373565db
Fix typed cluster singleton cross dc proxies (#24936)
* Fix typed cluster singleton cross dc proxies
* Adds first multi-jvm test for typed cluster
2018-04-27 12:44:44 +01:00
Christopher Batey
b6a27deaea Fix snippets in typed cluster docs 2018-04-24 01:38:53 +09:00
Patrik Nordwall
d2b14f5c9c Possibility to replace Typed extensions via ActorSystemSetup, #24954 2018-04-23 14:58:07 +02:00
Patrik Nordwall
896aa7e33b use java.time.Duration in Typed javadsl, #24646 (#24804) 2018-04-02 08:30:49 +01:00
Jimin Hsieh
3685ce619e Remove some of Unused import warning (#24750)
* Remove `Unused import` of `akka-actor-typed`

* Remove `Unused import` of `akka-actor-typed-tests`

* Remove `Unused import` of `akka-stream-tests`

* Remove `Unused import` of `akka-persistence`

* Remove `Unused import` of `akka-persistence-typed`

* Remove `Unused import` of `akka-cluster-typed`

* Remove `Unused import` of `akka-cluster-sharding-typed`

* Format source code
2018-03-20 12:01:15 +09:00
Konrad `ktoso` Malawski
b3fbf6869b
=typ #24683 Behaviors receive, receiveMessage, receivePartial, receiveMessagePartial (#24718)
* wip

* =typ #24683 Behaviors receive, receiveMessage, receivePartial,
receiveMessagePartial

* move MutableBehavior out as separate file

* receive, receiveSignal

* missing copy

* final cleanup

* cleanup, formatting
2018-03-20 00:20:13 +09:00
Konrad `ktoso` Malawski
563c7fbcf0 Issue 24594: Integration with sbt-headers and initial header population 2018-03-13 15:45:55 +01:00
Konrad Malawski
70e225b734 =per native typed implementation of Eventsourced=>PersistendBehavior
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
2018-03-13 00:40:13 +09:00
Patrik Nordwall
a13f5cab00 ClusterSharding: automatically choose start or startProxy by a node role (#23934) (#24669) 2018-03-07 13:17:56 +09:00
Johan Andrén
ede094a2c6 Typed Java testkit, #24551
* 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
2018-02-22 12:25:04 +01:00
Roman Filonenko
a4e9881a6f typed Cluster.sharding.spawn fail fast #23708
* fail fast if Typed Cluster.sharding.spawn is called several times with different parameters 
* fix a bug in ClusterShardingImpl.spawnWithMessageExtractor - actually use allocationStrategy param
2018-02-20 14:55:30 +01:00
Patrik Nordwall
d8c9a9ca8c small Typed doc improvements 2018-02-02 17:18:31 +01:00
Patrik Nordwall
f995a7d009 remove PersistentBehaviors.persistentEntity 2018-02-02 14:22:54 +01:00
Patrik Nordwall
4330e4446e add dataCenter in ClusterSharding API via settings, #23689 2018-02-02 10:10:59 +01:00