Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=per #3915 Make become work during recovery for EventsourcedProcessor et.c. #2082

Conversation

bantonsson
Copy link
Member

No description provided.

override def toString: String = "recovering"

def aroundReceive(receive: Receive, message: Any) {
Eventsourced.super.aroundReceive(receive, message)
// Since we are recovering we can ignore the receive behavior from the stack
Eventsourced.super.aroundReceive(_recoveryBehavior, message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent

@patriknw
Copy link
Member

LGTM

@patriknw
Copy link
Member

@bantonsson one more thing; the ExampleProcessor in the docs is not correct. It doesn't do become in receiveRecover. I think that example should be simplified, not use become. Too many things. Instead we should mention in the docs that become is supported, and perhaps have a separate example of it.

@bantonsson
Copy link
Member Author

@patriknw, yes I know. It can end up i n the wrong state during recovery. I'll remove that and add it to the docs instead.

@bantonsson bantonsson removed the tested label Mar 20, 2014
@bantonsson
Copy link
Member Author

Updated the doc and samples. Also added the necessary things to the lambda sample for it to become an activator tutorial.


The easiest way to run this example yourself is to download `Typesafe Activator <http://www.typesafe.com/platform/getstarted>`_
and open the tutorial named `Akka Persistence Samples with Java <http://www.typesafe.com/activator/template/akka-sample-persistence-java8>`_.
and open the tutorial named `Akka Persistence Samples with Java <http://www.typesafe.com/activator/template/akka-sample-persistence-java-lambda>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be changed to Akka Persistence Samples in Java with Lambdas
I created a reminder to update the download page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Thanks.

@drewhk
Copy link
Member

drewhk commented Mar 21, 2014

LGTM

@rkuhn
Copy link
Contributor

rkuhn commented Mar 21, 2014

So if I understand correctly, receiveRecover is now always used during recovery, regardless of calls to context.become(); outside of recovery the processing behavior can be changed, where receiveCommand relates to the become arguments just like receive normally does. One question which might warrant a comment: is it possible to get SnapshotOffer or RecoveryFailure outside of recovery? In that case a become argument would have to handle these as well, which is not true for receiveCommand in conjunction with initialBehavior.

This separation seems like it might want to be simplified—or I am just confused and should read the docs with a bit more time.

Apart from this, it LGTM for now.

@bantonsson
Copy link
Member Author

@rkuhn, It's not possible to get SnapshotOffer or RecoveryFailure outside of recovery. The reason that it's safe to only use receiveRecover and is not visible in the diff is that the EventSourced.super.aroundReceive will stash all messages that are not related to the recovery.

Yes, the logic is convoluted. I don't want to touch it before 2.3.1, but I created a ticket.

@bantonsson bantonsson removed the tested label Mar 21, 2014
bantonsson added a commit that referenced this pull request Mar 21, 2014
…me-during-recover-ban

=per #3915 Make become work during recovery for EventsourcedProcessor et.c.
@bantonsson bantonsson merged commit 006880a into release-2.3 Mar 21, 2014
@bantonsson bantonsson deleted the wip-3915-eventsourceprocessor-become-during-recover-ban branch March 21, 2014 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed Ready to merge from review perspetive, but awaiting some additional action (e.g. order of merges)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants