-
Notifications
You must be signed in to change notification settings - Fork 905
How to expose cluster address resolution for backend-to-backend calls? #3004
Copy link
Copy link
Open
Description
YARP is designed around the reverse proxy pipeline, but I have a use case where I need to call downstream services directly from the backend.
Im working in a microservice orchestrator (BFF-style) architecture, where the backend aggregates JSON data (e.g., config, menus) from multiple services.
Ideally, Id like to reuse YARP’s cluster configuration and load balancing logic to resolve a destination and call it via HttpClient, something like:
var url = await yarpResolver.GetDestinationAsync(clusterId);
var result = await httpClient.GetAsync(url);Question
Is there a way to resolve a cluster destination (including load balancing/health checks) outside the proxy pipeline?
If not, would it make sense to expose something like:
public interface IClusterAddressResolver
{
ValueTask<Uri> GetDestinationAsync(string clusterId, CancellationToken cancellationToken = default);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels