chore(deps): bump github.com/sparetimecoders/goamqp from 0.1.5 to 0.2.0

Bumps [github.com/sparetimecoders/goamqp](https://github.com/sparetimecoders/goamqp) from 0.1.5 to 0.2.0.
- [Release notes](https://github.com/sparetimecoders/goamqp/releases)
- [Commits](https://github.com/sparetimecoders/goamqp/compare/v0.1.5...v0.2.0)
This commit is contained in:
2023-10-05 06:25:33 +00:00
parent ef5beccd4b
commit 3fd15e414e
3 changed files with 13 additions and 25 deletions
+4 -17
View File
@@ -101,23 +101,7 @@ func start(closeEvents chan error, logger *log.Entry, connectToAmqpFunc func(url
return fmt.Errorf("event migrations: %w", err)
}
publisher, err := goamqp.NewPublisher(
goamqp.Route{
Type: domain.SubGraphUpdated{},
Key: "SubGraph.Updated",
},
goamqp.Route{
Type: domain.OrganizationAdded{},
Key: "Organization.Added",
},
goamqp.Route{
Type: domain.APIKeyAdded{},
Key: "Organization.APIKeyAdded",
},
)
if err != nil {
return fmt.Errorf("failed to create publisher: %v", err)
}
publisher := goamqp.NewPublisher()
eventPublisher, err := amqp.New(publisher)
if err != nil {
return fmt.Errorf("failed to create event publisher: %v", err)
@@ -142,6 +126,9 @@ func start(closeEvents chan error, logger *log.Entry, connectToAmqpFunc func(url
goamqp.TransientEventStreamConsumer("SubGraph.Updated", serviceCache.Update, domain.SubGraphUpdated{}),
goamqp.TransientEventStreamConsumer("Organization.Added", serviceCache.Update, domain.OrganizationAdded{}),
goamqp.TransientEventStreamConsumer("Organization.APIKeyAdded", serviceCache.Update, domain.APIKeyAdded{}),
goamqp.WithTypeMapping("SubGraph.Updated", domain.SubGraphUpdated{}),
goamqp.WithTypeMapping("Organization.Added", domain.OrganizationAdded{}),
goamqp.WithTypeMapping("Organization.APIKeyAdded", domain.APIKeyAdded{}),
}
if err := conn.Start(rootCtx, setups...); err != nil {
return fmt.Errorf("failed to setup AMQP: %v", err)