All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.panhongan.util.kafka.MessageConsoleWriter Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package com.github.panhongan.util.kafka;


import java.util.List;

import com.github.panhongan.util.kafka.AbstractKafkaMessageHandler;


public class MessageConsoleWriter extends AbstractKafkaMessageHandler {

	@Override
	public Object processMessage(String topic, int partition_id, String message) {
		System.out.println(topic + "_" + partition_id + " : " + message);
		return true;
	}
	
	@Override
	public Object processMessage(String topic, int partition_id, List msg_list) {
		for (String message : msg_list) {
			System.out.println(topic + "_" + partition_id + " : " + message);
		}
		return true;
	}


	@Override
	public boolean init() {
		return true;
	}

	@Override
	public void uninit() {
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy