by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 13 06:31
    dependabot-preview[bot] labeled #166
  • Aug 13 06:31
    dependabot-preview[bot] opened #166
  • Aug 13 06:31

    dependabot-preview[bot] on nuget

    Bump Docker.DotNet from 3.125.2… (compare)

  • Aug 12 17:44

    dependabot-preview[bot] on nuget

    (compare)

  • Aug 12 17:44

    dependabot-preview[bot] on dev

    Bump Microsoft.NET.Test.Sdk fro… (compare)

  • Aug 12 17:44
    dependabot-preview[bot] closed #164
  • Aug 12 17:44
    Aaronontheweb commented #164
  • Aug 12 17:24
    dependabot-preview[bot] synchronize #164
  • Aug 12 17:24

    dependabot-preview[bot] on nuget

    Bump Microsoft.NET.Test.Sdk fro… (compare)

  • Aug 12 17:24
    dependabot-preview[bot] edited #164
  • Aug 12 17:23
    dependabot-preview[bot] edited #164
  • Aug 12 17:23

    dependabot-preview[bot] on nuget

    (compare)

  • Aug 12 17:23

    dependabot-preview[bot] on dev

    Bump System.Data.SqlClient from… (compare)

  • Aug 12 17:23
    dependabot-preview[bot] closed #165
  • Aug 12 17:05
    dependabot-preview[bot] synchronize #165
  • Aug 12 17:05

    dependabot-preview[bot] on nuget

    Bump System.Data.SqlClient from… (compare)

  • Aug 12 17:05
    dependabot-preview[bot] edited #165
  • Aug 12 17:04
    dependabot-preview[bot] edited #165
  • Aug 12 17:04
    dependabot-preview[bot] edited #165
  • Aug 12 17:04
    Aaronontheweb commented #165
Aaron Stannard
@Aaronontheweb
which does that for you behind-the-scenes
feng3245
@feng3245
By manually composing actorselection s do you mean you must have the host address/name as well?
Aaron Stannard
@Aaronontheweb
yes you do
but that data gets exposed on the Member property of the MemberUp and MemberRemoved events
so all you have to do to compose an ActorSelection is something like var actorpath = new RootActorPath(member.Address) / "user" / "foo"
Context.ActorSelection(actorpath).Tell("bar");
no need for string manipulation
the / operator is overloaded on the ActorPath class
and RootActorPath will take an Address as a starting argument
you can see where we do this here
does that help?
feng3245
@feng3245
Say if I use actorselection to get actor ref of node1 then requests will only go to node1 right?
@Aaronontheweb forgot @
Aaron Stannard
@Aaronontheweb
correct
those messages only go to node 1
since an ActorSelection addresses only a single node explicitly
feng3245
@feng3245
kind of defeats the purpose of clustering but It's probably something I'd use since the code is closely tied to remoting and ask right now but with multiple addresses which are available
feng3245
@feng3245
Next step would be to add an abstraction on top of ActorSelection and Ask that does the pub sub
Alex Hofer
@alexhofer
@Aaronontheweb can you comment on what ActorProducerPluginBase might be replaced with? We are using it currently and wanna switch to the new thing if its in place already. Or keep it on our radar whenever its replacement arrives :)
Aaron Stannard
@Aaronontheweb
kind of defeats the purpose of clustering but It's probably something I'd use since the code is closely tied to remoting and ask right now but with multiple addresses which are available
I wouldn't say that
the purpose of clustering is to make you AWARE OF WHO IS IN THE NETWORK
and any given time
that's what the events are for
if you want to make WHO YOU ARE COMMUNICATING WITH transparent
use a tool like a clustered router
you can just Ask the router
and it will do the right thing
and hide all of those implementation details
can you comment on what ActorProducerPluginBase might be replaced with? We are using it currently and wanna switch to the new thing if its in place already. Or keep it on our radar whenever its replacement arrives :)
@alexhofer at the moment, that issue looks like something more complicated than I originally anticipated
I don't think it's going to get replaced necessarily since it contains some context-specific data inside of it
but the way we propagate that data inside Props is just really odd today
Blue
@heyixiaoran
@Aaronontheweb tks. It's work. Now sender publish a topic and receiver subscribe a topic. Then sender can send a message to receiver. Can I get the sender path when receive message and send a message back use the path ?
DSanchen
@DSanchen
Someone any Idea why resolving an actor (created with ActorOfAsTestActorRef) can fail sometimes ??
tkeegan-ealink
@tkeegan-ealink
I have been reading about the use of async/await (or more to the point the warning not to), as i understand it...it is generally safe to use the async/await at the beginning (i.e. prior to entering into the actor system)....but what if within the actor it is going to call async methods on other classes?
In particular, i have a command, class that defines an async Execute method, which will internally perform an Ask on a target actor. This is working fine if i am calling it from a controller....Can someone tell me if i going to expect issues if i were to call the same Execute method from within another actor....and how i should address this?
Blue
@heyixiaoran
@Aaronontheweb Hi . I use shard and run one lighthouse ,sender1 and receiver1. receiver1 can receive messages from sender1. Then run sender2 and receiver2. sender1 and receiver1 still receive the messages. How can make one message just received by one receiver ? I mean one message just handle once.
using (var system = ActorSystem.Create(_systemName, _config.WithFallback(ClusterClientReceptionist.DefaultConfig())
                                                                       .WithFallback(DistributedPubSub.DefaultConfig())))
            {
                var shardRegion = ClusterSharding.Get(system).Start(
                    nameof(SenderActor),
                    Props.Create<SenderActor>(),
                    ClusterShardingSettings.Create(system).WithRole(Roles.Sharding),
                    new MessageExtractor());

                for (int i = 0; i < 100; i++)
                {
                    Thread.Sleep(2000);
                    shardRegion.Tell(new ShardEnvelope("1", "1", "test" + i));
                }

                system.WhenTerminated.Wait();
            }


public class SenderActor : ReceiveActor
    {
        private readonly IActorRef _mediator = DistributedPubSub.Get(Context.System).Mediator;

        public SenderActor()
        {
            Receive<string>(msg =>
            {
                Console.WriteLine(msg);

                _mediator.Tell(new Publish(Topics.SendMessageTopic, msg));
            });
        }
    }

public class ReceiverActor : ReceiveActor
    {
        private readonly IActorRef _mediator = DistributedPubSub.Get(Context.System).Mediator;

        public ReceiverActor()
        {
            Receive<string>(msg =>
            {
                Console.WriteLine(msg);
            });
        }

        protected override void PreStart()
        {
            base.PreStart();
            _mediator.Tell(new Subscribe(Topics.SendMessageTopic, Self));
        }

        protected override void PostStop()
        {
            _mediator.Tell(new Unsubscribe(Topics.SendMessageTopic, Self));
            base.PostStop();
        }
    }
tkeegan-ealink
@tkeegan-ealink
@heyixiaoran Could you not look at having a coordinating/validation actor that both will consult before processing the message. If the message has not been processed, then the coordinator will emit a new message back to the sender to tell it to process it.
Dan
@ctrlaltdan
Hey everyone. I've been using cluster sharding in a development/CI environment for a while now and this error I'm getting is a recurring theme. The only way I can get my application back on track is to clear the event journal and allow the application to start from fresh...
Is there a bug here or have I configured something incorrectly?
I am using Kubernetes pods so each deployment will (or is highly likely to) have a new address. As the error states, there is no region deployed to that address (verified by lighthouse and PBM tool)
If I'm correct, in this instance, should the shard region not be reallocated?
Error:
[09:59:17 ERR] Exception in ReceiveRecover when replaying event type [Akka.Cluster.Sharding.PersistentShardCoordinator+ShardHomeAllocated] with sequence number [9] for persistenceId [/system/sharding/customerCoordinator/singleton/coordinator]
System.ArgumentException: Region [akka.tcp://imburse@10.240.0.79:8081/system/sharding/customer#594538619] not registered
Parameter name: e
   at Akka.Cluster.Sharding.PersistentShardCoordinator.State.Updated(IDomainEvent e)
   at Akka.Cluster.Sharding.PersistentShardCoordinator.ReceiveRecover(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Persistence.Eventsourced.<>c__DisplayClass91_0.<Recovering>b__1(Receive receive, Object message)
Alex Michel
@amichel
Hi, I'm using a sharded cluster, where actor hosted in shards is creating child actor that is router with broadcast group. That's basically the only purpose of that top level actor, which seems redundant to me, just causing overhead of many messages passed for no real reason. Is it possible to host router directly in the shard region.
I tried to pass it in props using Props.Create<MyActor>().WithRouter(new BroadCastGroup()), but now messages always end in dead letter.
feng3245
@feng3245
@Aaronontheweb But what if the router is down? We are assuming the router have redundancy as well?
Alex Hofer
@alexhofer
@Aaronontheweb right on, thanks! We will put a comment in that it might change someday but just keep working with it :)
feng3245
@feng3245
@Aaronontheweb Is there anything that the resolve one is using? This need to be mocked to return good
Andre Loker
@aloker
@Aaronontheweb Hi there, first of all thanks (to you and the rest of the contributers) for this great framework. It has changed the way I'm thinking about certain software problems. However, I'm experiencing a showstopping bug in PersistentFSM which I was already able to fix (akkadotnet/akka.net#3655). The issue is pretty severe for us but easy to fix (two lines of code). Is there a chance to have this fix available on NuGet in a prerelease of 1.3.11?
Blue
@heyixiaoran
@tkeegan-ealink how to write it ? can you show me a demo ?
Bartosz Sypytkowski
@Horusiath
@amichel depends on what do you want to broadcast. In theory you can take a list of currently active sharded entities, but there is no such things as all entities (as they may come and go when needed). Also IMO using routers with sharding is not a great idea (especially when your routers use static configuration, while sharded actors location is dynamic).
@dubs999 what journal are you using for sharding?
Dan
@ctrlaltdan
@Horusiath I'm using the SQL Server driver at the moment. Happy to switch if this is causing the issue.
reuveniy
@reuveniy
I am looking at akka net clustering using Consul for discovery. Is anyone running a similar setup? [ was looking at https://github.com/Horusiath/Akka.Cluster.Discovery but that requires seed nodes to be available using the public-host + port (not public port) which is not my case ] . I was thinking on a simple solution in which each "node" is registering using "consul/service" tag, distinguishing itself by service name and tag. than akka query these when a node is starting it tries to join one of the registered nodes in the cluster, on success it will register itself or just start emitting a healthy healthcheck. Is that some sound or anyone has some advise here.