This is an automated email from the ASF dual-hosted git repository.

blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 23fa7fa  Make ready for release 2.2.0
23fa7fa is described below

commit 23fa7fa30da96bf95bd6553c3cc85a4a76ec0172
Author: Daniel Blankensteiner <[email protected]>
AuthorDate: Fri Feb 4 12:05:42 2022 +0100

    Make ready for release 2.2.0
---
 CHANGELOG.md                   |  2 +-
 samples/Consuming/Program.cs   | 20 ++++----------------
 samples/Processing/Worker.cs   |  2 +-
 samples/Producing/Program.cs   | 19 ++++---------------
 samples/Reading/Program.cs     | 19 ++++---------------
 src/DotPulsar/DotPulsar.csproj |  2 +-
 6 files changed, 15 insertions(+), 49 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a506630..19202dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this 
file.
 
 The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to 
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## [Unreleased]
+## [2.2.0] - 2022-02-04
 
 ### Added
 
diff --git a/samples/Consuming/Program.cs b/samples/Consuming/Program.cs
index 1ac1b20..998af08 100644
--- a/samples/Consuming/Program.cs
+++ b/samples/Consuming/Program.cs
@@ -25,8 +25,6 @@ internal static class Program
 {
     private static async Task Main()
     {
-        const string myTopic = "persistent://public/default/mytopic";
-
         var cts = new CancellationTokenSource();
 
         Console.CancelKeyPress += (sender, args) =>
@@ -35,12 +33,12 @@ internal static class Program
             args.Cancel = true;
         };
 
-        await using var client = PulsarClient.Builder().Build(); //Connecting 
to pulsar://localhost:6650
+        await using var client = PulsarClient.Builder().Build(); // Connecting 
to pulsar://localhost:6650
 
         await using var consumer = client.NewConsumer(Schema.String)
             .StateChangedHandler(Monitor)
             .SubscriptionName("MySubscription")
-            .Topic(myTopic)
+            .Topic("persistent://public/default/mytopic")
             .Create();
 
         Console.WriteLine("Press Ctrl+C to exit");
@@ -63,18 +61,8 @@ internal static class Program
 
     private static void Monitor(ConsumerStateChanged stateChanged, 
CancellationToken cancellationToken)
     {
-        var stateMessage = stateChanged.ConsumerState switch
-        {
-            ConsumerState.Active => "is active",
-            ConsumerState.Inactive => "is inactive",
-            ConsumerState.Disconnected => "is disconnected",
-            ConsumerState.Closed => "has closed",
-            ConsumerState.ReachedEndOfTopic => "has reached end of topic",
-            ConsumerState.Faulted => "has faulted",
-            _ => $"has an unknown state '{stateChanged.ConsumerState}'"
-        };
-
         var topic = stateChanged.Consumer.Topic;
-        Console.WriteLine($"The consumer for topic '{topic}' {stateMessage}");
+        var state = stateChanged.ConsumerState;
+        Console.WriteLine($"The consumer for topic '{topic}' changed state to 
'{state}'");
     }
 }
diff --git a/samples/Processing/Worker.cs b/samples/Processing/Worker.cs
index e753b52..caa9d54 100644
--- a/samples/Processing/Worker.cs
+++ b/samples/Processing/Worker.cs
@@ -28,7 +28,7 @@ public class Worker : BackgroundService
     {
         await using var client = PulsarClient.Builder()
             .ExceptionHandler(context => 
_logger.PulsarClientException(context))
-            .Build(); //Connecting to pulsar://localhost:6650
+            .Build(); // Connecting to pulsar://localhost:6650
 
         await using var consumer = client.NewConsumer(Schema.String)
             .StateChangedHandler(consumerStateChanged => 
_logger.ConsumerChangedState(consumerStateChanged))
diff --git a/samples/Producing/Program.cs b/samples/Producing/Program.cs
index 79045a3..48f5760 100644
--- a/samples/Producing/Program.cs
+++ b/samples/Producing/Program.cs
@@ -25,8 +25,6 @@ internal static class Program
 {
     private static async Task Main()
     {
-        const string myTopic = "persistent://public/default/mytopic";
-
         var cts = new CancellationTokenSource();
 
         Console.CancelKeyPress += (sender, args) =>
@@ -35,11 +33,11 @@ internal static class Program
             args.Cancel = true;
         };
 
-        await using var client = PulsarClient.Builder().Build(); //Connecting 
to pulsar://localhost:6650
+        await using var client = PulsarClient.Builder().Build(); // Connecting 
to pulsar://localhost:6650
 
         await using var producer = client.NewProducer(Schema.String)
             .StateChangedHandler(Monitor)
-            .Topic(myTopic)
+            .Topic("persistent://public/default/mytopic")
             .Create();
 
         Console.WriteLine("Press Ctrl+C to exit");
@@ -67,17 +65,8 @@ internal static class Program
 
     private static void Monitor(ProducerStateChanged stateChanged, 
CancellationToken cancellationToken)
     {
-        var stateMessage = stateChanged.ProducerState switch
-        {
-            ProducerState.Connected => "is connected",
-            ProducerState.Disconnected => "is disconnected",
-            ProducerState.PartiallyConnected => "is partially connected",
-            ProducerState.Closed => "has closed",
-            ProducerState.Faulted => "has faulted",
-            _ => $"has an unknown state '{stateChanged.ProducerState}'"
-        };
-
         var topic = stateChanged.Producer.Topic;
-        Console.WriteLine($"The producer for topic '{topic}' {stateMessage}");
+        var state = stateChanged.ProducerState;
+        Console.WriteLine($"The producer for topic '{topic}' changed state to 
'{state}'");
     }
 }
diff --git a/samples/Reading/Program.cs b/samples/Reading/Program.cs
index 88b9f7c..0e99433 100644
--- a/samples/Reading/Program.cs
+++ b/samples/Reading/Program.cs
@@ -25,8 +25,6 @@ internal static class Program
 {
     private static async Task Main()
     {
-        const string myTopic = "persistent://public/default/mytopic";
-
         var cts = new CancellationTokenSource();
 
         Console.CancelKeyPress += (sender, args) =>
@@ -35,12 +33,12 @@ internal static class Program
             args.Cancel = true;
         };
 
-        await using var client = PulsarClient.Builder().Build(); //Connecting 
to pulsar://localhost:6650
+        await using var client = PulsarClient.Builder().Build(); // Connecting 
to pulsar://localhost:6650
 
         await using var reader = client.NewReader(Schema.String)
             .StartMessageId(MessageId.Earliest)
             .StateChangedHandler(Monitor)
-            .Topic(myTopic)
+            .Topic("persistent://public/default/mytopic")
             .Create();
 
         Console.WriteLine("Press Ctrl+C to exit");
@@ -62,17 +60,8 @@ internal static class Program
 
     private static void Monitor(ReaderStateChanged stateChanged, 
CancellationToken cancellationToken)
     {
-        var stateMessage = stateChanged.ReaderState switch
-        {
-            ReaderState.Connected => "is connected",
-            ReaderState.Disconnected => "is disconnected",
-            ReaderState.Closed => "has closed",
-            ReaderState.ReachedEndOfTopic => "has reached end of topic",
-            ReaderState.Faulted => "has faulted",
-            _ => $"has an unknown state '{stateChanged.ReaderState}'"
-        };
-
         var topic = stateChanged.Reader.Topic;
-        Console.WriteLine($"The reader for topic '{topic}' {stateMessage}");
+        var state = stateChanged.ReaderState;
+        Console.WriteLine($"The reader for topic '{topic}' changed state to 
'{state}'");
     }
 }
diff --git a/src/DotPulsar/DotPulsar.csproj b/src/DotPulsar/DotPulsar.csproj
index 56a4b92..5b83fa3 100644
--- a/src/DotPulsar/DotPulsar.csproj
+++ b/src/DotPulsar/DotPulsar.csproj
@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
-    <Version>2.1.0</Version>
+    <Version>2.2.0</Version>
     <AssemblyVersion>$(Version)</AssemblyVersion>
     <FileVersion>$(Version)</FileVersion>
     <Authors>ApachePulsar,DanskeCommodities,dblank</Authors>

Reply via email to