• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sonus21 / rqueue / 26012877262

18 May 2026 04:04AM UTC coverage: 83.319% (-0.09%) from 83.412%
26012877262

push

github

web-flow
fix: restore Jackson 2.x property order in RqueueRedisSerializer to prevent stale processing-queue entries after 3.x → 4.x upgrade (#300)

* fix: restore Jackson 2.x property order in RqueueRedisSerializer to prevent stale processing-queue entries after 3.x → 4.x upgrade

* build: bump version to 4.0.0-RC10

* feat: add rqueue.serialization.property.order property to control JSON field ordering

Introduces RqueueRedisSerializer.PropertyOrder enum (ALPHABETICAL | DECLARATION)
and wires it via rqueue.serialization.property.order (default: ALPHABETICAL).

ALPHABETICAL uses Jackson 3.x alphabetical ordering, the native default for
RQueue 4.x deployments. No configuration change required for new installs.

DECLARATION uses declaration order, matching the Jackson 2.x behaviour of
RQueue 3.x. Set this when upgrading from 3.x with messages still in Redis
queues, as switching while messages are in-flight causes unexpected retries.

The setting is applied in RqueueListenerBaseConfig before any Redis template is
created (overriding RedisUtils providers when DECLARATION is requested), and
flows through RqueueConfig to RqueueInternalPubSubChannel so all serialiser
instances in the application use the same order.

Docs: configuration.md and migrations.md updated with property description,
accepted values, and the 3.x → 4.x migration warning.

Assisted-By: Claude Sonnet 4.6

2627 of 3485 branches covered (75.38%)

Branch coverage included in aggregate %.

13 of 31 new or added lines in 3 files covered. (41.94%)

14 existing lines in 6 files now uncovered.

7847 of 9086 relevant lines covered (86.36%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.76
/rqueue-core/src/main/java/com/github/sonus21/rqueue/utils/TimeoutUtils.java
1
/*
2
 * Copyright (c) 2020-2026 Sonu Kumar
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * You may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and limitations under the License.
14
 *
15
 */
16

17
package com.github.sonus21.rqueue.utils;
18

19
import com.github.sonus21.rqueue.exception.TimedOutException;
20
import java.util.function.BooleanSupplier;
21

22
/**
23
 * waitFor method wait for some event to occur. It accepts a callback as well that can be invoked on
24
 * successive failure of the method. That can be used to diagnosis the test. A callback method is
25
 * used to identify the outcome of some event, if the specified method returns true then call is
26
 * stopped otherwise every 100Ms the callback would be called to get the outcome. It tries for
27
 * continuously over 10seconds If callback does not return true within 10 seconds then it will throw
28
 * TimeOutException. If postmortem method is provided then it will call that method before throwing
29
 * exception.
30
 */
31
public final class TimeoutUtils {
32

33
  public static final long EXECUTION_TIME = 10_000L;
34
  public static final long SLEEP_TIME = 100L;
35

36
  private TimeoutUtils() {}
37

38
  public static void waitFor(
39
      BooleanSupplier callback, long waitTimeInMilliSeconds, String description)
40
      throws TimedOutException {
41
    waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, () -> {});
1✔
42
  }
1✔
43

44
  public static void waitFor(BooleanSupplier callback, String description)
45
      throws TimedOutException {
46
    waitFor(callback, EXECUTION_TIME, description);
1✔
47
  }
1✔
48

49
  public static void waitFor(BooleanSupplier callback, String description, Runnable postmortem)
50
      throws TimedOutException {
51
    waitFor(callback, EXECUTION_TIME, SLEEP_TIME, description, postmortem);
1✔
52
  }
1✔
53

54
  public static void waitFor(
55
      BooleanSupplier callback,
56
      long waitTimeInMilliSeconds,
57
      String description,
58
      Runnable postmortem)
59
      throws TimedOutException {
60
    waitFor(callback, waitTimeInMilliSeconds, SLEEP_TIME, description, postmortem);
1✔
61
  }
1✔
62

63
  public static void waitFor(
64
      BooleanSupplier callback,
65
      long waitTimeInMilliSeconds,
66
      long sleepDuration,
67
      String description,
68
      Runnable postmortem)
69
      throws TimedOutException {
70
    long endTime = System.currentTimeMillis() + waitTimeInMilliSeconds;
1✔
71
    do {
72
      if (Boolean.TRUE.equals(callback.getAsBoolean())) {
1✔
73
        return;
1✔
74
      }
75
      sleep(sleepDuration);
1✔
76
    } while (System.currentTimeMillis() < endTime);
1!
77
    try {
78
      postmortem.run();
×
79
    } catch (Exception e) {
×
80
      e.printStackTrace();
×
81
    }
×
82
    throw new TimedOutException("Timed out waiting for " + description);
×
83
  }
84

85
  public static void sleep(long time) {
86
    sleepLog(time, true);
1✔
87
  }
1✔
88

89
  public static void sleepLog(long time, boolean log) {
90
    try {
91
      Thread.sleep(time);
1✔
92
    } catch (InterruptedException e) {
1✔
93
      Thread.currentThread().interrupt();
1✔
94
      if (log) {
1!
UNCOV
95
        e.printStackTrace();
×
96
      }
97
    }
1✔
98
  }
1✔
99
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc