These are chat archives for akkadotnet/akka.net

4th
Jul 2016
Ryan Smith
@PrintsCharming
Jul 04 2016 03:17
@Horusiath Thanks. I'll check it out.
Jordan S. Jones
@jordansjones
Jul 04 2016 04:42
I think I found a bug in the DistributedPubSubMediator class, but I could be deciphering the scala incorrectly.
It looks like the current implementation of Receive<Send> has been ported incorrectly:
Receive<Send>(send =>
{
    var routees = new List<Routee>();

    Bucket bucket;
    if (_registry.TryGetValue(_cluster.SelfAddress, out bucket))
    {
        ValueHolder valueHolder;
        if (bucket.Content.TryGetValue(send.Path, out valueHolder) && send.LocalAffinity)
        {
            var routee = valueHolder.Routee;
            if (routee != null) routees.Add(routee);
        }
        else
        {
            foreach (var entry in _registry)
            {
                if (entry.Value.Content.TryGetValue(send.Path, out valueHolder))
                {
                    var routee = valueHolder.Routee;
                    if (routee != null) routees.Add(routee);
                }
            }
        }
    }

    if (routees.Count != 0)
    {
        new Router(_settings.RoutingLogic, routees.ToArray()).Route(Utils.WrapIfNeeded(send.Message), Sender);
    }
});
I think it is supposed to look like this:
Receive<Send>(send =>
{
    var routees = new List<Routee>();

    Bucket bucket;
    ValueHolder valueHolder;
    if (_registry.TryGetValue(_cluster.SelfAddress, out bucket) && bucket.Content.TryGetValue(send.Path, out valueHolder) && send.LocalAffinity)
    {
        var routee = valueHolder.Routee;
        if (routee != null) routees.Add(routee);
    }
    else
    {
        foreach (var entry in _registry)
        {
            if (entry.Value.Content.TryGetValue(send.Path, out valueHolder))
            {
                var routee = valueHolder.Routee;
                if (routee != null) routees.Add(routee);
            }
        }
    }

    if (routees.Count != 0)
    {
        new Router(_settings.RoutingLogic, routees.ToArray()).Route(Utils.WrapIfNeeded(send.Message), Sender);
    }
});
If anyone can confirm this, I will get a bug created
Arsene Tochemey GANDOTE
@Tochemey
Jul 04 2016 08:17
Hello,
I would like to know how the event publisher in the EventStream framework can know that the event that is has published is handled. However assuming it is fire-and-forget architecture I would like to know whether there is a way to get that confirmation from the publisher. Thank you.
Bartosz Sypytkowski
@Horusiath
Jul 04 2016 09:51

@Tochemey it doesn't know. It's build to be simple and as fast as possible, not necessarily reliable. For cases with confirmed handlers there are so many questions that are domain specific, I'd guess the only correct way is to build your own pub/sub mechanism. Example questions:

  • What does it mean "handled"? If publisher has 10 subscribers, publishes event to all of them, 4 of them handled it, 5ft has failed and restarted, and 5 remaining didn't even get that event yet - does it mean, it was handled successfully or not?
  • If you have chain with nested relation of 4 pub/sub actors, and first two components in the chain processed it and persisted their state, but then event crashed on 3rd element in the chain, do you consider it as successful, failed or maybe partially-failed. How will you deal with the fact that part of the processing chain already persisted data, that was not successfully processed until the end.

Those are questions, that depends heavily on your problem domain, and you need to either figure out the solution on them by yourself or use a library that makes some assumptions for you with the risk that it won't fit your case. Usually akka doesn't follow the latter approach.

Bart de Boer
@boekabart
Jul 04 2016 10:15
@jordansjones could you write a unit test that proves the incorrect behaviour? Then you can just create a pull request with the failing->passing test and the fixed code
Alex Valuyskiy
@alexvaluyskiy
Jul 04 2016 11:27
Yes, we definitely need a test which could help us to reproduce a bug. Because right now all tests are green
Arsene Tochemey GANDOTE
@Tochemey
Jul 04 2016 14:01
Hello I would like to know whether I can use the Akka.Peristence.Redis