场景
一个环境的微服务需要调用多个host地址的同一类型接口,需要根据参数反问不同host地址的接口
解决办法
以springcloud openFeign为例,
- 将第一个参数设置为:java.net.URI,如:
/**
* /loki/api/v1/push is the endpoint used to send log entries to Loki. The default behavior is for
* the POST body to be a snappy-compressed protobuf message:
*
* @param map { "streams": [ { "stream": { "label": "value" }, "values": [ [ "<unix epoch in
* nanoseconds>", "<log line>" ], [ "<unix epoch in nanoseconds>", "<log line>" ] ] } ] }
*/
@PostMapping("/loki/api/v1/push")