org.cg.eventbus.hook.FetcherHook Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.cg.eventbus Show documentation
Show all versions of org.cg.eventbus Show documentation
Simplified messaging programming model with kafka implementation.
package org.cg.eventbus.hook;
import org.apache.log4j.Logger;
import kafka.javaapi.consumer.ConsumerConnector;
/**
* Hook for event bus Fetcher.
* @author liang.li
*
*/
public class FetcherHook extends Thread{
private static final Logger LOG = Logger.getLogger(FetcherHook.class);
private ConsumerConnector connector;
public FetcherHook(ConsumerConnector connector) {
this.connector = connector;
}
public void run() {
connector.shutdown();
LOG.info("Hook job is triggered. Kafka Consumer Connector is shutdown.");
}
}