@@ -26,6 +26,7 @@ public class DefaultEventQueue implements EventQueueIF {
26
26
private static final String QUEUE_TIMER_NAME = "queue-timer" ;
27
27
private static final Integer DEFAULT_PROCESSING_INTERVAL_IN_SECS = 10 ;
28
28
private static final Double BATCH_SIZE_DIVISOR = 1.5 ;
29
+ private static final Integer DEFAULT_SUSPENSION_DURATION_IN_MINS = 5 ;
29
30
30
31
private final StorageProviderIF storageProvider ;
31
32
private final Configuration configuration ;
@@ -100,12 +101,10 @@ public void enqueue(Event event) {
100
101
}
101
102
102
103
long timestamp = storageProvider .getQueue ().save (event );
103
- String logText =
104
- String .format ("type: %s" , event .getType ())
105
- + (event .getReferenceId () != null
106
- ? String .format (", refId: %s" , event .getReferenceId ())
107
- : "" );
108
- LOG .info (String .format ("Enqueueing event: %s %s" , timestamp , logText ));
104
+ LOG .info (
105
+ String .format (
106
+ "Enqueueing event: %s type: %s, refId: %s" ,
107
+ timestamp , event .getType (), event .getReferenceId ()));
109
108
}
110
109
111
110
private boolean shouldDiscard () {
@@ -245,7 +244,7 @@ private void suspendProcessing(Duration duration) {
245
244
public void suspendProcessing (
246
245
Duration duration , boolean discardFutureQueueItems , boolean clearQueue ) {
247
246
if (duration == null ) {
248
- duration = Duration .ofMinutes (5 );
247
+ duration = Duration .ofMinutes (DEFAULT_SUSPENSION_DURATION_IN_MINS );
249
248
}
250
249
251
250
LOG .info (String .format ("Suspending processing for %s" , duration ));
0 commit comments