diff --git a/docs/examples/csharp/subscribe/Program.cs b/docs/examples/csharp/subscribe/Program.cs index 2ec73aae48..50988d0c5d 100644 --- a/docs/examples/csharp/subscribe/Program.cs +++ b/docs/examples/csharp/subscribe/Program.cs @@ -111,11 +111,12 @@ namespace TMQExample catch (Exception e) { // handle other exceptions - Console.WriteLine($"Failed to create native consumer, " + - $"host: {_host}, " + - $"groupId: {_groupId}, " + - $"clientId: {_clientId}, " + - $"ErrMessage: {e.Message}"); + Console.WriteLine( + $"Failed to create native consumer, " + + $"host: {_host}, " + + $"groupId: {_groupId}, " + + $"clientId: {_clientId}, " + + $"ErrMessage: {e.Message}"); throw; } @@ -163,11 +164,12 @@ namespace TMQExample catch (Exception e) { // handle other exceptions - Console.WriteLine($"Failed to poll data, " + - $"topic: {_topic}, " + - $"groupId: {_groupId}, " + - $"clientId: {_clientId}, " + - $"ErrMessage: {e.Message}"); + Console.WriteLine( + $"Failed to poll data, " + + $"topic: {_topic}, " + + $"groupId: {_groupId}, " + + $"clientId: {_clientId}, " + + $"ErrMessage: {e.Message}"); throw; } // ANCHOR_END: subscribe @@ -186,13 +188,14 @@ namespace TMQExample { consumer.Seek(new TopicPartitionOffset(topicPartition.Topic, topicPartition.Partition, 0)); } + Console.WriteLine("Assignment seek to beginning successfully"); } catch (TDengineError e) { // handle TDengine error Console.WriteLine( - $"Failed to execute seek example, " + + $"Failed to seek offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + @@ -204,12 +207,13 @@ namespace TMQExample catch (Exception e) { // handle other exceptions - Console.WriteLine($"Failed to execute seek example, " + - $"topic: {_topic}, " + - $"groupId: {_groupId}, " + - $"clientId: {_clientId}, " + - $"offset: 0, " + - $"ErrMessage: {e.Message}"); + Console.WriteLine( + $"Failed to seek offset, " + + $"topic: {_topic}, " + + $"groupId: {_groupId}, " + + $"clientId: {_clientId}, " + + $"offset: 0, " + + $"ErrMessage: {e.Message}"); throw; } // ANCHOR_END: seek @@ -240,7 +244,7 @@ namespace TMQExample { // handle TDengine error Console.WriteLine( - $"Failed to execute commit example, " + + $"Failed to commit offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + @@ -253,7 +257,7 @@ namespace TMQExample { // handle other exceptions Console.WriteLine( - $"Failed to execute commit example, " + + $"Failed to commit offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + diff --git a/docs/examples/csharp/wssubscribe/Program.cs b/docs/examples/csharp/wssubscribe/Program.cs index 5f5afc575a..939189cabd 100644 --- a/docs/examples/csharp/wssubscribe/Program.cs +++ b/docs/examples/csharp/wssubscribe/Program.cs @@ -116,11 +116,12 @@ namespace TMQExample catch (Exception e) { // handle other exceptions - Console.WriteLine($"Failed to create native consumer, " + - $"host: {_host}, " + - $"groupId: {_groupId}, " + - $"clientId: {_clientId}, " + - $"ErrMessage: {e.Message}"); + Console.WriteLine( + $"Failed to create native consumer, " + + $"host: {_host}, " + + $"groupId: {_groupId}, " + + $"clientId: {_clientId}, " + + $"ErrMessage: {e.Message}"); throw; } @@ -191,13 +192,14 @@ namespace TMQExample { consumer.Seek(new TopicPartitionOffset(topicPartition.Topic, topicPartition.Partition, 0)); } + Console.WriteLine("Assignment seek to beginning successfully"); } catch (TDengineError e) { // handle TDengine error Console.WriteLine( - $"Failed to execute seek example, " + + $"Failed to seek offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + @@ -209,12 +211,13 @@ namespace TMQExample catch (Exception e) { // handle other exceptions - Console.WriteLine($"Failed to execute seek example, " + - $"topic: {_topic}, " + - $"groupId: {_groupId}, " + - $"clientId: {_clientId}, " + - $"offset: 0, " + - $"ErrMessage: {e.Message}"); + Console.WriteLine( + $"Failed to seek offset, " + + $"topic: {_topic}, " + + $"groupId: {_groupId}, " + + $"clientId: {_clientId}, " + + $"offset: 0, " + + $"ErrMessage: {e.Message}"); throw; } // ANCHOR_END: seek @@ -245,7 +248,7 @@ namespace TMQExample { // handle TDengine error Console.WriteLine( - $"Failed to execute commit example, " + + $"Failed to commit offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + @@ -258,7 +261,7 @@ namespace TMQExample { // handle other exceptions Console.WriteLine( - $"Failed to execute commit example, " + + $"Failed to commit offset, " + $"topic: {_topic}, " + $"groupId: {_groupId}, " + $"clientId: {_clientId}, " + diff --git a/docs/examples/go/tmq/native/main.go b/docs/examples/go/tmq/native/main.go index 1d4a22b880..8d667abc18 100644 --- a/docs/examples/go/tmq/native/main.go +++ b/docs/examples/go/tmq/native/main.go @@ -112,7 +112,7 @@ func main() { }, 0) if err != nil { log.Fatalf( - "Failed to execute seek example, topic: %s, groupId: %s, clientId: %s, partition: %d, offset: %d, ErrMessage: %s\n", + "Failed to execute seek offset, topic: %s, groupId: %s, clientId: %s, partition: %d, offset: %d, ErrMessage: %s\n", topic, groupID, clientID, diff --git a/docs/examples/go/tmq/ws/main.go b/docs/examples/go/tmq/ws/main.go index aaed8395e0..9ea4d72b39 100644 --- a/docs/examples/go/tmq/ws/main.go +++ b/docs/examples/go/tmq/ws/main.go @@ -130,7 +130,7 @@ func main() { }, 0) if err != nil { log.Fatalf( - "Failed to execute seek example, topic: %s, groupId: %s, clientId: %s, partition: %d, offset: %d, ErrMessage: %s\n", + "Failed to seek offset, topic: %s, groupId: %s, clientId: %s, partition: %d, offset: %d, ErrMessage: %s\n", topic, groupID, clientID,