jackdaw icon indicating copy to clipboard operation
jackdaw copied to clipboard

Type checks in jackdaw.client namespace should check for the interface and not the concrete classes

Open dfbernal opened this issue 4 years ago • 0 comments

Currently running into an issue were I'm trying to pass a MockProducer to the partitions-for function but the function is throwing the Got non producer/consumer! error. This is because MockProducer is not of type KafkaProducer but rather implements the Producer interface. I think if we change this type checking to be Producer instead then we'll have the ability to use Mocks along with jackdaw.

(instance? KafkaConsumer producer-or-consumer)
             (.partitionsFor ^KafkaConsumer producer-or-consumer topic-name)

(instance? KafkaProducer producer-or-consumer)
             (.partitionsFor ^KafkaProducer producer-or-consumer topic-name)

dfbernal avatar Dec 10 '20 00:12 dfbernal