Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add numMessagesInQueue and getAvailablePermits for PartitionedConsumer #72

Merged
merged 1 commit into from
Oct 18, 2016

Conversation

sschepens
Copy link
Contributor

@sschepens sschepens commented Oct 18, 2016

Motivation

Allow a partitioned consumer to get the available messages to consume

Modifications

Added numMessagesInQueue and getAvailablePermits for PartitionedConsumer

Result

A Partitioned consumer can now get the amount of messages it has to consume.

@yahoocla
Copy link

CLA is valid!

@@ -398,6 +398,14 @@ public boolean isBatchingAckTrackerEmpty() {
return consumers;
}

public int getAvailablePermits() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface for these 2 methods could also be added to ConsumerBase abstract class, to avoid need to downcast and checking the type of the consumer implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@merlimat
Copy link
Contributor

@sschepens I'm seeing there is a test failure here that appears to be intermittent and related to the per-message redelivery change :

testSharedAckedNormalTopic(com.yahoo.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest)  Time elapsed: 0.097 sec  <<< FAILURE!
java.lang.AssertionError: expected [5] but found [3]
    at com.yahoo.pulsar.client.impl.PerMessageUnAcknowledgedRedeliveryTest.testSharedAckedNormalTopic(PerMessageUnAcknowledgedRedeliveryTest.java:110)

I think the receive timeouts of 10ms are too low and can lead to this spurious errors, especially in Travis which runs the test in a Docker container and it appears to lead to very funny timing issues.

Try to raise that to at least 100ms.

@sschepens
Copy link
Contributor Author

@merlimat will do

@sschepens sschepens force-pushed the partitioned_methods branch from 2731497 to 8ec9f88 Compare October 18, 2016 18:19
@merlimat merlimat added this to the 1.15 milestone Oct 18, 2016
@merlimat merlimat merged commit 430eb5e into apache:master Oct 18, 2016
@sschepens sschepens deleted the partitioned_methods branch October 25, 2016 17:18
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
* More graceful warning when args are missing

* Make use of Annotations

* Tests work
hrsakai pushed a commit to hrsakai/pulsar that referenced this pull request Dec 10, 2020
* [ISSUE apache#72] Fix data race conditions.

* Remove commented out code.

* Revert write request ch to unbuffered.
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
dlg99 pushed a commit to dlg99/pulsar that referenced this pull request May 11, 2022
* [feat][elasticsearch] Add hashed id support

* add config default test

(cherry picked from commit 4fdb34e)
dlg99 pushed a commit to dlg99/pulsar that referenced this pull request May 11, 2022
* [feat][elasticsearch] Add hashed id support

* add config default test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants