You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "crossoverJie (via GitHub)" <gi...@apache.org> on 2025/07/14 03:10:14 UTC
[PR] ZeroQueueConsumer is not supported with RetryEnable [pulsar-client-go]
crossoverJie opened a new pull request, #1391:
URL: https://github.com/apache/pulsar-client-go/pull/1391
*(If this PR fixes a github issue, please add `Fixes #<xyz>`.)*
Fixes #1319
### Modifications
https://github.com/apache/pulsar/blob/89167308709cf72d3f2731bad1bb30384f80abb4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L148-L149
We need to be consistent with the Java Client; `ZeroQueueConsumer` does not support use with `RetryEnable`.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (10MB)*
- *Extended integration test for recovery after broker failure*
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (no)
- The schema: (no)
- The default values of configurations: (no)
- The wire protocol: (no)
### Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
--
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
Re: [PR] ZeroQueueConsumer is not supported with RetryEnable [pulsar-client-go]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1391:
URL: https://github.com/apache/pulsar-client-go/pull/1391#discussion_r2204120538
##########
pulsar/consumer_zero_queue_test.go:
##########
@@ -31,6 +31,26 @@ import (
"github.com/stretchr/testify/assert"
)
+func TestRetryEnableZeroQueueConsumer(t *testing.T) {
+ client, err := NewClient(ClientOptions{
+ URL: lookupURL,
+ })
+
+ assert.Nil(t, err)
+ defer client.Close()
+
+ topic := newTopicName()
+
+ // create consumer
+ _, err = client.Subscribe(ConsumerOptions{
+ Topic: topic,
+ SubscriptionName: "my-sub",
+ RetryEnable: true,
+ EnableZeroQueueConsumer: true,
+ })
+ assert.Error(t, err, "ZeroQueueConsumer is not supported with RetryEnable")
Review Comment:
Consider using assert.Contains or assert.ErrorContains to verify the error message content instead of just checking that an error exists. The current assertion only verifies an error occurred but doesn't validate the specific error message.
```suggestion
assert.ErrorContains(t, err, "ZeroQueueConsumer is not supported with RetryEnable")
```
--
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
Re: [PR] ZeroQueueConsumer is not supported with RetryEnable [pulsar-client-go]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower merged PR #1391:
URL: https://github.com/apache/pulsar-client-go/pull/1391
--
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
Re: [PR] ZeroQueueConsumer is not supported with RetryEnable [pulsar-client-go]
Posted by "BewareMyPower (via GitHub)" <gi...@apache.org>.
BewareMyPower commented on PR #1391:
URL: https://github.com/apache/pulsar-client-go/pull/1391#issuecomment-3067757773
https://github.com/apache/pulsar/blob/89167308709cf72d3f2731bad1bb30384f80abb4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L148-L149
```java
checkArgument(conf.getReceiverQueueSize() > 0,
"Receiver queue size needs to be greater than 0 for Topics Consumer");
```
This assertion disallows the receiver queue size as 0 for a multi-topics consumer. It seems not related to this PR?
--
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
Re: [PR] ZeroQueueConsumer is not supported with RetryEnable [pulsar-client-go]
Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on PR #1391:
URL: https://github.com/apache/pulsar-client-go/pull/1391#issuecomment-3067825281
> [apache/pulsar@`8916730`/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L148-L149](https://github.com/apache/pulsar/blob/89167308709cf72d3f2731bad1bb30384f80abb4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L148-L149)
>
> ```java
> checkArgument(conf.getReceiverQueueSize() > 0,
> "Receiver queue size needs to be greater than 0 for Topics Consumer");
> ```
>
> This assertion disallows the receiver queue size as 0 for a multi-topics consumer. It seems not related to this PR?
In the Java client, setting `receiverQueueSize` to 0 will create a `ZeroQueueConsumer`; additionally, if `RetryEnable` is enabled, a `MultiTopicsConsumer` will be created.
In the Go client, if `RetryEnable` is enabled in `ZeroQueueConsumer`, a `MultiTopicConsumer` will also be created. In this case, `ReceiverQueueSize` being equal to 0 will result in message data not being received.
--
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