Skip to content

Commit

Permalink
修改测试环境
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbully committed Apr 26, 2013
1 parent 550da16 commit f4844a2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static void main(String[] strings){
try {
ApplicationContext context = new ClassPathXmlApplicationContext("hydra-collector-service.xml");
Bootstrap bootstrap = new Bootstrap();
bootstrap.collectorService = (CollectorService)context.getBean("collectorService");
bootstrap.start();
} catch (Exception e) {
e.printStackTrace();
Expand All @@ -25,4 +26,5 @@ public static void main(String[] strings){
public void start()throws Exception{
collectorService.subscribe(topic);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public class CollectorService {
private ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
private AtomicLong c = new AtomicLong(0L);

public void setConsumer(MessageConsumer consumer) {
this.consumer = consumer;
}

public void setHbaseService(HbaseService hbaseService) {
this.hbaseService = hbaseService;
}

class HbaseConsumer implements MessageListener{
@Override
public void recieveMessages(Message message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
default-autowire="byName">

<bean id="hbaseService" class="com.jd.bdp.hydra.hbase.service.impl.HbaseServiceImpl"/>
<bean id="collectorService" class="com.jd.bdp.hydra.collector.service.CollectorService" />

<bean id="sessionFactory" class="com.taobao.metamorphosis.client.MetaMessageSessionFactory">
<constructor-arg>
<bean class="com.taobao.metamorphosis.client.MetaClientConfig">
<property name="zkConfig">
<bean class="com.taobao.metamorphosis.utils.ZkUtils.ZKConfig">
<constructor-arg>
<value>127.0.0.1:2181</value>
<value>192.168.227.83:2181</value>
</constructor-arg>
<constructor-arg>
<value>30000</value>
Expand Down
4 changes: 4 additions & 0 deletions modules/hydra-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<groupId>com.jd.bdp</groupId>
<artifactId>hydra-interface</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,14 @@ public void setRootService(InterfaceA rootService) {
this.rootService = rootService;
}

public static void main(String[] args) throws InterruptedException {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{
"classpath*:trigger-context.xml",
});
context.start();
Trigger trigger = (Trigger)context.getBean("trigger");
trigger.startWorkWithSleep(5,0);
Thread.sleep(999999999);
}

}
2 changes: 1 addition & 1 deletion modules/hydra-manager/src/main/resources/hydra-manager.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<dubbo:application name="hydra-manager"/>
<dubbo:registry protocol="zookeeper" address="192.168.227.48:2181"/>
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="20889"/>
<dubbo:protocol name="dubbo" port="20890"/>
<bean id="leaderService" class="com.jd.bdp.hydra.dubbomonitor.provider.impl.LeaderServiceImpl">
<property name="appService" ref="appService"/>
<property name="seedService" ref="seedService"/>
Expand Down

0 comments on commit f4844a2

Please sign in to comment.