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 }