feat(outbox): relay committed outbox events to Kafka

This commit is contained in:
shira committed 2026-10-06 03:01:53 +03:00
1 parent 78f1651f6b
commit 6c3b34f73e
42 files changed
+3731 -45

No files matched your search

+11 -5
View File
@@ -543,7 +543,17 @@ func accountPayload(account testAccount) []byte {
func newAccountEvent(t *testing.T, account testAccount) domain.DomainEvent {
t.Helper()
event, err := domain.NewDomainEvent(domain.DomainEventInput{
event, err := newAccountEventE(account)
if err != nil {
t.Fatalf("NewDomainEvent() error = %v", err)
}
return event
}
// newAccountEventE is newAccountEvent for goroutines, which must not call
// t.Fatal.
func newAccountEventE(account testAccount) (domain.DomainEvent, error) {
return domain.NewDomainEvent(domain.DomainEventInput{
EventType: testAccountEventType,
SchemaVersion: testEventSchema,
AggregateType: testAggregateType,
@@ -551,10 +561,6 @@ func newAccountEvent(t *testing.T, account testAccount) domain.DomainEvent {
AggregateVersion: account.version,
Payload: accountPayload(account),
})
if err != nil {
t.Fatalf("NewDomainEvent() error = %v", err)
}
return event
}
func readOutboxEvents(ctx context.Context, t *testing.T, pool *pgxpool.Pool) []storedEvent {