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

Discarded messages are still counted as pending #97

Closed
vietj opened this issue Mar 18, 2020 · 3 comments
Closed

Discarded messages are still counted as pending #97

vietj opened this issue Mar 18, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@vietj
Copy link
Contributor

vietj commented Mar 18, 2020

Discarded event bus messages are still counted as pending. When a message is discarded, the pending count should be corrected.

@vietj vietj added the bug label Mar 18, 2020
@vietj vietj self-assigned this Mar 18, 2020
@vietj vietj added this to the 3.9.0 milestone Mar 18, 2020
@vietj vietj closed this as completed Mar 18, 2020
@vietj
Copy link
Contributor Author

vietj commented Mar 18, 2020

cc @jotak

@jotak
Copy link
Contributor

jotak commented Mar 19, 2020

@vietj While fixing this on micrometer I had a quick look on dropwizard too and I thought it was already handled, see https://github.com/vert-x3/vertx-dropwizard-metrics/blob/master/src/main/java/io/vertx/ext/dropwizard/impl/EventBusMetricsImpl.java#L280-L282 => pending gauges are reset.

Or, is there some situations where messages are discarded without the handler being removed?

For micrometer, I believe vert-x3/vertx-micrometer-metrics#98 did fix it, pending count being reset on unregistration.

@vietj
Copy link
Contributor Author

vietj commented Mar 19, 2020

@jotak yes it happens when a consumer is paused and messages are dropped due to overflow, e.g

MessageConsumer<String> consumer = eventBus.consumer("foo");
consumer.setMaxBufferedMessages(10);
consumer.pause();
consumer.handler(msg -> ...);

for (int i = 0;i < 10;i++) {
  eventBus.send("foo", "msg-" + i);
}
eventBus.send("foo", "msg-11"); // Shall be discarded due to overflow without consumer being unregistered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants