Skip to content

Commit e6bd78f

Browse files
Merge pull request #297 from Crabzmatic/accumulated-consumers
Don't call BasicConsume inside Call method #296
2 parents 08d5748 + 12fbf18 commit e6bd78f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dotnet/RPCClient/RPCClient.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public RpcClient()
3434
var response = Encoding.UTF8.GetString(body);
3535
tcs.TrySetResult(response);
3636
};
37+
38+
channel.BasicConsume(
39+
consumer: consumer,
40+
queue: replyQueueName,
41+
autoAck: true);
3742
}
3843

3944
public Task<string> CallAsync(string message, CancellationToken cancellationToken = default(CancellationToken))
@@ -52,11 +57,6 @@ public RpcClient()
5257
basicProperties: props,
5358
body: messageBytes);
5459

55-
channel.BasicConsume(
56-
consumer: consumer,
57-
queue: replyQueueName,
58-
autoAck: true);
59-
6060
cancellationToken.Register(() => callbackMapper.TryRemove(correlationId, out var tmp));
6161
return tcs.Task;
6262
}

0 commit comments

Comments
 (0)