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 2019/04/17 00:23:28 UTC

[GitHub] [pulsar] merlimat opened a new pull request #4062: Delayed message delivery implementation

merlimat opened a new pull request #4062: Delayed message delivery implementation
URL: https://github.com/apache/pulsar/pull/4062
 
 
   ### Motivation
   
   Allow the option to mark messages for delayed delivery. 
   
   Notes:
    * If delayed delivery is disabled, messages are always delivered immediately and there's no tracking overhead. 
    * Messages are only delayed on shared subscriptions. Other subscriptions will deliver immediately.
    * The tracking of delayed messages is lazily initialized and if a messages has no delay, it will have no overhead.
   
   ### Implementation
   
    * The tracking is ephemeral and implemented in Pulsar broker. The main reason is to avoid a client refetching messages multiple times when there are multiple consumer reconnections.
    * Broker keeps a priority-queue as a buffer in direct memory
    * Use one Netty hashwheel timer to drive the checking of topics that have messages ready to be scheduled.
   
   ### Possible improvements
   
   The goal of this PR is to have simple working solution that can be used to efficiently apply delay on 10s of millions of messages at any given time.
   
   There are several improvements that could be considered, based on real-world usage feedback. 
   For example:
    * Compress the priority queue, either by collapsing id ranges or by just passing the buffer through gzip.
    * Allow batching of messages with very close target time.
   
   

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


With regards,
Apache Git Services