mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-18 22:17:44 +02:00
proxy publish
This commit is contained in:
@ -515,8 +515,15 @@ func (r *rpcClient) Publish(ctx context.Context, msg Message, opts ...PublishOpt
|
|||||||
md["Micro-Topic"] = msg.Topic()
|
md["Micro-Topic"] = msg.Topic()
|
||||||
md["Micro-Id"] = id
|
md["Micro-Id"] = id
|
||||||
|
|
||||||
// get the routing exchange
|
// set the topic
|
||||||
topic := msg.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 {
|
if len(options.Exchange) > 0 {
|
||||||
topic = options.Exchange
|
topic = options.Exchange
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user