mvn install:install-file -Dfile=phonegap-1.1.0.jar -DgroupId?=phonegap -DartifactId?=phonegap -Dversion=1.1.0 -Dpackaging=jar
Run Code Online (Sandbox Code Playgroud)
我使用上面的命令将本地jar安装到maven local repo中.现在我得到了maven repo的依赖.我想从本地仓库中删除它.如何清洁?
我正在通过kafka快速入门:
http://kafka.apache.org/07/quickstart.html
和基本的消费者群体示例:
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example
我已经编写了Consumer和ConsumerThreadPool,如上所示:
import kafka.consumer.KafkaStream;
import kafka.consumer.ConsumerIterator;
public class Consumer implements Runnable {
private KafkaStream m_stream;
private Integer m_threadNumber;
public Consumer(KafkaStream a_stream, Integer a_threadNumber) {
m_threadNumber = a_threadNumber;
m_stream = a_stream;
}
public void run() {
ConsumerIterator<byte[], byte[]> it = m_stream.iterator();
while (it.hasNext()) {
System.out.println("Thread " + m_threadNumber + ": " + new String(it.next().message()));
}
System.out.println("Shutting down Thread: " + m_threadNumber);
}
}
Run Code Online (Sandbox Code Playgroud)
其他几个方面:我使用spring来管理我的zookeeper:
import javax.inject.Named;
import java.util.Properties;
import kafka.consumer.ConsumerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan("com.truecar.inventory.worker.core") …Run Code Online (Sandbox Code Playgroud)