13#ifndef CONSULSERVICEREGISTRYADAPTER_HPP
14#define CONSULSERVICEREGISTRYADAPTER_HPP
17#include <ppconsul/agent.h>
40 const std::string& service_name,
41 const bool health_check)
override;
45 bool IsComponent(
const ppconsul::ServiceInfo& service_info);
50 static const std::string CONSUL_COMMON_SERVICE;
51 static const std::string CONSUL_COMPONENT_NAME_KEY;
52 static const std::string CONSUL_ENDPOINT_TYPE_KEY;
53 static const std::string CONSUL_ENDPOINT_URI_KEY;
54 static const std::string RUNTIME_REPO_ENDPOINT;
55 static const std::string PERSISTENT_REPO_ENDPOINT;
56 static const std::string OLDB_ENDPOINT;
57 std::unique_ptr<ppconsul::Consul> m_consul_client;
58 std::unique_ptr<ppconsul::agent::Agent> m_consul_agent;
59 std::map<std::string, ppconsul::ServiceInfo> services;
Class that implements a very basic service discovery mechanism using Consul.
Definition: consulServiceRegistryAdapter.hpp:33
ServiceEndpoint GetPersistentRepoEndpoint() override
Get the Persistent Repository Endpoint from the service registry.
Definition: consulServiceRegistryAdapter.cpp:208
std::vector< std::string > ListComponents() override
Get known components.
Definition: consulServiceRegistryAdapter.cpp:161
static const std::string SUPPORTED_URI_SCHEME
Definition: consulServiceRegistryAdapter.hpp:35
bool IsComponent(const ppconsul::ServiceInfo &service_info)
Definition: consulServiceRegistryAdapter.cpp:212
ServiceEndpoint GetRuntimeRepoEndpoint() override
Get the Runtime Repository Endpoint from the service registry.
Definition: consulServiceRegistryAdapter.cpp:203
ServiceEndpoint GetOldbEndpoint() override
Get the Oldb Endpoint from the service registry.
Definition: consulServiceRegistryAdapter.cpp:198
ServiceEndpoint Get(const std::string &comp_name, const std::string &service_name, const bool health_check) override
Get endpoint of specific service of a specific component.
Definition: consulServiceRegistryAdapter.cpp:58
ppconsul::ServiceInfo GetComponentDefinedInConsul(const std::string &comp_name, const std::string &service_name)
Definition: consulServiceRegistryAdapter.cpp:224
Class that implements a service registry to be used by the service discovery.
Definition: serviceRegistryIf.hpp:31
elt::mal::Uri ServiceEndpoint
Definition: serviceRegistryIf.hpp:43
Header file for DataPointPath.
Definition: commandReplier.cpp:22
Class that implements the service registry interface.