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

Akka.Hosting alternatives for HOCON sections #549

Open
object opened this issue Jan 10, 2025 · 4 comments
Open

Akka.Hosting alternatives for HOCON sections #549

object opened this issue Jan 10, 2025 · 4 comments

Comments

@object
Copy link

object commented Jan 10, 2025

We are working of customizing actor type names on Phobos dashboards, and according to @Aaronontheweb some of our issues may be caused by using legacy HOCON sections. We import several HOCON sections using AddHocon extension method, and I would like to check if this can affect Phobos actor type names customization, and if so, what can we do instead. And it would be nice to have a programmatic way of configuring Akka without fallback to AddHocon.

So here is the list of use cases where we need to call AddHocon method.

  1. "actor.deployment" to configure routers. Examples:
deployment {
  "/webapi_upload" {
    router = round-robin-pool
    nr-of-instances = 10
  }
}

deployment {
  "/s3_ingesters" {
    router = broadcast-pool
    cluster {
      enabled = on
      max-total-nr-of-instances = 50
      max-nr-of-instances-per-node = 10
      allow-local-routees = on
      use-role = GlobalConnect
    }
  }
}

As far as I understood, this could prevent Phobos actory type name customization, so how else we can configure routers, both non-clustered and clustered? And disregarding Phobos, shouldn't Akka.Hosting provide a programmatic way to configure deployment?

  1. Configuring serializers: "serializers", "serialization-bindings", "serialization-identifiers"
  2. Configuring log level: "akka.stdout-loglevel", can this be done without using AddHocon?
  3. Configuring Petabridge cmd port: "petabridge.cmd.port"
  4. Configuring Azure table for discovery: "akka.discovery.azure.table-name"
  5. Configuring downing provider: "akka.cluster.downing-provider-class"
  6. Configuring Akka extensions: "akka.extensions"
  7. Fallbacks for cluster sharding:
.AddHocon(
	ClusterSharding
	    .DefaultConfig()
	    .WithFallback(ClusterSingleton.DefaultConfig())
	    .WithFallback(DistributedPubSub.DefaultConfig())
	    .WithFallback(ClusterClientReceptionist.DefaultConfig())
	    .WithFallback(Akka.DistributedData.DistributedData.DefaultConfig()),
	HoconAddMode.Append
)

@Arkatufus
Copy link
Contributor

  1. For deployment, we decided early on during Akka.Hosting development that we would consider this as "advanced feature" and would not be covered by Akka.Hosting fluent builder. This does not exclude the possibility that we might add deployment support in the future.
  2. We already have this implemented.
    builder.WithCustomSerializer(
      serializerIdentifier: "my-serializer-name", 
      boundTypes: new Type[]{ typeof(MySerializedClass) },
      serializerFactory: sys => new MySerializer(sys));
  3. You can use ConfigureLoggers:
    builder.ConfigureLoggers(config => {
      config.LogLevel = LogLevel.WarningLevel;
    });
  4. You can use this extension method:
    builder.AddPetabridgeCmd(
      opt => {
        opt.Host = "localhost";
        opt.Port = 9999;
      },
      config => {
        // Configure command palletes here
      }
    );
  5. You can configure Akka.Discovery.Azure table name by using the AkkaDiscoveryOptions:
    builder.WithAzureDiscovery(opt => {
      opt.TableName = "myazuretablename";
    });
  6. We'll take this into consideration. Can you make this into its own separate GitHub issue?
  7. You can use WithExtensions()
    builder.WithExtensions(typeof(MyCustomAkkaExtension1), typeof(MyCustomAkkaExtension2));
  8. We already added these defaults in the WithShardRegion() extension method. Can you open a new github issue for this, if it does not work for you?

@object
Copy link
Author

object commented Jan 10, 2025

But Phobos customizes actor name using deployment section? Can HOCON-based deployment configuration interfere with it? Because we seen to have problems customizing actor type names.

@Aaronontheweb
Copy link
Member

But Phobos customizes actor name using deployment section? Can HOCON-based deployment configuration interfere with it? Because we seen to have problems customizing actor type names.

Phobos can customize the actor name using deployment but it can also do it using the fluent interface on Props.WithInstrumentation - ultimately, the HOCON-based deployment stuff all calls those API methods.

@object
Copy link
Author

object commented Jan 10, 2025

Then I need a description of the extension method.

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

3 participants