Skip to content

Simplify loading of reference.conf for default configuration #502

@Aaronontheweb

Description

@Aaronontheweb

Description

Currently, users need to manually load the reference.conf from assembly resources to get the default Akka.Streams.Kafka configuration:

builder.AddHocon(
    ConfigurationFactory.FromResource<ConsumerSettings<object, object>>(
        "Akka.Streams.Kafka.reference.conf"), HoconAddMode.Append);

This approach is:

  • Not intuitive for new users
  • Error-prone (easy to forget)
  • Verbose and requires knowledge of internal resource names

Proposed Solution

It would be beneficial to have a simpler way to include the default configuration, perhaps through:

  • An extension method that automatically loads the reference.conf
  • A static property/method on ProducerSettings/ConsumerSettings that provides the default config
  • Automatic loading of reference.conf when the assembly is referenced

Current Workaround

Users must manually load the configuration as shown above, which adds unnecessary boilerplate to every Akka.Streams.Kafka application.

Example Use Cases

This affects both producer and consumer configurations where users want to start with sensible defaults and only override specific settings like bootstrap servers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions