diff --git a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueuingHandler.java b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueuingHandler.java index 9b342f49..00421e93 100755 --- a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueuingHandler.java +++ b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueuingHandler.java @@ -26,6 +26,7 @@ public class QueuingHandler implements Handler { public static final String QUEUE_HEADER = "x-queue"; + public static final String ORIGINALLY_QUEUED_HEADER = "x-originally-queued"; public static final String DUPLICATE_CHECK_HEADER = "x-duplicate-check"; private final RequestQueue requestQueue; @@ -86,6 +87,9 @@ public void handle(final Buffer buffer) { // Remove the queue header to avoid feedback loop headers.remove(QUEUE_HEADER); + // Add a header to indicate that this request was initially queued + headers.add(ORIGINALLY_QUEUED_HEADER, "true"); + if (headers.names().contains(DUPLICATE_CHECK_HEADER)) { DuplicateCheckHandler.checkDuplicateRequest(redisProvider, request.uri(), buffer, headers.get(DUPLICATE_CHECK_HEADER), requestIsDuplicate -> { if (requestIsDuplicate) {