1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

proxy publish

This commit is contained in:
Asim Aslam 2019-02-23 17:06:17 +00:00
parent f1df0f6dfe
commit b8f20924cc

View File

@ -515,8 +515,15 @@ func (r *rpcClient) Publish(ctx context.Context, msg Message, opts ...PublishOpt
md["Micro-Topic"] = msg.Topic()
md["Micro-Id"] = id
// get the routing exchange
// set the topic
topic := msg.Topic()
// get proxy
if prx := os.Getenv("MICRO_PROXY"); len(prx) > 0 {
options.Exchange = prx
}
// get the exchange
if len(options.Exchange) > 0 {
topic = options.Exchange
}