|
@ -1,16 +1,23 @@
|
|
|
package com.yihu.hos.common.camelrouter;
|
|
|
|
|
|
import com.yihu.hos.common.configuration.ArbiterConfiguration;
|
|
|
import org.apache.camel.builder.RouteBuilder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
|
* @created Airhead 2016/8/1.
|
|
|
*/
|
|
|
//@Component
|
|
|
@Component
|
|
|
public class BrokerServerRouter extends RouteBuilder {
|
|
|
@Autowired
|
|
|
private ArbiterConfiguration arbiterConfiguration;
|
|
|
|
|
|
@Override
|
|
|
public void configure() throws Exception {
|
|
|
// from("timer:brokerServerOnline?period={{timer.period}}")
|
|
|
// .to("bean:brokerServerService?method=brokerServerOnline");
|
|
|
if (arbiterConfiguration.getEnable()) {
|
|
|
from("timer:brokerServerOnline?period={{hos.timer.period}}")
|
|
|
.to("bean:brokerServerService?method=brokerServerOnline");
|
|
|
}
|
|
|
}
|
|
|
}
|