Skip to content

Commit

Permalink
#615 Added x-originally-queued header to queued requests to disting…
Browse files Browse the repository at this point in the history
…uish them from `enqueuing` requests
  • Loading branch information
mcweba committed Dec 9, 2024
1 parent ba5f999 commit 06e4ed9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class QueuingHandler implements Handler<Buffer> {

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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 06e4ed9

Please sign in to comment.