These are chat archives for akkadotnet/akka.net

12th
Oct 2016
Arjen Smits
@Danthar
Oct 12 2016 07:44
Comparison between akka.net and orleans (high level) and an intro to akka.net and actors (in dutch) https://channel9.msdn.com/events/TechDays/Techdays-2016-The-Netherlands/All-Actor-Model-frameworks-are-not-created-equally
Arsene T. Gandote
@Tochemey
Oct 12 2016 10:29
Hello Gentlemen I would like to know where can I get a good tutorial on akka F# because I have started learning F# and there is a project on the pipeline for me to do in F#.
Wuttipat
@PlanCZero
Oct 12 2016 11:00
Hi.
Anyone know how to do that in c#?
Maciek Misztal
@mmisztal1980
Oct 12 2016 11:26
aight, I'm setting up a vagrant/saltstack driven environment - I'll probably go for docker swarm - seems easier to setup then dcos - less resource consuming
Peter Bergman
@peter-bannerflow
Oct 12 2016 11:36
Trying out the AwaitAssertfunctionality in TestKit, having a bit of trouble undestanding if I am using it right. The strange thing is that when I run just one single test using AwaitAssertthe test passes, however, if I run that test with multiple other tests (like in a suite) the test fails after the specified duration. Nothing is shared between tests and I am using Akka.TestKit.Xunit2
With nothing shared between tests, I mean that the actor under test is re-created in each test
Vagif Abilov
@object
Oct 12 2016 11:41
@Tochemey look at Akka.NET Bootcamp F# projects (fsharp branch at GitHub).
Arsene T. Gandote
@Tochemey
Oct 12 2016 11:43
@object Thank you very much
@object Please do you know any good F# automatic import tools for VS2015? I have installed F# Power Tools but It could not auto-import my Akka stuff. Thanks
Vagif Abilov
@object
Oct 12 2016 11:45
What do you mean by F# automatic import? Import of what?
Arsene T. Gandote
@Tochemey
Oct 12 2016 11:45
Tools like Resharper for F#
Vagif Abilov
@object
Oct 12 2016 11:47
Resharper is not an import tool. It's a productivity tool. If you use Visual Studio Code, then Ionide is a great editor. http://ionide.io/
Arsene T. Gandote
@Tochemey
Oct 12 2016 11:48
@object Thank you Broz
Vagif Abilov
@object
Oct 12 2016 11:49
NP
Vagif Abilov
@object
Oct 12 2016 11:59

I have a question about running Akka streams in transactional manner, when success or failure can trigger some acknowedgement process. Let's say I have a simple stream:

        var source = Source.From(Enumerable.Range(1, 10));
        var flow = Flow.FromFunction(new Func<int, int>(x =>
        {
            if (x == 5)
                throw new ArgumentException();
            return x*2;
        })).WithAttributes(ActorAttributes.CreateSupervisionStrategy(Deciders.ResumingDecider));
        var writeSink = Sink.ForEach<int>(Console.WriteLine);
        var runnable = source.Via(flow).To(writeSink);
        runnable.Run(materializer);

As you can see, when the flow encounters an element 5, it will raise an exception. How can this exception trigger some negative acknowledgemen (i.e. nack a queue message with certain tag)? And if the message flow through the whole stream, how can messaging processing completing trigger a positive acknowledgement? Of course I would like to run such acknowledgement outside individual stream elements.

Arsene T. Gandote
@Tochemey
Oct 12 2016 12:22
@object I have installed the ionide plugin in VSCode. However I cannot figure out how to get an F# project template files as we have it in VS. Any idea?
Vagif Abilov
@object
Oct 12 2016 12:25
@Tochemey I have no idea. I've never used Ionide to create F# projects.
You can probably use Yeoman for this purpose: https://github.com/fsprojects/generator-fsharp
Bartosz Sypytkowski
@Horusiath
Oct 12 2016 13:56
@object if the message will cause an exception at some stage, that exception will be passed further using OnError semantics - you can intercept them by i.e. using Recover* extension methods. However if you need to ack/nack messages back to source, there are few different options for that. I think, that the most stream-idiomatic is to use BidiFlows: they can be used to create a duplex request-response stream. For example, on the JVM a whole akka-http module is based on bidi flows.
Vagif Abilov
@object
Oct 12 2016 14:00
Thanks @Horusiath. I assume that with BidiFlow I send ack/nack in the opposite direction so there will be a dedicated flow/sink dealing with acks. But how will it get the ack value? Will I need to set up a broadcast from the source that forwards ack information to the ack handler?
Bartosz Sypytkowski
@Horusiath
Oct 12 2016 14:06
@object this can work like that:
+--------+               +----------+               +--------+
|        | ~(messages)~> |          | ~(messages)~> |        |
| Source |               | BidiFlow |               |  Sink  |
| (Flow) |               |          |               | (Flow) |
|        | <~(ack/nack)~ |          | <~(ack/nack)~ |        |
+--------+               +----------+               +--------+
Vagif Abilov
@object
Oct 12 2016 14:07
@Horusiath great, thanks!
Bartosz Sypytkowski
@Horusiath
Oct 12 2016 14:08
other version is to pass contextual message from one stage to another. So i.e: you can have message with Commit() \ Abort() method, that will callback the source. Once error was catched, abort immediatelly, if message has been passed to the sink, commit it.
(ofc you cannot send message across machine boundaries then - or you need to implement Commit/Abort in terms of akka transport)
Vagif Abilov
@object
Oct 12 2016 14:10
This is how we are currently doing this without streams, with plain actors. But it is very tedious, each actor needs to be aware of this, this is one of the main reasons we started looking into streams.
Damian Reeves
@DamianReeves
Oct 12 2016 14:43
If I change the rest of my cluster to Wire does Lighthouse also need to be changed to wire?
Andrew Buttigieg
@andrewbuttigieg
Oct 12 2016 14:47
Hi, I am testing out clustering and got nodes to connect and do interesting things but I have a problem; is there a way to gracefully leave a cluster? It seems that leaving still causes the other nodes to show transport exceptions to the "dropped" node perpetually..
Arjen Smits
@Danthar
Oct 12 2016 14:54
@DamianReeves yes
Damian Reeves
@DamianReeves
Oct 12 2016 14:54
thanks
Vagif Abilov
@object
Oct 12 2016 16:31
I was thinking about your suggestion, @Horusiath, to use BidiFlow to arrange acknowledgement to Source. Are you sure this is the right pattern? My concerns are:
  1. In case of a long chain a positive acknowledgement (ack) will travel all the way back through several BidiFlows instead of going directly to the source.
  2. A negative acknowledgement (nack) in case of error can occur almost at any stage. Again, it will have to travel all the way back.
    An optimal graph would be the one where every flow is connected backwards to the source. But I am not sure how to build such a graph, also it has much more complex topology than BidiFlow.
Garrard Kitchen
@garrardkitchen
Oct 12 2016 16:40
Has anybody had any success with Azure App Services? Context: We're porting a product to Azure. Hoping to deploy front-end to App Services and back-end to Azure Container Services (Docker) all within a VNET. So far I've wasted a few days getting nowhere with a PoC. Experiencing difficulty in obtaining private IP and getting this error: 'An address incompatible with the requested protocol was used'.
Andrey Leskov
@andreyleskov
Oct 12 2016 16:44
@garrardkitchen welcome to the club ) try to change enforce-ip-family setting, more details here: https://github.com/akkadotnet/akka.net/releases/tag/v1.1.2
Garrard Kitchen
@garrardkitchen
Oct 12 2016 16:51
Thanks @andreyleskov, I'll take it for a spin.
Garrard Kitchen
@garrardkitchen
Oct 12 2016 16:58
@andreyleskov Same error. Have you managed to get akka with with App Services then?
Andrey Leskov
@andreyleskov
Oct 12 2016 17:00
@garrardkitchen I'm using akka as part of WebApp
and using config like "hostname = localhost enforce-ip-family = true"
Garrard Kitchen
@garrardkitchen
Oct 12 2016 17:19
Thanks for your help @andreyleskov, I had wrong configuration.
Bartosz Sypytkowski
@Horusiath
Oct 12 2016 17:51
@object it's only a proposition ;) Sending ack/nack directly from sink to source would be probably faster, but you need to remember to bind those two
Vagif Abilov
@object
Oct 12 2016 17:52
@Horusiath yes, it's faster but not nice looking :-)
But I guess I need to learn some Scala and inspect their stream-based queue actor implementation
Arsene T. Gandote
@Tochemey
Oct 12 2016 19:06
Hello How can I use Paket to install Akka and Akka.Fsharp
Vagif Abilov
@object
Oct 12 2016 19:10
@Tochemey there is nothing special about installing Akka and Akka.FSharp using Paket. You will need Paket.dependencies on the solution level and Paket.references for each project with list of Nuget packages. Read more about it in Paket documentation.