You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/12/13 13:29:34 UTC

[GitHub] [pulsar] fshafiee opened a new issue #8943: Specifying delivery delays per subscription

fshafiee opened a new issue #8943:
URL: https://github.com/apache/pulsar/issues/8943


   **Is your enhancement request related to a problem? Please describe.**
   Unable to setup delayed deliveries per subscription. In other words, the current way of delaying messages does not conform to [following diagram (taken from official docs)](https://pulsar.apache.org/docs/en/concepts-messaging/#delayed-message-delivery).
   
   ![Delayed delivery structure](https://pulsar.apache.org/docs/assets/message_delay.png)
   
   This diagram suggests that delayed messages are tracked per subscription. However, it seems that the delay can only be set by producer.
   
   ```java
   producer.newMessage().deliverAfter(3L, TimeUnit.Minute).value("Hello Pulsar!").send();
   ```
   
   This, IMO, is a contradiction in the design, as the producer in bound a topic, while the delay tracking is bound to a subscription.
   
   This poses a problem to pull-based (as opposed to push-based) architectures, where producers are not aware of the consumption logic (producers are just announcers). There might be many different logics that are bound to the same message topic, some of them may need to be delayed, some may not. It's the consumer (subscription to be exact) that knows whether the messages should be delayed or not as the diagram suggests correctly.
   
   **Describe the solution you'd like**
   It'd be nice to be able to configure a default delay per subscription. The subscription delay can be overridden using per message delay.
   
   **Describe alternatives you've considered**
   In order to emulate the desired behavior, the consumer has receive every message to dispatch them to a retry topic. Which introduce unnecessary processing overhead since (considering that delayed deliveries are in fact tracked per subscription).


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org