These are chat archives for akkadotnet/akka.net

11th
Oct 2016
clausthalVK
@clausthalVK
Oct 11 2016 06:50
Hi,
I need to use akka.net for a portable library
any help would be appreciated
Arjen Smits
@Danthar
Oct 11 2016 07:02
@clausthalVK We currently don't have Akka as a PCL.
We are working on .net core support though.
Since .netstandard is the next generation of PCL, i recommend going with that... https://docs.microsoft.com/en-us/dotnet/articles/standard/library
clausthalVK
@clausthalVK
Oct 11 2016 07:04
thank you
Daniel D'Agostino
@dandago2_twitter
Oct 11 2016 08:14
@Danthar it seems the update did not trigger, because I still see the obsolete note :)
Arjen Smits
@Danthar
Oct 11 2016 08:15
@dandago2_twitter Yes i know. Somehow the drone that updates the site is having a hissy-fit. We are looking into it.
Daniel D'Agostino
@dandago2_twitter
Oct 11 2016 08:15
Cool :)
I'll also update the docs to fix this one later today. akkadotnet/akka.net#2339
@DamianReeves re async/await, I wrote a little article about that a little while back, in case it helps: http://gigi.nullneuron.net/gigilabs/asynchronous-and-concurrent-processing-in-akka-net-actors/
Damian Reeves
@DamianReeves
Oct 11 2016 08:18
cool I'll check it out
Arjen Smits
@Danthar
Oct 11 2016 08:19
@dandago2_twitter cool. Thx!
Daniel D'Agostino
@dandago2_twitter
Oct 11 2016 08:52
Guys is there any material available on how to use Lighthouse please?
Maciek Misztal
@mmisztal1980
Oct 11 2016 09:55
Daniel D'Agostino
@dandago2_twitter
Oct 11 2016 09:56
I watched that video a couple of times before, I seem to remember that it explains what Lighthouse does, not how to use it :)
Maciek Misztal
@mmisztal1980
Oct 11 2016 10:11
it does. it tells you what needs to be configured in order to get started with lighthouse and other clustered nodes.
Damian Reeves
@DamianReeves
Oct 11 2016 13:07
I'm having issues getting Cluster Sharding to work:
I see this in logs:
[WARNING][10/11/2016 1:07:12 PM][Thread 0004][[akka://example/user/sharding/product#924346451]] Trying to register to coordinator at [], but no acknowledgement. Total [12] buffered messages.
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 13:09
@DamianReeves are you using cluster sharding on a single node?
Damian Reeves
@DamianReeves
Oct 11 2016 13:09
Yes
Wanted to verify single before expanding
Here is the code I'm calling:
    private static void ShardingExample(ActorSystem system)
    {
        var sharding = ClusterSharding.Get(system);
        var shardRef = sharding.Start("product", Props.Create(() => new Product()), ClusterShardingSettings.Create(system),
            message =>
            {
                var productMessage = message as IProductMessage;
                return productMessage != null ? Tuple.Create(productMessage.Id.Value, message) : null;
            }, message => "0001");

        shardRef.Tell(new CreateProduct(ProductId.CreateAsin("ACME001"), "Jetpack"));
        shardRef.Tell(new CreateProduct(ProductId.CreateAsin("ACME002"), "Giant magnet"));



        var rand = new Random();
        for (int idx = 0; idx < 10; idx++)
        {
            var productId = ProductId.CreateAsin($"ACME00{rand.Next(1, 3)}");
            shardRef.Tell(new SubmitReview(productId, rand.Next(1, 6)));                               
        }
    }
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 13:19
the reason is that coordinator (the actor working as a central index for all shards) is not available - I'm not 100% sure, what the reason might be, but I would say, that you might have tried to send sharded messages before cluster has started
Damian Reeves
@DamianReeves
Oct 11 2016 13:19
Should I wait for a MemberUp, before using cluster sharding?
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 13:20
there is a method Cluster.Get(system).RegisterOnMemberUp(() => { ... })
yes
at least this is what I'd suspect
Damian Reeves
@DamianReeves
Oct 11 2016 13:22
Think that helped me see the problem:
[INFO][10/11/2016 1:21:11 PM][Thread 0014][[akka://example/system/cluster/core/daemon#301706840]] No seed-nodes configured, manual cluster join required
Does the current node not automatically get added as a seed?
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 13:23
no, you need to set itself as a seed node if you want to create 1 node cluster
Damian Reeves
@DamianReeves
Oct 11 2016 13:30
Cool.. Set the seed node and now I'm in business. Thanks
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 13:34
np :)
Damian Reeves
@DamianReeves
Oct 11 2016 13:59
Is there a simple way to programmatically add roles to a Cluster node
?
Peter Bergman
@peter-bannerflow
Oct 11 2016 14:23
I think this question has been posted before but I cannot find the answer so here it goes, if I do an ActorSelection, can I then somehow check if that leads to an actor or not? If that makes sense...
Arjen Smits
@Danthar
Oct 11 2016 14:33
@peter-bannerflow you can use the ResolveOne method on an actorselection
Peter Bergman
@peter-bannerflow
Oct 11 2016 14:33
Ah yes, or actually I only want to do this in a case where the ActorSelection leads to a child of Self, so I guess I can just do Context.Child("name").IsNobody()
Arjen Smits
@Danthar
Oct 11 2016 14:33
or send an Identify message, which will return an ActorIdentity response.
ah yes, if you want to know if a child exists checking for the nobody status is faster
Peter Bergman
@peter-bannerflow
Oct 11 2016 14:35
Cool, thx
Sean Farrow
@SeanFarrow
Oct 11 2016 14:37

@damianReeves are you talking about adding new nodes at the same time as roles, or it is just roles to a node?

+

All Conversations

Activate or click this element to toggle the profile menu

Search

Favourites

People

akkadotnet

Home

Billing

Get Gitter Apps

Sign Out

Add a room

akka.net

101

Leave

Hide

AkkaStreams

Leave

Hide

All Rooms

dotnet-core

akkadotnet.github.com

Wire

Peter Bergman @ akkadotnet/akka.net

Cool, thx

Arjen Smits @ akkadotnet/akka.net

ah yes, if you want to know if a child exists checking for the nobody status is faster

Damian Reeves
@DamianReeves
Oct 11 2016 14:37
roles to a node
i.e. I can call cluster.Join to join a cluster but how do I say what roles I provide programmatically?
verilocation
@verilocation
Oct 11 2016 15:00

Hi... I hope someone can help. Im currently evaluating Akka.net for suitability for an internal rewrite. Its going well so far but I am currently looking at edge cases. I have setup a Cluster with remote deployment but want to be able to resend a message on failure. Is there anyway I can detect this and retry?

I have tried to look to see if I can read messages off the DeadLetter mailbox and retry from there but didn't have much luck trying to find out how to read from that mailbox either.

Damian Reeves
@DamianReeves
Oct 11 2016 15:19
You could take a look at AtLeastOnceDeliveryActor http://getakka.net/docs/persistence/at-least-once-delivery
That allows you to require message acknowledgement
verilocation
@verilocation
Oct 11 2016 15:20
Thank you very much... Persistence isnt fully release though yet is it?
Damian Reeves
@DamianReeves
Oct 11 2016 15:21
no that is planned to come out of beta in 1.5
verilocation
@verilocation
Oct 11 2016 15:21
ok great thanks, thats this circa year isnt it?
(end of)
Damian Reeves
@DamianReeves
Oct 11 2016 15:21
Thats the plan
verilocation
@verilocation
Oct 11 2016 15:21
:thumbs_up:
:thumbsup:
thanks for your help / quick reply
Damian Reeves
@DamianReeves
Oct 11 2016 15:22
np
verilocation
@verilocation
Oct 11 2016 15:39
Me again.. Sorry.. Quick related Q... Is there anyway to tell if a Tell or Ask failed, so that I can retry myself? I'd be happy if I could, a little like RabbitMQ, retry 3 times before giving up. Anecdotally, it seems that when you kill a node it takes 3 dropped messages for the rest of the cluster to figure out it has died and to then stop sending it messages
Andrey Leskov
@andreyleskov
Oct 11 2016 15:40
You can try Ask with timeout or expect a Failure in response
verilocation
@verilocation
Oct 11 2016 15:42
If I don't specify a Timeout will it wait indefinitely? Can I specify an app level timeout
Andrey Leskov
@andreyleskov
Oct 11 2016 15:45
Yes, we will be waiting forever. I'm not aware about specifying default timeout possibility 8 (
Bartosz Sypytkowski
@Horusiath
Oct 11 2016 16:48
@DamianReeves you roles are fixed at cluster startup, you cannot change them when the system is running
Arjen Smits
@Danthar
Oct 11 2016 17:09
@verilocation you can specify the global ask timeout in your hocon config.
Aaron Stannard
@Aaronontheweb
Oct 11 2016 17:19
@mmisztal1980 you'd want to use a Docker network
and using something like Docker Swarm or Mesos or etc, pull the addresses of other registered containers on that network acting like seeds
I've been using good old-fashioned Docker links to do that too
which isn't great for production stuff IMHO
fine for testing
Docker network is a NAT that can span multiple Docker Machines
so that's how you get containers on different boxes talking to each other
whereas a link, I think can span the network but it's a point-to-pint descriptor you have to pass in when launching the image
@Danthar lol yes... there are a bunch that need that
the design patterns one too
@raskolnikoov > is it possible to schedule the actorsystem scheduler to call an actor at random times every day?
hmmm....
not by default
but what you could do: send a message to an actor at fixed intervals and have the actor randomly decide whether to handle it or not
achieves the same thing, but backwards - you could put the "randomizer" in as a kind of facade actor
and have the randomizer, when it chooses to accept the message, pass the message along to the real actor downstream
Aaron Stannard
@Aaronontheweb
Oct 11 2016 17:24
other possibility is instead of using "tell repeatedly"
you could just generate a random schedule of single "tell once" calls to the actor
and do that once a day or something
you can also use the IScheduler.Advanced to call a method
and use a RNG in there to determine whether or not to send a message to an actor
any one of those would work