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/26 00:03:26 UTC

[GitHub] [pulsar] lovelle commented on issue #4137: Incorrect behavior single Pulsar Client creating multiple consumers

lovelle commented on issue #4137: Incorrect behavior single Pulsar Client creating multiple consumers
URL: https://github.com/apache/pulsar/issues/4137#issuecomment-486879542
 
 
   First of all, my apologise for the trouble. Please, let me clarify when this is happening.
   
   A previously built consumer would be returned when the next union is met: Shared mode consumers on the same topic with the same subscription within the same pulsar client.
   
   Previously to #3312 creating a new consumer with the previous mentioned characteristics would result in a waste of resource and wouldn't result in a truly more threaded consumer, if performance is wanted, I think the asynchronous api should be good enough.
   
   Even so, if the same consumer is wanted to be created with this characteristics, in order to have truly more threaded consumer, you could do it with a new pulsar client instance provided.
   
   > Other than that, I think there would be a problem coming with unacked messages.
   
   Let me try to answer this with your example:
   
     1. Consumer-1 gets Message-1.
     2. Consumer-2 is created but Consumer-1 is returned.
     3. Consumer-1 receive close(), but won't close the consumer in fact.
     4. Consumer-2 is still alive, and any redelivery will still be made.
     5. Consumer-2 receive close(), this time really closing the consumer.
   
   The key here is that Consumer-2 actually never exists, all the time was the same Consumer-1 doing the work.
   Anyway, if you like, I can add a test in order to assert this scenario and verify this for real.
   
   Keep in mind that if we revert #3312 the issue #3226 will come again to the surface.

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