{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka/issues/25534","repository_url":"https://api.github.com/repos/akka/akka","labels_url":"https://api.github.com/repos/akka/akka/issues/25534/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/25534/comments","events_url":"https://api.github.com/repos/akka/akka/issues/25534/events","html_url":"https://github.com/akka/akka/pull/25534","id":354471162,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMjI1Nzk3","number":25534,"title":"RFC: reliable side effect delivery","user":{"login":"cchepelov","id":1515440,"node_id":"MDQ6VXNlcjE1MTU0NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/1515440?v=4","gravatar_id":"","url":"https://api.github.com/users/cchepelov","html_url":"https://github.com/cchepelov","followers_url":"https://api.github.com/users/cchepelov/followers","following_url":"https://api.github.com/users/cchepelov/following{/other_user}","gists_url":"https://api.github.com/users/cchepelov/gists{/gist_id}","starred_url":"https://api.github.com/users/cchepelov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchepelov/subscriptions","organizations_url":"https://api.github.com/users/cchepelov/orgs","repos_url":"https://api.github.com/users/cchepelov/repos","events_url":"https://api.github.com/users/cchepelov/events{/privacy}","received_events_url":"https://api.github.com/users/cchepelov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-27T20:44:18Z","updated_at":"2018-08-27T20:44:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/25534","html_url":"https://github.com/akka/akka/pull/25534","diff_url":"https://github.com/akka/akka/pull/25534.diff","patch_url":"https://github.com/akka/akka/pull/25534.patch"},"body":"This PR is a request for comment.\r\n\r\nCurrently, there is no guarantee that the callback provided in an effect's `.thenRun()` method is delivered. For instance, if the JVM dies precisely after achieving the durability of an event but before executing the side effects.\r\nOr if the side effect dies in the course of execution for transient reasons (unable to connect to a message broker, etc).\r\n\r\nAn approach is to perform Persistence Query and ensure the \"reliable side effect is generated there\"; but this can be a pretty heavy machinery when the use case is to ensure another downstream aggregate root is notified of something. \r\n\r\nThis code attempts a different approach with a different tradeoff. In this new proposed `ReliableSideEffectBehavior`, four types: `Command`, `State`, `Event` but also `Notification`. The notifications are side effects generated as part of evolving the state in response to an event.\r\n\r\nA new `notificationHandler` is guaranteed to be called *at least once* per generated notification, even in case of *rapid unintended passivation* \r\n\r\nIn terms of implementation, this is currently made the clumsy way by wrapping events into an EventWrapper that is also able to carry intents to deliver notifications and completion of notifications. As a result, this implementation trades a journal event stream listener with more events.\r\n\r\nFor the end user, `ReliableSideEffectBehavior` has the additional benefit of entirely avoiding the tagged events/journal pollng mechanism and simply work off whichever journal plugin is currently used.\r\n\r\nI haven't attempted to map into the scaladsl/javadsl dichotomy as it's a bit premature at the RFC phase, and I'm unsure what adaptation Java would require.\r\n\r\nWould appreciate any feedback."},"comment":{"url":"https://api.github.com/repos/akka/akka/issues/comments/416362306","html_url":"https://github.com/akka/akka/pull/25534#issuecomment-416362306","issue_url":"https://api.github.com/repos/akka/akka/issues/25534","id":416362306,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjM2MjMwNg==","user":{"login":"lightbend-cla-validator","id":5833735,"node_id":"MDQ6VXNlcjU4MzM3MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/5833735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightbend-cla-validator","html_url":"https://github.com/lightbend-cla-validator","followers_url":"https://api.github.com/users/lightbend-cla-validator/followers","following_url":"https://api.github.com/users/lightbend-cla-validator/following{/other_user}","gists_url":"https://api.github.com/users/lightbend-cla-validator/gists{/gist_id}","starred_url":"https://api.github.com/users/lightbend-cla-validator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightbend-cla-validator/subscriptions","organizations_url":"https://api.github.com/users/lightbend-cla-validator/orgs","repos_url":"https://api.github.com/users/lightbend-cla-validator/repos","events_url":"https://api.github.com/users/lightbend-cla-validator/events{/privacy}","received_events_url":"https://api.github.com/users/lightbend-cla-validator/received_events","type":"User","site_admin":false},"created_at":"2018-08-27T20:44:19Z","updated_at":"2018-08-27T20:44:19Z","author_association":"NONE","body":"Hi @cchepelov,\n\nThank you for your contribution! We really value the time you've taken to put this together.\n\nBefore we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement:\n\n[http://www.lightbend.com/contribute/cla](http://www.lightbend.com/contribute/cla)"}}
{"actor":{"display_login":"lightbend-cla-validator"}}