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

feat: queue message payloads #20749

Merged
merged 7 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use the has method
clear queue for push messaging.
  • Loading branch information
caalador committed Jan 13, 2025
commit d28282bf08b21160eb1219efdbdae6909b72d929
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private JsonObject preparePayload(final JsonArray reqInvocations,
* The contents of the request to send
*/
public void send(final JsonObject payload) {
if (!messageQueue.isEmpty()) {
if (hasQueuedMessages()) {
messageQueue.add(payload);
return;
}
Expand Down Expand Up @@ -238,6 +238,7 @@ private void sendPayload(final JsonObject payload) {
}

if (push != null && push.isBidirectional()) {
messageQueue.clear();
// When using bidirectional transport, the payload is not resent
// to the server during reconnection attempts.
// Keep a copy of the message, so that it could be resent to the
Expand Down Expand Up @@ -377,7 +378,7 @@ public void setClientToServerMessageId(int nextExpectedId, boolean force) {
ApplicationConstants.CLIENT_TO_SERVER_ID) < nextExpectedId) {
pushPendingMessage = null;
}
if (!messageQueue.isEmpty()) {
if (hasQueuedMessages()) {
synchronized (messageQueue) {
mcollovati marked this conversation as resolved.
Show resolved Hide resolved
// If queued message is the expected one. remove from queue
// and sen next message if any.
Expand Down