michaeljmarshall commented on issue #19320:
URL: https://github.com/apache/pulsar/issues/19320#issuecomment-1402358595
@Croway - thanks for opening the issue. I was not able to reproduce it on
tag `v2.11.0` or on a recent version of `master` branch. Here is the unit test
I used, but it failed due to the 30 second timeout. Would you take a look to
see if there is something off between my test and your steps to reproduce the
issue?
```java
@Test(timeOut = 30000L)
public void zeroQueueSizePausedConsumer() throws PulsarClientException {
String key = "zeroQueueSizePausedConsumer";
// 1. Config
final String topicName = "persistent://prop/use/ns-abc/topic-" + key;
final String subscriptionName = "my-ex-subscription-" + key;
final String messagePredicate = "my-message-" + key + "-";
// 2. Create Producer
Producer<byte[]> producer =
pulsarClient.newProducer().topic(topicName).enableBatching(false).create();
// 3. Create Consumer
ConsumerImpl<byte[]> consumer = (ConsumerImpl<byte[]>)
pulsarClient.newConsumer().topic(topicName)
.subscriptionName(subscriptionName).receiverQueueSize(0).subscribe();
consumer.pause();
// 3. producer publish messages
for (int i = 0; i < 2; i++) {
String message = messagePredicate + i;
log.info("Producer produced: " + message);
producer.send(message.getBytes());
}
// 4. Receiver receives the message
Message<byte[]> message;
for (int i = 0; i < totalMessages; i++) {
assertEquals(consumer.numMessagesInQueue(), 0);
message = consumer.receive();
assertEquals(new String(message.getData()), messagePredicate +
i);
assertEquals(consumer.numMessagesInQueue(), 0);
log.info("Consumer received : " + new String(message.getData()));
}
}
```
When I run that test, it fails due to the 30 second timeout.
Additionally, I tested with `startPaused(true)` and got the same results.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]