Commit graph

235 commits

Author SHA1 Message Date
Patrik Nordwall
85be3045bb !per #17249 Avoid init problems of persistence tck
* in the end TestKitBase eagerly initialize the ActorSystem and
  to avoid the need for using lazy val tricks I changed the trait
  to abstract class with config constructor parameter
2015-05-06 14:20:40 +02:00
Patrik Nordwall
ef387af2fc =doc #16910 Fix include sections in fault tolerance docs
* and don't show AkkaSpec in doc code

(cherry picked from commit 23be60395cdea846ef168960cd05e88c6bd29556)

Conflicts:
	akka-docs/rst/scala/code/docs/actor/FaultHandlingDocSpec.scala
	akka-docs/rst/scala/fault-tolerance.rst
2015-04-01 10:50:30 +02:00
Julian Tescher
00f6a58e7c Changes all occurances of Typesafe copyright to extend to 2015 2015-03-10 14:12:19 -07:00
Andrei Pozolotin
18dfd39686 +per #15587 Make it possible to use multiple persistence plugins 2015-02-19 21:25:52 -06:00
Roland Kuhn
a029a90502 fix warnings in contrib, docs, osgi, persistence and slf4j 2015-02-06 18:45:58 +01:00
Roland Kuhn
d9efd041f7 add akka-typed project with generic ActorRef
This is the first step towards more type-safety in Actor interactions,
comprising:

* generic ActorRef[T] that only accepts T messages
* generic ActorSystem[T] extends ActorRef[T] (sending to the guardian,
  whose Props[T] are provided for ActorSystem construction)
* removed the Actor trait: everything in there has been made into
  messages and signals
* new Behavior[T] abstraction that consumes messages (of type T) or
  Signals (lifecycle hooks, Terminated, ReceiveTimeout, Failed),
  producing the next Behavior[T] as the result each time
* the ask pattern is provided and yields properly typed Futures
* variants of ActorContext are provided for synchronous testing of
  Behaviors

All of this is implemented without touching code outside akka-typed
(apart from making guardianProps configurable), creating wrapper objects
around ActorRef, ActorContext, ActorSystem, Props and providing an Actor
implementation that just runs a Behavior.
2015-01-29 11:42:28 +01:00
Roland Kuhn
50d1569f37 Merge pull request #16634 from dimbleby/stable-priority-mailbox
Introduce stable priority mailboxes.
2015-01-28 15:10:24 +01:00
dch
8df81e6b72 Introduce stable priority mailboxes.
Similar to existing priority mailboxes, but these preserve FIFO ordering
for messages of equal priority.
2015-01-28 11:20:59 +00:00
Roland Kuhn
ed71c37318 Merge pull request #16668 from meln1k/wip-16614-include-best-practice-tip-on-messages-in-companion-object-in-docs-meln1k
=doc #16614 Include best-practice tip on messages in companion object in docs
2015-01-27 18:38:52 +01:00
Roland Kuhn
9463c9ff6c Merge branch 'tmp' 2015-01-27 16:26:04 +01:00
Roland Kuhn
a18c1bbafb fix up wrong includecode comments in FaultHandlingDocSpec 2015-01-27 16:25:13 +01:00
Nikita Melkozerov
a8632befc6 =doc #16614 Include best-practice tip on messages in companion object in docs 2015-01-23 22:40:55 +05:00
Andrei Pozolotin
7b9f77a073 + akka-cluster-metrics: new akka module
* new akka module split from akka-cluster
* provide sigar provisioning
* fix ewma usage
* resolve #16121
* see #16354
2015-01-19 10:23:54 -06:00
Roland Kuhn
a4a985035e Merge pull request #16575 from akka/wip-15864-remove-ømq-∂π
-zer #15864 remove zeromq module
2015-01-16 10:19:45 +01:00
Roland Kuhn
239619e68f -zer #15864 remove zeromq module 2015-01-15 20:19:35 +01:00
Chris Johnson
2d312f1a91 Super minor change to scala fsm example: added named boolean arg 2015-01-13 22:01:06 -08:00
sangche
c0867e1308 =doc #16459 change confusing FaultHandlingDocSpec in Fault Tolerance Document. 2014-12-22 23:47:05 -08:00
Patrik Nordwall
edd9c2d5c6 Merge pull request #16432 from pawel-wiejacha/pawelwiejacha_16431_named_test_probes
+tes #16431 support for TestProbe with user-defined name
2014-12-15 14:28:45 +01:00
Patrik Nordwall
c566d5a106 per #15423 Remove deprecated features from akka-persistence
* remove channels
* remove View
* remove Processor
* collapse the complicated internal state management
  that was spread out between Processor, Eventsourced and Recovery
* remove Recovery trait, this caused some duplication between Eventsourced
  and PersistentView, but but the enhanced PersistentView will not be based
  on recovery infrastructure, and therefore PersistentView code will be replaced anyway
* remove PersistentBatch
* remove LoopMessage
* remove deleteMessages of individual messages
* remove Persistent, PersistentRepr and PersistentImpl are kept
* remove processorId
* update doc sample code
* note in migration guide about persistenceId
* rename Resequencable to PersistentEnvelope
2014-12-12 16:18:47 +01:00
Paweł Wiejacha
f480989b25 +tes #16431 support for TestProbe with user-defined name 2014-12-04 22:42:40 +01:00
Konrad 'ktoso' Malawski
73cd1d7375 +act #15163 allows to suppress certain messages from being dead-letter-ed
Conflicts:
	akka-actor/src/main/scala/akka/actor/ActorRef.scala
2014-12-01 17:03:13 +01:00
Marek Prochera
b43f3639d6 Fix #16364 - Doc - Persistent actor - clarification of the recovery customization 2014-11-25 23:13:16 +01:00
Balázs Kossovics
324dc0f0c5 =doc #16198 FSM extends Actor, not depends on it
The documentation incorrectly stated that FSM uses self type references
to depend on Actor, but it’s false, FSM directly extends Actor.
2014-11-03 23:43:50 +01:00
Marcus Ljungblad
dd8c920280 =doc #13043 Adding section on testing parent-child relationships 2014-10-31 15:43:20 +01:00
Ronak Buch
d6c7ac84d9 =doc fixed spelling mistake in comment 2014-10-17 04:33:38 -05:00
Patrik Nordwall
1ffd05db49 =act #13981 Encode name of Balancing dispatcher config path 2014-08-29 12:33:18 +02:00
Viktor Klang
cd8e97c060 +act - 15757 - Reworks implementation of ActorSystem shutdown
* deprecates awaitTermination, shutdown and isTerminated
  * introduces a terminate-method that returns a Future[Unit]
  * introduces a whenTerminated-method that returns a Future[Unit]
  * simplifies the implementation by removing blocking constructs
  * adds tests for terminate() and whenTerminated
2014-08-25 15:49:28 +02:00
Krzysztof Janosz
1658f96862 +act #13004 Adding TailChopping router 2014-07-29 20:27:03 +02:00
Konrad Malawski
975e5d1455 Merge pull request #15541 from ktoso/port-doc-typed-router-ktoso
+doc #15537 add Typed router pattern (for validation)
2014-07-15 12:07:34 +02:00
Konrad 'ktoso' Malawski
ba2411833a +doc #15537 add Typed router pattern
Conflicts:
	akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala
2014-07-15 10:22:23 +02:00
Konrad 'ktoso' Malawski
90bc347607 +per #13815 akka-persistence-tck based on @krasserm's work
Original here: https://github.com/krasserm/akka-persistence-testkit

New features:
* merged martin's tests
* usable from java (junit 4)
* simple bench test, which helps checking if ordering is perserved under
  bigger workloads and simple perf checking
* does NOT include tests for already deprecated features (deleteMessages)
* docs

Resolves #13815

Conflicts:
	project/AkkaBuild.scala
2014-07-14 19:39:30 +02:00
Michal Knapik
7ca3a9699e +tes #12681 add EchoActor 2014-07-11 11:16:35 +02:00
Konrad Malawski
5cc9eb2a88 Merge pull request #15478 from kanerogers/patch-1
Add import for TestProbe
2014-07-07 15:48:56 +02:00
Pavel Zalunin
f730b60bd9 =doc,sam RecoveryCompleted handled by receiveRecover typo 2014-07-03 13:58:14 +03:00
Kane Rogers
e62610bbd7 Add import for TestProbe
The example for TestProbe doesn't seem to work very well without the TestProbe class imported. :-(
2014-07-02 12:55:48 +10:00
Patrik Nordwall
bc2aeaf0d3 =per #15441 Remove persistent stream in docs and sample
We must first release akka-stream with dependency to akka 2.3.4
and it should be maintained in the akka-release-dev branch

(cherry picked from commit a97a067701cfc527b235707882e72326277415f3)

Conflicts:
	akka-samples/akka-sample-persistence-scala/build.sbt
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/StreamExample.scala
2014-06-28 17:24:25 +02:00
Patrik Nordwall
33c7f6bb4f !per Change for journal plugin compatibility
* A few more adjustments, found when verifying source compatibility of a few
  journal plugins
* Note that PersistentId will be removed with deleteMessage and we should
  not break plugins because of that
* Add missing section of at-least-once delivery in migration guide

(cherry picked from commit 6727eac6d07280d277968e2e25db44e02be3b102)

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/main/scala/akka/persistence/Snapshot.scala
	akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteProxy.scala
2014-06-28 17:11:06 +02:00
Patrik Nordwall
32ca608c97 +per #15327 Add AtLeastOnceDelivery trait
* also remove final of around methods, and let deliver send when not recoveryRunning

(cherry picked from commit 312b0d107a179accaf135f64ed9c3b78f3e351d1)
2014-06-26 22:58:46 +02:00
Konrad 'ktoso' Malawski
b1d1d87111 !per #15436 make persistenceId abstract in NEW classes
(cherry picked from commit de3249f7f4b859c3caa232e579d9a3bae7406803)

Conflicts:
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/PersistentActorExample.scala
2014-06-26 16:29:30 +02:00
Konrad 'ktoso' Malawski
3fd240384c +per #15424 Added PersistentView, deprecated View
A PersistentView works the same way as View did previously, except:

* it requires an `peristenceId` (no default is provided)
* messages given to `receive` are NOT wrapped in Persistent()

akka-streams not touched, will update them afterwards on different branch

Also solves #15436 by making persistentId in PersistentView abstract.

(cherry picked from commit dcafaf788236fe6d018388dd55d5bf9650ded696)

Conflicts:
	akka-docs/rst/java/lambda-persistence.rst
	akka-docs/rst/java/persistence.rst
	akka-docs/rst/scala/persistence.rst
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/main/scala/akka/persistence/View.scala
2014-06-26 10:10:09 +02:00
Patrik Nordwall
d6ffdf521c =per #15429 Rewrite persistence documentation and samples for 2.3.4 changes
(cherry picked from commit 02351e32f110a8c4a249f0f3f84bae5898d1a836)

Conflicts:
	akka-samples/akka-sample-persistence-java-lambda/tutorial/index.html
	akka-samples/akka-sample-persistence-java/tutorial/index.html
	akka-samples/akka-sample-persistence-scala/build.sbt
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ConversationRecoveryExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/PersistentActorExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ProcessorChannelExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ProcessorChannelRemoteExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/SnapshotExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/StreamExample.scala
	akka-samples/akka-sample-persistence-scala/tutorial/index.html
2014-06-25 15:37:35 +02:00
Konrad 'ktoso' Malawski
4bb321a83a !per #15230 rename processorId => persistentId
* This is NOT binary compatible, we're in an *experimental* module.
* disabled binary compat checks for package akka.persistence
* Source compatibility is retained, but users should migrate do the new
  method name ASAP.
* Plugin APIs were migrated in a way that allows the old plugins to
  compile agains 2.3.4 without having to change anything. Hopefuly this
  will help authors migrate to 2.3.4 sooner. This is only source level compatible, not binary compatible.
* added deprecation warnings on all processorId methods and provided bridges where possible
* for users, the migration should be painless, they can still override
  the old method, and it'll work. But we encourage them to move to
  persistenceId; All delegation code will have to be removed afterwards ofc.

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/Channel.scala
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/main/scala/akka/persistence/PersistentChannel.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	akka-persistence/src/main/scala/akka/persistence/Snapshot.scala
	akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteProxy.scala
	akka-persistence/src/main/scala/akka/persistence/journal/inmem/InmemJournal.scala
	akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbKey.scala
	akka-persistence/src/main/scala/akka/persistence/snapshot/SnapshotStore.scala
	akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala
	project/AkkaBuild.scala
2014-06-24 17:05:18 +02:00
Marcin Kubala
f4793a399f =act,clu,con,doc,per,rem,sam #15114 append missing parens at Actor.sender() invocations 2014-06-20 23:05:51 +02:00
Konrad 'ktoso' Malawski
a71790bb18 +per #15229 defer for PersistentActor
* Deferred events are not persisted, thus will not participate in replays
  etc. If users want events to be persisted, they can simply use
  `persistAsync` instead.
* This, 3rd, rewrite extends the Persistent hierarchy by a top level
  trait "Resequenceable", which is used to mark every event to be sent
  in sequence back to the PersistentActor. These are split into
  NonPersistentRepr or PersistentRepr, and acted upon accordingly.
* defer is guaranteed to be called, even after persistence failures
* Includes docs updates for java/scala/java8

Resolves #15229
Depends on #15227

Conflicts:
	akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	akka-persistence/src/test/scala/akka/persistence/PersistentActorSpec.scala
	project/AkkaBuild.scala
2014-06-10 17:09:24 +02:00
Björn Antonsson
9bcaeff87d +per #13944 Send RecoveryComplete message at end of recovery
Fixes #13944

Conflicts:
	akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	project/AkkaBuild.scala
2014-06-10 13:22:10 +02:00
Konrad 'ktoso' Malawski
d51b79c95a !per persistAsync
Breaks binary compatibility because adding new methods to Eventsourced
trait. Since akka-persistence is experimental this is ok, yet
source-level compatibility has been perserved thankfuly :-)

Deprecates:
* Rename of EventsourcedProcessor -> PersistentActor
* Processor -> suggest using PersistentActor
* Migration guide for akka-persistence is separate, as wel'll deprecate in minor versions (its experimental)
* Persistent as well as ConfirmablePersistent - since Processor, their
  main user will be removed soon.

Other changes:
* persistAsync works as expected when mixed with persist
* A counter must be kept for pending stashing invocations
* Uses only 1 shared list buffer for persit / persistAsync
* Includes small benchmark
* Docs also include info about not using Persistent() wrapper
* uses java LinkedList, for best performance of append / head on
  persistInvocations; the get(0) is safe, because these msgs only
  come in response to persistInvocations
* Renamed internal *MessagesSuccess/Failure messages because we kept
  small mistakes seeing the class "with s" and "without s" as the same
* Updated everything that refered to EventsourcedProcessor to
  PersistentActor, including samples

Refs #15227

Conflicts:
	akka-docs/rst/project/migration-guides.rst
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/test/scala/akka/persistence/PersistentActorSpec.scala
	project/AkkaBuild.scala
2014-06-10 11:09:12 +02:00
Konrad Malawski
c046cdff0a !act,doc #3893 Removed isTerminated checks from ActorClassification
Instead of isTerminated we now use death watch on subscribers.

! Breaking change - ActorClassification based event buses now require
  and actor system. Previously no actors were involved, but now someone
  has to `watch` the subscribers. The unsubscriber is an system actor,
  and won't be stopped automagically if a bus stops to be used (hard to
  determine what "stops being used" is)
* Replaced isTerminated checks with watching actors
* backing structure for ActorClassification swaped from
  ConcurrentHashMap to immutable.Map with CAS operations on it. This is
  required to avoid races and guarantee register/unregister ordering
  (messages sent with proper sequence numbers) to the unsubscriber.
  Performance tested it and still above 1.3million subscribe+unsubscribe
  ops per second (mac i7, retina), where as the CHM version was
  4 million - but that one could only work in the presence of
  itTerminated - so we pay the price here for removing it.
* `ActorClassification` starts the unsubscriber instance by itself,
  the unsubscriber is an system actor, and can be stopped via
  `ActorClassification#shutdown`
* Will unregister from unsubscriber, when no more subscriptions for
  given subscriber are left in this bus.
* Added missing "Java API: " for some types
* Updated docs to point out the automatic subscriber purging (on terminated)
2014-04-24 14:08:07 +02:00
Patrik Nordwall
c1f7d7fa21 =doc #3924 Doc how to be notified when recovery completed 2014-03-25 10:46:05 +01:00
Roland Kuhn
dc305eaf18 +act #3949 add LoggingReceive.withLabel
def someState = LoggingReceive.withLabel("some state") {
  case msg => ...
}
2014-03-21 20:43:13 +01:00
Roland Kuhn
ac5f4fc72e Merge pull request #2050 from drexin/wip-3246-priority-mailbox-drexin
+act #3246 Added control aware mailbox types
2014-03-11 19:36:04 +01:00