Reputation: 31
I am using Ocelot together with Consul to perform dynamic routing. Which works great. In addition, I am configuring aggregates, like:
{
"Aggregates": [
{
"UpstreamPathTemplate": "/modules/dashboard/options",
"RouteKeys": [
"ServiceADashboardOptions",
"ServiceBDashboardOptions"
],
"Aggregator": "ArrayAggregator"
}
}
Which works great. However, I would like to dynamically define the routes to be used for the aggregation based on tags a service has, when it is used in Consul.
In the example above, a service with the tag "dashboard" should be automatically considered for the aggregation. I don't know which services exists and how they are named at the point of configuration, but if they implement a feature the route pattern is defined.
I could see the following possibilities to achieve this behaviour:
Are there any recommendations on which of the approaches would be conceptually correct. In short, what I would like to achieve is to create a dynamic aggregate route combining multiple service without knowing upfront which services exists or how they are names.
Upvotes: 0
Views: 48