Closed jeroenrinzema closed 6 years ago
Hmm, we are normally just doing what you are doing, i.e. have a common interface. I assume this may become easier in future: https://github.com/Shopify/sarama/pull/1099. I will close this one as sarama-cluster is now semi-deprecated in favour of ^^
@dim, thanks i was also following Shopify/sarama#1099 and will try again once that PR is merged.
Hi, I am working on a small application that uses sarama-cluster and started to write some tests. Here I started to wonder if it is plausible to to mock sarama cluster without running Kafka. I currently created a small interface of the
Consumer
struct that allows me to mock a sarama-cluster consumer.But I was wondering if there are other ways plausible. I tried creating a mock broker (sarama.NewMockBroker) but was unsuccessful to create/connect a new consumer.
https://gist.github.com/jeroenrinzema/7ea51136183ba42b81413cc6bb8d7e02