MeltwaterArchive / dropwizard-extra

A set of miscellaneous and common Dropwizard utilities
109 stars 45 forks source link

KafkaProducerFactory build overloads confuse keyEncoder and messageEncoder #26

Open mjwillson opened 10 years ago

mjwillson commented 10 years ago

See the comment added below:

    public <V> KafkaProducer<?, V> build(final Class<? extends Encoder<V>> messageEncoder,
                                    final Environment environment,
                                    final String name) {
        // FIXME this is passing the messageEncoder as the keyEncoder
        return build(messageEncoder, null, environment, name);
    }

    public <K, V> KafkaProducer<K, V> build(final Class<? extends Encoder<K>> keyEncoder,
                                       final Class<? extends Encoder<V>> messageEncoder,
                                       final Environment environment,
                                       final String name) {
        return build(keyEncoder, messageEncoder, null, environment, name);
    }