Fix the method of setting timestamp for Delay Producer. Before fixing, it may appear that the Message Type cannot be recognized as DELAY by the server, but rather as NORMAL. (#543)

Co-authored-by: htaowang <htaowang@tencent.com>
diff --git a/cpp/examples/ExampleProducerWithTimedMessage.cpp b/cpp/examples/ExampleProducerWithTimedMessage.cpp
index c462385..8f12f5b 100644
--- a/cpp/examples/ExampleProducerWithTimedMessage.cpp
+++ b/cpp/examples/ExampleProducerWithTimedMessage.cpp
@@ -77,6 +77,7 @@
                                              .withCredentialsProvider(credentials_provider)
                                              .withSsl(true)
                                              .build())
+                      .withTopics({FLAGS_topic})
                       .build();
 
   std::atomic_bool stopped;
diff --git a/cpp/source/rocketmq/ProducerImpl.cpp b/cpp/source/rocketmq/ProducerImpl.cpp
index a56d803..32b2eca 100644
--- a/cpp/source/rocketmq/ProducerImpl.cpp
+++ b/cpp/source/rocketmq/ProducerImpl.cpp
@@ -148,6 +148,9 @@
     if (delivery_timestamp.time_since_epoch().count()) {
       auto duration = delivery_timestamp.time_since_epoch();
       system_properties->set_delivery_attempt(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count());
+      auto mutable_delivery_timestamp = system_properties->mutable_delivery_timestamp();
+      mutable_delivery_timestamp->set_seconds(std::chrono::duration_cast<std::chrono::seconds>(duration).count());
+      mutable_delivery_timestamp->set_nanos(std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 1000000000);
     }
   }