From b8f20924cc2107b0bde8fe8a76fd79f6a412fb6a Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Sat, 23 Feb 2019 17:06:17 +0000 Subject: [PATCH] proxy publish --- client/rpc_client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/rpc_client.go b/client/rpc_client.go index b50f79f9..0e05dae9 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -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 }