Table of Contents

Class HttpRemoteConfigSource

Namespace
JD.AI.Core.Config
Assembly
JD.AI.Core.dll

Fetches configuration from an HTTP endpoint. Compatible with Consul KV, Azure App Configuration REST API, Spring Cloud Config, or any endpoint that returns YAML/JSON configuration content.

public sealed class HttpRemoteConfigSource : IRemoteConfigSource, IDisposable
Inheritance
HttpRemoteConfigSource
Implements
Inherited Members

Constructors

HttpRemoteConfigSource(Uri, HttpClient?, ILogger?)

public HttpRemoteConfigSource(Uri endpoint, HttpClient? httpClient = null, ILogger? logger = null)

Parameters

endpoint Uri

URL to fetch configuration from.

httpClient HttpClient

Optional pre-configured HttpClient (e.g. with auth headers).

logger ILogger

Optional logger.

Properties

Name

Human-readable name of this config source (e.g. "consul", "http", "k8s-configmap").

public string Name { get; }

Property Value

string

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FetchAsync(CancellationToken)

Fetches the current configuration content from the remote source. Returns null if the source is unreachable or has no content.

public Task<RemoteConfigResult?> FetchAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<RemoteConfigResult>