Skip to content

Commit

Permalink
Initialize subscribers for each consumer group (#225)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Bremgartner <lucas@elblox.com>
  • Loading branch information
breml and Lucas Bremgartner authored Apr 4, 2021
1 parent e083ac2 commit f7f908f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pubsub/tests/test_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,9 @@ func generateConsumerGroup(t *testing.T, pubSubConstructor ConsumerGroupPubSubCo
// create a pubsub to ensure that the consumer group exists
// for those providers that require subscription before publishing messages (e.g. Google Cloud PubSub)
pub, sub := pubSubConstructor(t, groupName)
if subInitializer, ok := sub.(message.SubscribeInitializer); ok {
require.NoError(t, subInitializer.SubscribeInitialize(topicName))
}
_, err := sub.Subscribe(context.Background(), topicName)
require.NoError(t, err)
closePubSub(t, pub, sub)
Expand Down

0 comments on commit f7f908f

Please # to comment.