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

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

Open
cvonelm opened this issue May 13, 2024 · 0 comments · May be fixed by #41
Open

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

cvonelm opened this issue May 13, 2024 · 0 comments · May be fixed by #41

Comments

@cvonelm
Copy link

cvonelm commented May 13, 2024

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.

bmario added a commit that referenced this issue May 13, 2024
@bmario bmario linked a pull request May 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant