Skip to content

Commit

Permalink
applying retry in sendMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianoviana committed Jul 29, 2024
1 parent 54ad4a7 commit 8623856
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void shouldQuarantineThenDisconnectASlowConsumer() throws IOException
hasBecomeSlow = true;
}

sendMessage();
sendMessageWithRetry();
}

testSystem.poll();
Expand All @@ -174,6 +174,11 @@ private void sessionBecomesSlow()
assertTrue(session.isSlowConsumer());
}

private void sendMessageWithRetry()
{
testSystem.awaitSend(this::sendMessage);
}

private long sendMessage()
{
if (sendMetadata)
Expand Down Expand Up @@ -207,7 +212,7 @@ public void shouldRestoreConnectionFromSlowGroupWhenItCatchesUp() throws IOExcep
}
while (bytesRead > 0);

sendMessage();
sendMessageWithRetry();

testSystem.poll();
}
Expand Down Expand Up @@ -260,7 +265,7 @@ private ConnectedSessionInfo sessionBecomesSlow(final MessageTimingCaptor messag
{
for (int i = 0; i < 10; i++)
{
sendMessage();
sendMessageWithRetry();
}

testSystem.poll();
Expand Down

0 comments on commit 8623856

Please sign in to comment.