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/10/19 13:55:12 UTC

[GitHub] [pulsar] lhotari opened a new issue #8300: [Java Client] Support cancelling message & batch futures returned by Reader and Consumer APIs

lhotari opened a new issue #8300:
URL: https://github.com/apache/pulsar/issues/8300


   **Problem description**
   
   Currently, it's not possible to cancel the message & batch futures returned by Reader and Consumer APIs. 
   This leads to several problems when the Reader or Consumer instance is long-living. If no messages are received,
   the futures will be kept in memory until messages are received. This causes memory leaks. In addition, the returned
   message would get consumed by an already cancelled future which the application using Pulsar has already discarded, for example as a result of a timeout from the application's perspective
   
   **Solution**
   The futures returned by `org.apache.pulsar.client.api.Reader.readNextAsync`, `org.apache.pulsar.client.api.Consumer.receiveAsync` and `org.apache.pulsar.client.api.Consumer.batchReceiveAsync` methods should override the cancel method of CompletableFuture and unregister the futures from internal datastructures when the future gets cancelled.


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



[GitHub] [pulsar] lhotari removed a comment on issue #8300: [Java Client] Support cancelling message & batch futures returned by Reader and Consumer APIs

Posted by GitBox <gi...@apache.org>.
lhotari removed a comment on issue #8300:
URL: https://github.com/apache/pulsar/issues/8300#issuecomment-712176728


   I started working on a PR, current WIP is https://github.com/lhotari/pulsar/commit/a300d297fb723b5fd91231668407441d5a662b1b .


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



[GitHub] [pulsar] lhotari commented on issue #8300: [Java Client] Support cancelling message & batch futures returned by Reader and Consumer APIs

Posted by GitBox <gi...@apache.org>.
lhotari commented on issue #8300:
URL: https://github.com/apache/pulsar/issues/8300#issuecomment-712176728


   I started working on a PR, current WIP is https://github.com/lhotari/pulsar/commit/a300d297fb723b5fd91231668407441d5a662b1b .


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



[GitHub] [pulsar] codelipenghui closed issue #8300: [Java Client] Support cancelling message & batch futures returned by Reader and Consumer APIs

Posted by GitBox <gi...@apache.org>.
codelipenghui closed issue #8300:
URL: https://github.com/apache/pulsar/issues/8300


   


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