You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2023/04/10 03:41:44 UTC

[GitHub] [pulsar-client-go] BewareMyPower commented on a diff in pull request #1002: [feat][txn]Implement transactional consumer/producer API

BewareMyPower commented on code in PR #1002:
URL: https://github.com/apache/pulsar-client-go/pull/1002#discussion_r1161405910


##########
pulsar/client_impl.go:
##########
@@ -195,6 +195,11 @@ func newClient(options ClientOptions) (Client, error) {
 	return c, nil
 }
 
+func (c *client) NewTransaction(timeout time.Duration) (Transaction, error) {
+	id, err := c.tcClient.newTransaction(timeout)

Review Comment:
   We should check `err` here:
   
   ```go
           if id, err := c.tcClient.newTransaction(timeout); err == nil {
                   return newTransaction(*id, c.tcClient, timeout), nil
           } else {
                   return nil, err
           }
   ```



##########
pulsar/consumer_partition.go:
##########
@@ -417,6 +417,93 @@ func (pc *partitionConsumer) Unsubscribe() error {
 	return req.err
 }
 
+func (pc *partitionConsumer) AckIDWithTxn(msgID MessageID, txn Transaction) error {

Review Comment:
   Could you reduce the duplicated code with `ackID`? I see much code is just copied from `ackID`.



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