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

Ordered Consumer Heartbeat Handling #712

Merged
merged 3 commits into from
Nov 19, 2022
Merged

Conversation

scottf
Copy link
Collaborator

@scottf scottf commented Nov 15, 2022

#700

  1. reorganized managers to be hierarchy instead of individual. This makes it simpler to combine behavior and reduces overlap
  2. For ordered consumers, missed heartbeats are handled by the manager instead of being raised to the user

@scottf scottf changed the title heartbeat handling Ordered Consumer Heartbeat Handling Nov 15, 2022
@scottf scottf marked this pull request as ready for review November 15, 2022 19:47
js.PushSubscribeAsync(null, (o, a) => { }, false, psoBind).Unsubscribe();
UnsubscribeEnsureNotBound(js.PushSubscribeSync(null, psoBind));
UnsubscribeEnsureNotBound(js.PushSubscribeSync("", psoBind));
UnsubscribeEnsureNotBound(js.PushSubscribeAsync(null, (o, a) => { }, false, psoBind));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Helps test on slow machines.

@@ -305,7 +305,7 @@ public void TestSourceBasics()

private void AssertMirror(IJetStreamManagement jsm,
string stream, string mirroring, ulong? msgCount, ulong? firstSeq) {
Thread.Sleep(1000);
Thread.Sleep(1500);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

more time for slow machines


internal static PushMessageManagerFactory PushMessageManagerFactoryImpl =
(conn, so, cc, queueMode, syncMode) => new PushMessageManager(conn, so, cc, queueMode, syncMode);
internal static PushMessageManagerFactory PushMessageManagerFactoryImpl;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This allows a factory to be set for testing. The default one is used later if this one is not set. Change makes sense in the context of sub classing versus multiple managers

using System.Collections.Generic;
using System.Threading;
using NATS.Client.Internals;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Split this file with multiple related classes into separate files matching the class name.

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

Successfully merging this pull request may close these issues.

None yet

1 participant