Package kafka.serializer

Examples of kafka.serializer.DefaultEncoder


    @Before
    public void setup() throws Exception {
        final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
        factory = new ConfigurationFactory<>(KafkaProducerFactory.class, validator, Jackson.newObjectMapper(), "dw")
                .build(new File(Resources.getResource("yaml/producer.yaml").toURI()));
        config = KafkaProducerFactory.toProducerConfig(factory, new DefaultEncoder(), null);
    }
View Full Code Here


      ProducerConfig producerConfig = new ProducerConfig(props);


      ProducerMetadata<Integer, byte[]> producerMetadata = new ProducerMetadata<Integer, byte[]>(
          topicName);
      producerMetadata.setValueEncoder(new DefaultEncoder(null));
      producerMetadata.setValueClassType(byte[].class);
      producerMetadata.setKeyEncoder(new IntegerEncoderDecoder(null));
      producerMetadata.setKeyClassType(Integer.class);

      final Producer<Integer, byte[]> producer = new Producer<Integer, byte[]>(producerConfig);
View Full Code Here

TOP

Related Classes of kafka.serializer.DefaultEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.