-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support ingesting events via queue
- Loading branch information
1 parent
5f65e6d
commit ce1cea8
Showing
38 changed files
with
1,080 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package constants | ||
|
||
import ( | ||
"github.com/webhookx-io/webhookx/config" | ||
"time" | ||
) | ||
|
||
// Task Queue | ||
const ( | ||
TaskQueueName = "webhookx:queue" | ||
TaskQueueInvisibleQueueName = "webhookx:queue_invisible" | ||
TaskQueueDataName = "webhookx:queue_data" | ||
TaskQueueVisibilityTimeout = time.Second * 60 | ||
) | ||
|
||
// Redis Queue | ||
const ( | ||
QueueRedisQueueName = "webhookx:proxy_queue" | ||
QueueRedisGroupName = "group_default" | ||
QueueRedisConsumerName = "consumer_default" | ||
QueueRedisVisibilityTimeout = time.Second * 60 | ||
) | ||
|
||
const ( | ||
RequeueBatch = 100 | ||
RequeueInterval = time.Second * 60 | ||
) | ||
|
||
var ( | ||
DefaultResponseHeaders = map[string]string{ | ||
"Content-Type": "application/json", | ||
"Server": "WebhookX/" + config.VERSION, | ||
} | ||
DefaultDelivererRequestHeaders = map[string]string{ | ||
"User-Agent": "WebhookX/" + config.VERSION, | ||
"Content-Type": "application/json; charset=utf-8", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE IF EXISTS ONLY "sources" DROP COLUMN IF EXISTS "async"; | ||
ALTER TABLE IF EXISTS ONLY "events" DROP COLUMN IF EXISTS "ingested_at"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ALTER TABLE IF EXISTS ONLY "sources" ADD COLUMN IF NOT EXISTS "async" BOOLEAN NOT NULL DEFAULT false; | ||
ALTER TABLE IF EXISTS ONLY "events" ADD COLUMN IF NOT EXISTS "ingested_at" TIMESTAMPTZ(3) DEFAULT (CURRENT_TIMESTAMP(3) AT TIME ZONE 'UTC'); | ||
|
||
UPDATE "events" SET ingested_at = created_at; |
Oops, something went wrong.