public SubscriberManagerActor(string groupname) { this.groupname = groupname; //this.subscriptionManager = MarketEventSubscription.For(Context.System); //this.subscriptionManager.Subscribe("fzf007", Self,this.groupname); this.distributedPubSub = DistributedPubSubService.For(Context.System); distributedPubSub.Subscribe("fzf007", Self, this.groupname); Receive <SubscribeAck>(p => { Console.WriteLine("Path:{0}", p.Subscribe); }); Receive <ITradeEvent>(p => { //Console.WriteLine(Sender.Path); Console.WriteLine($"GroupName:{this.groupname}{this.Self.Path}--{p.Body}"); // Sender.Tell($"Repy:{Guid.NewGuid().ToString("N")}"); }); }
protected override void PreStart() { base.PreStart(); pubSubServicemediator.Subscribe(topicname, Self, this.groupname); }