Commit graph

260 commits

Author SHA1 Message Date
Patrik Nordwall
90aa5be45e
fix wrong lastSequenceNumber, #28976 (#29128)
* off by one when accessed from event handler
* off by one from event handler during replay
* wrong when unstashing
* added more tests, also for persist of several events
2020-05-26 17:17:30 +02:00
kerr
bada816714
=build Fix commandAlias for fixall and sortImports (#28984)
* =build Fix commandAlias for fixall and sortImports

* =build Update sortImports to 0.5.0

* Sort imports to handle `javax`.

* fx
2020-05-11 11:47:33 +02:00
Patrik Nordwall
ef79738373
Synchronous TestKit for EventSourcedBehavior, #23712 (#28952)
* using real EventSourcedBehaviorImpl
* using new inmem journal (PersistenceTestKit)
* advantages compared to a "fake" driver
  * no difference in implementation details from real thing
  * no limitations
  * less maintance
* added internal messsages to EventSourcedBehaviorImpl to be able to grab state
  and persistenceId
  * GetState as InternalProtocol instead of Signal so that it is stashed
* serialization checks, using SerializationTestKit
* better testKitGuardian naming to allow multiple PersistenceTestKit
* support testing of restart
* support failure testing by using PersistenceTestKit
* update doc sample
* apidoc, reference docs, and javadsl
2020-04-29 22:06:42 +02:00
Andreas Gabor
30e79c6231
Allow changing the recovery strategy in a typed persistence actor #25216 (#28932)
* Allow changing the recovery strategy in a typed persistence actor #25216

* scalafmt fix

* added mima exclusion

* added typed.Recovery allowing only default or disabled recovery strategy

* typed.Recovery takes SnapshotSelectionCriteria
deprecated withSnapshotSelectionCriteria

* updated docs
2020-04-28 07:18:50 +01:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
ohze.net
ea7205eaf7
dotty phase 2: scalafix ExplicitNonNullaryApply (#28949)
* scalafix ExplicitNonNullaryApply prepare

+ Temporarily use com.sandinh:sbt-scalafix because scalacenter/scalafix#1098
+ Add ExplicitNonNullaryApply rule to .scalafix.conf
+ Manually fix a NonNullaryApply case in DeathWatchSpec that cause
  `fixall` fail because ExplicitNonNullaryApply rule incorrectly rewrite
  `context unbecome` to `context unbecome()` instead of `context.unbecome()`

* scalafix ExplicitNonNullaryApply

fix by enabling only ExplicitNonNullaryApply rule in .scalafix.conf then:
```
% sbt -Dakka.build.scalaVersion=2.13.1
> fixall
```

* scalafmtAll

* Revert to ch.epfl.scala:sbt-scalafix

Co-authored-by: Bùi Việt Thành <thanhbv@sandinh.net>
2020-04-27 12:31:16 +02:00
Bùi Việt Thành
02b9b30354 scalafix ExplicitResultTypes - for implicit members 2020-04-20 17:59:50 +07:00
Bùi Việt Thành
4df76d6bce scalafix FinalObject 2020-04-20 17:59:49 +07:00
Patrik Nordwall
5d7ca06ef1 avoid touching MDC for context.log.trace in reliable delivery 2020-04-08 17:02:28 +02:00
Patrik Nordwall
d9f1416252 change %mdc examples, and tests
* if MDC is empty it's confusing with {} because it can be misunderstood
  to be a missing log template parameter
2020-03-27 17:59:58 +01:00
RibleStrype
96639c537e
fix premature reset of the 'writeInProgress' flag in case of persistence failure #28629 2020-03-19 15:59:46 +01:00
Patrik Nordwall
1d16e847b5 Reliable delivery in Typed, #20984
Different approach than in classic AtLeastOnceDelivery because I would like:
* support flow control, with a work pulling approach
* be possible to use with or without persistence (without it may loose
  messages if producer node crashes)
* detect lost messages on the consumer side and let that drive resends,
  instead of aggressively resending from producer side
* deliver messages in order and deduplicate resent messages
* have an efficient protocol for acknowledgments over the network (not ack each message),
  but still have a simple one-by-one protocol for the end user

* support 3 use cases (building blocks)
  * point-to-point
  * work pulling
  * sharding
* optional durable queue, with one event sourced implementation
* protobuf serialization
* ApiMayChange
* reference docs and examples
* api docs
* doc example code missing so far
2020-03-12 15:37:16 +01:00
Christopher Batey
0d57c71766
Add paramater documentation for event sourced entities (#28540)
* Add paramater documentation for event sourced entities

Useful for help in IDEs, text taken from the docs.

* whitespace

Co-authored-by: Arnout Engelen <github@bzzt.net>
2020-01-31 16:09:02 +01:00
Johan Andrén
83452be2ff
Cut the sample using stashing in an EventSourcedBehavior for now #23853 (#28512)
It's not actually shown in docs anywhere, only exists for Scala, and has questionable semantics.
If #24473 is ever revived I guess we should/can reintroduce the sample, include in docs, make it work etc.
2020-01-24 16:33:03 +01:00
Johannes Rudolph
ec208cad08
Merge branch 'master' into scalatest310 2020-01-14 12:03:32 +01:00
Arnout Engelen
44ad322a56 Deprecate EventEnvelope ctor without timestamp (#28454) 2020-01-14 10:22:07 +00:00
Mike Limansky
d9ed927df0 Update to ScalaTest 3.1.0, fix #28289. 2020-01-11 15:15:10 +03:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Helena Edelson
64aa08c481
EventSourcedBehavior not failing with DeathPactException for unhandled Terminated() signals (#28358) 2019-12-17 05:22:09 -08:00
Helena Edelson
8948e4b6ce Fixing test compiler warnings. (#28388) 2019-12-17 13:31:21 +01:00
Brian Wignall
10e61e816f Fix typos (#28326) 2019-12-09 08:41:55 +01:00
Patrik Nordwall
619a4494d5
Merge pull request #28308 from akka/wip-mdc-logback-config-patriknw
use %mdc logback config to output all MDC entries
2019-12-05 16:26:30 +01:00
Johannes Rudolph
702b6a7f41 actor: allow seamless access to untyped extensions given typed ActorSystem (#28294)
* actor: allow seamless access to untyped extensions given typed ActorSystem

* add overrides with concrete type for Java API everywhere
2019-12-05 16:01:22 +01:00
Patrik Nordwall
c84e4d82fb use %mdc logback config to output all MDC entries
* change logback doc example configurations
* change logback test configurations
* change docs around MDC
* change Slf4jLoggerSpec to use this instead
2019-12-05 11:47:37 +01:00
Johan Andrén
4588a3904f
Include host and port in mdc if clustered or remote #28073 2019-11-28 11:35:11 +01:00
Arnout Engelen
4b632c4537 Add convenience method to start timer without key (#27875)
* Add convenience method to start timer without key

It is probably common that there is no need to allow different timers
that send the same message, and this makes that more convenient to write.

Updated one method to gather feedback, if we like the change I can apply
it to the others as well.

* Add alternative to all typed timer API's

Update java/scaladoc, update tests

Not updated classic actors and FSM API's
2019-11-26 13:26:49 +00:00
Patrik Nordwall
938322ac4e more efficient and correct clear in Slf4jLogger (#28094)
* more efficient MDC.put and clear in Slf4jLogger

* no advantage of using mdcAdpater for put
2019-11-26 13:10:04 +00:00
Taeguk Kwon
897443da40 Add omitted logPrefixSkipList in getting logger class in EventSourcedBehavior (#28168) 2019-11-22 10:17:46 +01:00
Patrik Nordwall
a5c8c352e1
Merge pull request #28187 from ygree/interpret-unstashed-interceptor
Add interceptors for interpretUnstashedMessage and onReplayingSnapshot.
2019-11-22 09:55:49 +01:00
Yury Gribkov
9fabd36fb5 Add interceptors for interpretUnstashedMessage and onReplayingSnapshot. 2019-11-20 08:08:06 -05:00
Arnout Engelen
78e2348da1
Replace 'intercept' with 'expect' (#28202) 2019-11-19 18:33:31 +01:00
Patrik Nordwall
f17bdbe233 rename scaladsl.LoggingTestKit.intercept to expect, #28194 (#28199)
* deprecate intercept
2019-11-19 17:25:43 +01:00
Johan Andrén
905694be1c
Keep custom logger name in EventSourcedBehavior #28161 2019-11-19 17:43:59 +02:00
Jafer Khan
09dad532a1 Modified the existing Effect directive in sample code of docs (#28157) 2019-11-13 16:34:00 +02:00
Patrik Nordwall
c74e9720f3
Merge pull request #28062 from chbatey/clarify-snapshot-every
Clarify snapshop every n events
2019-11-05 15:48:35 +01:00
Christopher Batey
cf5316a71c
Apply suggestions from code review
Co-Authored-By: Helena Edelson <helena@users.noreply.github.com>
2019-11-04 10:38:31 +00:00
Ignasi Marimon-Clos
d770e572ab Use PersistenceId.ofUnique instead of the private constructor (#28087)
* Use PersistenceId.ofUnique instead of private constructor
* Format Java test code
2019-11-01 16:27:10 +01:00
Patrik Nordwall
1b44348425 Use sender at all places in EventSourceBehavior ExternalInteractions, #28059 (#28060) 2019-10-25 12:30:17 -04:00
Christopher Batey
be08a0e2fe Clarify snapshop every n events 2019-10-25 17:23:25 +01:00
Patrik Nordwall
f40b307785 use max seqNr in RecoverySuccess (#28002)
* backport from Classic
* the scenario was that the snapshot was kept but the journal was
  entirely deleted, and then it should anyway write next event
  with the sequence number from the snapshot
* doesn't look like the EventSourcedBehavior had this problem,
  but doesn't hurt to use the max
2019-10-15 14:13:40 +02:00
Johan Andrén
6190f0bc58 Provide Scheduler implicitly from implicit typed actorsystem (#27986) 2019-10-14 16:33:06 +02:00
Johan Andrén
f7a88447ca Two new test cases missed the PersistenceId.ofUniqueId 2019-10-11 15:46:26 +02:00
Johan Andrén
2f7dfbfc01 Last sequence number fix (#27964)
* Reproducer for the bug

* Separate state when waiting for snapshot write #27935

Allows for accessing seqNr while snapshot in progress
2019-10-11 13:45:40 +01:00
Christopher Batey
40bf6bf5d5 Rename LoggingEventFilter to LoggingTestKit (#27888) 2019-10-11 08:38:20 +02:00
Patrik Nordwall
bb6d6365b1
Scaladoc improvements (#27929)
* private[akka] visibility on some internal classes
  * found via unidoc
* fix Scaladoc links
2019-10-10 14:17:01 +02:00
Patrik Nordwall
ddaceae80d
rename PersistenceId.apply to PersistenceId.ofUniqueId, #27924 (#27953)
* to make the entityTypeHint, entityId the more prominent choice, and
  avoid that only the entityId is used as the uniqueId
2019-10-10 14:05:46 +02:00
Patrik Nordwall
76e2730195 doc: clarify EventSourcedBehavior effects, #25953 2019-10-09 14:06:29 +02:00
Patrik Nordwall
b10a83ad9b Same logic for onRecoveryFailure in ReplayingSnapshot as ReplayingEvents, #27526 (#27530) 2019-10-01 12:24:36 +02:00
Johan Andrén
f6ebff6e27 EventsourcedBehaviorRetentionSpec race fix (#27532)
* Not working for mysterious reasons

* Fix for #27507 race in test

Logging at debug to try if there is a race when testing on Jenkins

Also, fail fast if expecting a signal from a TestProbe (never happens)
Some minor logging improvements for event sourced behavior as well.

* Don't send batches of events when snapshot and event deletion is enabled

When events are deleted the event sourced actor switches to running until it gets
an ack back from the journal about deleting events, then it deletes snapshots if that
is enabled. This means events and snapshotting could happen inbetween making the
ordering of SnapshotComplete and DeleteSnapshotsComplete signals non deterministic.
2019-10-01 12:23:13 +02:00
Patrik Nordwall
91db18b564 ActorContext as constructor parameter in AbstractBehavior, #27689 (#27806)
* ActorContext as constructor parameter in AbstractBehavior, #27689

* additional test

* additional doc clarification

* another rebase
2019-09-27 11:17:37 +02:00