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

fixing bugs with cluster consistent hash routing #14

Merged
merged 2 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k8s/tradeprocessor-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
app: trade-processor
spec:
serviceName: trade-processor
replicas: 1
replicas: 3
selector:
matchLabels:
app: trade-processor
Expand Down
1 change: 1 addition & 0 deletions src/Akka.CQRS.Pricing.Service/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ akka {

sharding{
role = "pricing-engine"
state-store-mode = ddata
}

client.receptionist.role = pricing-engine # stops ClusterClient gossip from going to the worker nodes
Expand Down
2 changes: 1 addition & 1 deletion src/Akka.CQRS.TradePlacers.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int Main(string[] args)
Props.Empty.WithRouter(new ClusterRouterGroup(
new ConsistentHashingGroup(new[] {"/user/orderbooks"},
TradeEventConsistentHashMapping.TradeEventMapping),
ClusterRouterGroupSettings.FromConfig(conf))), "tradesRouter");
new ClusterRouterGroupSettings(10000, new []{ "/user/orderbooks" }, true, useRole:"trade-processor"))), "tradesRouter");

Cluster.Cluster.Get(actorSystem).RegisterOnMemberUp(() =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/Akka.CQRS.TradePlacers.Service/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ akka {
provider = cluster

deployment{
/tradeRouter {
/tradesRouter {
router = consistent-hashing-group
routees.paths = ["/user/orderbooks"]
cluster {
Expand Down
1 change: 1 addition & 0 deletions src/Akka.CQRS.TradeProcessor.Service/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

sharding{
role = "trade-processor"
state-store-mode = ddata
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Akka.CQRS/Entities/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Akka.CQRS
/// <summary>
/// Represents an unfilled or partially unfilled trade inside the matching engine.
/// </summary>
public struct Order : IWithOrderId, IWithStockId, IEquatable<Order>, IComparable<Order>, IComparable
public sealed class Order : IWithOrderId, IWithStockId, IEquatable<Order>, IComparable<Order>, IComparable
{
/// <summary>
/// Represents an empty or completed trade.
Expand Down