feat(events): add idempotent Kafka event consumer runtime
This commit is contained in:
1 parent
565ef8d4f5
commit
3adb0ef9e4
47 files changed
+5018
-105
No files matched your search
@@ -49,6 +49,11 @@ type Querier interface {
|
||||
GetPolicyVersionByID(ctx context.Context, id pgtype.UUID) (PolicyVersion, error)
|
||||
GetUserByEmailNormalized(ctx context.Context, emailNormalized string) (User, error)
|
||||
GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)
|
||||
// Stores a record that a consumer could not apply. A second delivery of the
|
||||
// same record (same position and value) refreshes the outcome of its row:
|
||||
// after a rewind the handler may fail differently. A different value at a
|
||||
// reused position, after the topic was recreated, gets its own row.
|
||||
InsertConsumerDeadLetter(ctx context.Context, arg InsertConsumerDeadLetterParams) error
|
||||
InsertEmailToken(ctx context.Context, arg InsertEmailTokenParams) error
|
||||
InsertOutboxEvent(ctx context.Context, arg InsertOutboxEventParams) error
|
||||
// Stores a version and returns the stored row with the publication time and
|
||||
@@ -57,6 +62,12 @@ type Querier interface {
|
||||
// surrounding transaction. created_at is never taken from the caller, and a
|
||||
// NULL effective_at means "at publication".
|
||||
InsertPolicyVersion(ctx context.Context, arg InsertPolicyVersionParams) (PolicyVersion, error)
|
||||
// Records that a consumer applies an event, in the transaction of the effect.
|
||||
// It returns 0 rows when the marker exists. While another transaction holds
|
||||
// an uncommitted marker for the same key, the insert waits for it: after a
|
||||
// commit it returns 0, after a rollback it inserts. So a concurrent duplicate
|
||||
// never runs the effect at the same time as the first delivery.
|
||||
InsertProcessedEventMarker(ctx context.Context, arg InsertProcessedEventMarkerParams) (int64, error)
|
||||
InsertSession(ctx context.Context, arg InsertSessionParams) error
|
||||
InsertUser(ctx context.Context, arg InsertUserParams) error
|
||||
InvalidateActiveEmailTokens(ctx context.Context, arg InvalidateActiveEmailTokensParams) (int64, error)
|
||||
@@ -82,6 +93,12 @@ type Querier interface {
|
||||
PolicyVersionExists(ctx context.Context, policyKey string) (bool, error)
|
||||
RevokeSession(ctx context.Context, arg RevokeSessionParams) (int64, error)
|
||||
RevokeUserSessions(ctx context.Context, arg RevokeUserSessionsParams) (int64, error)
|
||||
// Bounds a consumer transaction on the server, local to the transaction.
|
||||
// statement_timeout stops a slow statement; idle_in_transaction_session_timeout
|
||||
// ends the session of a process that froze or lost the network inside the
|
||||
// handler, which releases the processed-event marker that a concurrent
|
||||
// duplicate waits for.
|
||||
SetConsumerTransactionTimeouts(ctx context.Context, arg SetConsumerTransactionTimeoutsParams) error
|
||||
// Bounds the claim transaction on the server. statement_timeout stops a
|
||||
// statement that runs too long; idle_in_transaction_session_timeout ends the
|
||||
// session, and with it the transaction and its row locks, when the client
|
||||
|
||||
Reference in new issue
Block a user