Provides the ability to configure the creation of the GCP PubSub topic. Specifically I wanted to be able to specify message retention. This paves the way for replaying messages to enable projections to resync.
Affected Components
Event Bus
Related Issues
Nothing specific but begins to address projection errors. Only for GCP though.
Solution and Design
The pubsub client also has a CreateTopicWithConfig function which takes an additional argument of a TopicConfig struct. By adding an additional function to the gcp eventbus package (WithTopicOptions, copypasta of WithPubSubOptions but updates different struct property) we can supply a TopicConfig struct as an option to NewEventBus().
Steps to test and verify
Run TestEventBusWithConfigIntegration test in eventbus_test.go.
Coverage increased (+0.02%) to 68.831% when pulling 9b8a8fd295d7ce913596c5b8c35a6fed11ee0820 on marcwickenden:main into 1a724818998425e1b7a84932cfa378c92c504c7d on looplab:main.
Description
Provides the ability to configure the creation of the GCP PubSub topic. Specifically I wanted to be able to specify message retention. This paves the way for replaying messages to enable projections to resync.
Affected Components
Related Issues
Nothing specific but begins to address projection errors. Only for GCP though.
Solution and Design
The pubsub client also has a CreateTopicWithConfig function which takes an additional argument of a
TopicConfig
struct. By adding an additional function to the gcp eventbus package (WithTopicOptions
, copypasta ofWithPubSubOptions
but updates different struct property) we can supply aTopicConfig
struct as an option toNewEventBus()
.Steps to test and verify
TestEventBusWithConfigIntegration
test in eventbus_test.go.