BewareMyPower commented on code in PR #237:
URL: https://github.com/apache/pulsar-client-cpp/pull/237#discussion_r1172745690


##########
include/pulsar/c/consumer_configuration.h:
##########
@@ -98,6 +98,21 @@ typedef struct {
     long timeoutMs;
 } pulsar_consumer_batch_receive_policy_t;
 
+typedef struct {
+    // Name of the dead topic where the failing messages are sent.
+    // The default value is: sourceTopicName + "-" + subscriptionName + "-DLQ"
+    const char *dead_letter_topic;
+    // Maximum number of times that a message is redelivered before being sent 
to the dead letter queue.
+    // - The maxRedeliverCount must be greater than 0.
+    // - The default value is {INT_MAX} (DLQ is not enabled)
+    const int max_redeliver_count;
+    // Name of the initial subscription name of the dead letter topic.
+    // If this field is not set, the initial subscription for the dead letter 
topic is not created.
+    // If this field is set but the broker's `allowAutoSubscriptionCreation` 
is disabled, the DLQ producer
+    // fails to be created.
+    const char *initial_subscription_name;
+} pulsar_consumer_config_dead_letter_policy_t;

Review Comment:
   If you prefer the OOP style, you can also add a function like:
   
   ```c
   struct A {
       int x;
       const char* s;
   };
   
   void init_a(struct A* a) {
       a.x = 0;
       a.s = NULL;
   }
   ```
   
   Then it requires users to use `init_a` to initialize struct `A`. The 
`init_a` function acts like C++'s constructor.
   
   BTW, I think all of them are okay.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to