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 85ae3d541f06034e2e5dbd5130b4d706c4fbd79c Author: Aaron Ai <[email protected]> AuthorDate: Mon Feb 13 20:28:59 2023 +0800 Add more logs --- csharp/examples/QuickStart.cs | 4 ++-- csharp/rocketmq-client-csharp/Client.cs | 10 +++++++--- csharp/rocketmq-client-csharp/Producer.cs | 2 +- csharp/rocketmq-client-csharp/SimpleConsumer.cs | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/csharp/examples/QuickStart.cs b/csharp/examples/QuickStart.cs index 8323218f..474d6063 100644 --- a/csharp/examples/QuickStart.cs +++ b/csharp/examples/QuickStart.cs @@ -27,11 +27,11 @@ namespace examples { // Console.WriteLine(MetadataConstants.Instance.ClientVersion); - // ProducerNormalMessageExample.QuickStart().Wait(); + ProducerNormalMessageExample.QuickStart().Wait(); // await ProducerFifoMessageExample.QuickStart(); // await ProducerDelayMessageExample.QuickStart(); // await SimpleConsumerExample.QuickStart(); - ProducerBenchmark.QuickStart(); + // ProducerBenchmark.QuickStart(); } } } \ No newline at end of file diff --git a/csharp/rocketmq-client-csharp/Client.cs b/csharp/rocketmq-client-csharp/Client.cs index afbfbe5b..9d4d7e69 100644 --- a/csharp/rocketmq-client-csharp/Client.cs +++ b/csharp/rocketmq-client-csharp/Client.cs @@ -134,7 +134,7 @@ namespace Org.Apache.Rocketmq } } - protected abstract ICollection<string> GetTopics(); + protected abstract IEnumerable<string> GetTopics(); protected abstract Proto::HeartbeatRequest WrapHeartbeatRequest(); @@ -156,10 +156,14 @@ namespace Org.Apache.Rocketmq foreach (var endpoints in newEndpoints) { var (created, session) = GetSession(endpoints); - if (created) + if (!created) { - await session.SyncSettings(true); + continue; } + + Logger.Info($"Begin to establish session for endpoints={endpoints}, clientId={ClientId}"); + await session.SyncSettings(true); + Logger.Info($"Establish session for endpoints={endpoints} successfully, clientId={ClientId}"); } _topicRouteCache[topic] = topicRouteData; diff --git a/csharp/rocketmq-client-csharp/Producer.cs b/csharp/rocketmq-client-csharp/Producer.cs index 7803e2aa..170dbeab 100644 --- a/csharp/rocketmq-client-csharp/Producer.cs +++ b/csharp/rocketmq-client-csharp/Producer.cs @@ -61,7 +61,7 @@ namespace Org.Apache.Rocketmq } } - protected override ICollection<string> GetTopics() + protected override IEnumerable<string> GetTopics() { return _publishingTopics.Keys; } diff --git a/csharp/rocketmq-client-csharp/SimpleConsumer.cs b/csharp/rocketmq-client-csharp/SimpleConsumer.cs index 0481f7e8..8a8922fd 100644 --- a/csharp/rocketmq-client-csharp/SimpleConsumer.cs +++ b/csharp/rocketmq-client-csharp/SimpleConsumer.cs @@ -79,7 +79,7 @@ namespace Org.Apache.Rocketmq Logger.Info($"The rocketmq simple consumer starts successfully, clientId={ClientId}"); } - protected override ICollection<string> GetTopics() + protected override IEnumerable<string> GetTopics() { return _subscriptionExpressions.Keys; }
