Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 4 and Lesson 5 discrepancies #118

Open
Arkatufus opened this issue Aug 12, 2020 · 0 comments
Open

Lesson 4 and Lesson 5 discrepancies #118

Arkatufus opened this issue Aug 12, 2020 · 0 comments

Comments

@Arkatufus
Copy link
Contributor

Arkatufus commented Aug 12, 2020

There's a discrepancy between the lesson and the git result of lesson 4 in Akka.CQRS.Pricing.Service app.conf.

Discrepancy 1

Lesson 4 asks the student to add these lines into the HOCON config:

	cluster {
		#will inject this node as a self-seed node at run-time
		seed-nodes = ["akka.tcp://[email protected]:6055"] 
		roles = ["pricing-engine" , "trade-events"]
		pub-sub{
			role = "trade-events"
		}
		sharding{
			role = "pricing-engine"
			state-store-mode = ddata
		}
		client.receptionist.role = pricing-engine # stops ClusterClient gossip from going to the worker nodes
	}

but the app.conf in the git repo for lesson 5 contains these:

	cluster {
		#will inject this node as a self-seed node at run-time
		seed-nodes = ["akka.tcp://[email protected]:6055"] 
		roles = ["pricing-engine" , "trade-events"]
		pub-sub{
			role = "trade-events"
		}
		sharding{
			role = "pricing-engine"
			state-store-mode = ddata
		}
		client.receptionist.role = pricing-engine # stops ClusterClient gossip from going to the worker nodes
		price-singleton{
			singleton-name = "price-initiator"
			role = "pricing-engine"
			hand-over-retry-interval = 1s
			min-number-of-hand-over-retries = 10
		}
	}

The price-singleton sub config was missing from the lesson.

Discrepancy 2

The Akka.CQRS.Pricing.Service/Program.cs file has been updated with the price initiator update (#57), the source listing on the lesson needs to be updated with the var priceInitiatorActor line:

var shardRegion = sharding.Start("priceAggregator",
                s => Props.Create(() => new MatchAggregator(s)),
                ClusterShardingSettings.Create(actorSystem),
                new StockShardMsgRouter());

            var priceInitiatorActor = actorSystem.ActorOf(ClusterSingletonManager.Props(Props.Create(() => new PriceInitiatorActor(shardRegion)),
                ClusterSingletonManagerSettings.Create(actorSystem).WithRole("pricing-engine").WithSingletonName("priceInitiator")), "priceInitiator");

            var clientHandler =
                actorSystem.ActorOf(Props.Create(() => new ClientHandlerActor(shardRegion)), "subscriptions");

Discrepancy 3

The Akka.CQRS.TradeProcessor.Service/Program.cs has been updated, the source listing on the lesson needs to be updated.
The lesson asks the student to replace this line:

var orderBooks = actorSystem.ActorOf(Props.Create(() => new OrderBookMasterActor()), "orderbooks");

with this:

var shardRegion = sharding.Start("orderBook", s => OrderBookActor.PropsFor(s), ClusterShardingSettings.Create(actorSystem),
        new StockShardMsgRouter());

but on the dev branch, the code has been updated to:

            Cluster.Cluster.Get(actorSystem).RegisterOnMemberUp(() =>
            {
                var sharding = ClusterSharding.Get(actorSystem);

                var shardRegion = sharding.Start("orderBook", s => OrderBookActor.PropsFor(s), ClusterShardingSettings.Create(actorSystem),
                    new StockShardMsgRouter());
            });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant