You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2023/03/08 05:58:54 UTC
[rocketmq-clients] 01/02: Polish code
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit 885efc9ad86923b1f27dd74521af90416f1cce19
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Wed Mar 8 11:11:00 2023 +0800
Polish code
---
csharp/examples/QuickStart.cs | 3 ++-
csharp/rocketmq-client-csharp/ClientMeterManager.cs | 4 +---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/csharp/examples/QuickStart.cs b/csharp/examples/QuickStart.cs
index d9730cff..2d4a674d 100644
--- a/csharp/examples/QuickStart.cs
+++ b/csharp/examples/QuickStart.cs
@@ -21,9 +21,10 @@ namespace examples
{
public static void Main()
{
- ProducerNormalMessageExample.QuickStart().Wait();
+ // ProducerNormalMessageExample.QuickStart().Wait();
// ProducerFifoMessageExample.QuickStart().Wait();
// ProducerDelayMessageExample.QuickStart().Wait();
+ // ProducerTransactionMessageExample.QuickStart().Wait();
// SimpleConsumerExample.QuickStart().Wait();
// ProducerBenchmark.QuickStart().Wait();
}
diff --git a/csharp/rocketmq-client-csharp/ClientMeterManager.cs b/csharp/rocketmq-client-csharp/ClientMeterManager.cs
index e8eed8d8..a639c984 100644
--- a/csharp/rocketmq-client-csharp/ClientMeterManager.cs
+++ b/csharp/rocketmq-client-csharp/ClientMeterManager.cs
@@ -36,7 +36,6 @@ namespace Org.Apache.Rocketmq
private readonly Client _client;
private volatile ClientMeter _clientMeter;
private readonly HttpClient _httpClient;
- private readonly object _lock;
internal readonly Meter Meter;
public ClientMeterManager(Client client)
@@ -45,7 +44,6 @@ namespace Org.Apache.Rocketmq
var httpDelegatingHandler = new MetricHttpDelegatingHandler(client);
_httpClient = new HttpClient(httpDelegatingHandler);
_clientMeter = ClientMeter.DisabledInstance(_client.GetClientId());
- _lock = new object();
Meter = new Meter(MeterName, Version);
}
@@ -56,7 +54,7 @@ namespace Org.Apache.Rocketmq
public void Reset(Metric metric)
{
- lock (_lock)
+ lock (this)
{
var clientId = _client.GetClientId();
if (_clientMeter.Satisfy(metric))