Skip to content

PulsarStandaloneBuilder does not use a custom configuration set with withConfig() #7492

@horsteff

Description

@horsteff

Describe the bug
PulsarStandaloneBuilder does not use a custom configuration set with withConfig(). It's clearly visible in the code:

    public PulsarStandalone build() {
        ServiceConfiguration config = new ServiceConfiguration();
        config.setClusterName("standalone");
        pulsarStandalone.setConfig(config);
        ...

At the beginning of PulsarStandaloneBuilder.build() a new ServiceConfiguration instance is created and set with pulsarStandalone.setConfig() overwriting any configuration instance set earlier with PulsarStandaloneBuilder.withConfig().

Additionally unlike in PulsarStandaloneStarter the PulsarStandaloneBuilder does not evaluate the configuration file for the ServiceConfiguration, so only options for LocalBookkeeperEnsemble (via the ServerConfiguration class evaluation in PulsarStandalone.start()) will be read from the configuration file, all other (e.g. managedLedgerDefaultEnsembleSize) will be ignored.

Expected behavior
PulsarStandaloneBuilder uses a custom configuration if one is set with withConfig() and should create a new ServiceConfiguration instance only if no custom configuration was set.

The configuration file is evaluated when PulsarStandalone is initialized by PulsarStandaloneBuilder.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions