Skip to content

Commit

Permalink
Fixed topic kind name for Kubernetes (#1627)
Browse files Browse the repository at this point in the history
* Fixed topic kind name for Kubernetes

* do not register topics on clients
  • Loading branch information
marcinbudny authored May 30, 2022
1 parent 4dde62e commit 4ad9e64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Proto.Cluster/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public async Task StartClientAsync()

private async Task BeginStartAsync(bool client)
{
InitClusterKinds();
InitClusterKinds(client);
Provider = Config.ClusterProvider;
//default to partition identity lookup
IdentityLookup = Config.IdentityLookup;
Expand Down Expand Up @@ -147,14 +147,15 @@ private void InitPidCacheTimeouts()
}
}

private void InitClusterKinds()
private void InitClusterKinds(bool client)
{
foreach (var clusterKind in Config.ClusterKinds)
{
_clusterKinds.Add(clusterKind.Name, clusterKind.Build(this));
}

EnsureTopicKindRegistered();
if(!client)
EnsureTopicKindRegistered();

if (System.Metrics.Enabled)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Proto.Cluster/PubSub/TopicActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Proto.Cluster.PubSub;

public sealed class TopicActor : IActor
{
public const string Kind = "$topic";
public const string Kind = "prototopic"; // only alphanum in the name, to maximize chances it works on all clustering providers

private static readonly ILogger Logger = Log.CreateLogger<TopicActor>();
private ImmutableHashSet<SubscriberIdentity> _subscribers = ImmutableHashSet<SubscriberIdentity>.Empty;
Expand Down

0 comments on commit 4ad9e64

Please sign in to comment.