Skip to content

History Client looks for 'config' field in JSON, which is not there. #40

@cvonelm

Description

@cvonelm
void HistoryClient::config(const metricq::json& config)
{
    history_config(config);

    if (!history_exchange_.empty() &&
        config["historyExchange"].get<std::string>() != history_exchange_)
    {
        log::fatal("changing historyExchange on the fly is not currently supported");
        std::abort();
    }

    history_exchange_ = config["historyExchange"].get<std::string>();
    history_queue_ = config["historyQueue"].get<std::string>();

    on_history_config(config["config"]);

    setup_history_queue();

    on_history_ready();
}

The call to on_history_config["config"]) fails because the config json does not seem to contain a config field. Uncommenting the call to on_history_config (which is a callback one has to implement in the specialization of the HistoryClient, but which does not need to do anything). results in correct results.

This issue can be replicated with the history client example program contained in this repository.

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