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 2022/02/20 10:01:13 UTC

[GitHub] [pulsar-client-go] WinChua opened a new issue #731: Resend after reconnection cause reproduce of the same msg

WinChua opened a new issue #731:
URL: https://github.com/apache/pulsar-client-go/issues/731


   https://github.com/apache/pulsar-client-go/blob/965045aa0d2c077826f64d0b88a5d5e55d9d50c4/pulsar/producer_partition.go#L272
   
   After the reconnection of the producer, the msg in the pendingQueue will be resend.
   But not every msg in pendingQueue hasn't send to broker, the resend logic here seems to deal with the problem that producer meet a network error when producing a msg which cause the msg doesn't really send to broker.
   
   While, the code here
   https://github.com/apache/pulsar-client-go/blob/master/pulsar/producer_partition.go#L793
   will also trigger the reconnection logic again and again, as well as the resend logic, which cause the consumer to consume the same msg with difference msgId
   


-- 
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: commits-unsubscribe@pulsar.apache.org

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



[GitHub] [pulsar-client-go] WinChua commented on issue #731: Resend after reconnection cause reproduce of the same msg

Posted by GitBox <gi...@apache.org>.
WinChua commented on issue #731:
URL: https://github.com/apache/pulsar-client-go/issues/731#issuecomment-1046428644


   Try to present a solution, the problem is that in the resend logic after the reconnection of producer, no mater the item in pendingQueue has been sent or not, all the items will be resend to broker, which will cause the redundancy of msg.
   We can add sent flag in pendingItemQueue initialized as false, which will be set to true after the corresponding buffer has been sent successfully.
   And filter the items which has been sent after the reconnection, resend the item which has not been sent only.


-- 
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: commits-unsubscribe@pulsar.apache.org

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