Need to pass multiple data(object) along with file data,
Is there any serializer available to pass object or any ways?
Here is the code that just pass file data,
props.put("bootstrap.servers", "localhost:9092");
props.put("metadata.broker.list", "localhost:9093");
props.put("producer.type", "async");
props.put("batch.size", "500");
props.put("compression.codec", "1");
props.put("compression.topic", "WRA");
// props.put("key.serializer",
// "org.apache.kafka.common.serialization.StringSerializer");
props.put("key.serializer", "org.apache.kafka.common.serialization.IntegerSerializer");
props.put("value.serializer", "org.apache.kafka.common.serialization.ByteArraySerializer");
org.apache.kafka.clients.producer.Producer<Integer, byte[]> producer = new KafkaProducer<Integer, byte[]>(
props);
producer.send(new ProducerRecord<Integer, byte[]>("topic1", file.getBytes()));