|
@ -1,5 +1,6 @@
|
|
|
package com.yihu.hos.arbiter.services;
|
|
|
|
|
|
import com.yihu.hos.arbiter.configuration.ArbiterServerConfiguration;
|
|
|
import com.yihu.hos.core.log.Logger;
|
|
|
import com.yihu.hos.core.log.LoggerFactory;
|
|
|
import com.yihu.hos.web.framework.constant.ServiceFlowConstant;
|
|
@ -22,9 +23,9 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class ProxyService {
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ProxyService.class);
|
|
|
@Autowired
|
|
|
private CamelContext camelContext;
|
|
|
|
|
|
private CamelContext camelContext;
|
|
|
private ArbiterServerConfiguration configuration;
|
|
|
private ZbusBroker zbusBroker;
|
|
|
private Consumer consumer;
|
|
|
|
|
@ -43,7 +44,7 @@ public class ProxyService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
consumer = new Consumer(zbusBroker, ServiceFlowConstant.SSH);
|
|
|
consumer = new Consumer(zbusBroker, ServiceFlowConstant.SSH + "@" + configuration.getTenant());
|
|
|
try {
|
|
|
consumer.start(this::proxy);
|
|
|
} catch (IOException e) {
|
|
@ -58,6 +59,16 @@ public class ProxyService {
|
|
|
this.zbusBroker = zbusBroker;
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
public void setCamelContext(CamelContext camelContext) {
|
|
|
this.camelContext = camelContext;
|
|
|
}
|
|
|
|
|
|
@Autowired
|
|
|
public void setConfiguration(ArbiterServerConfiguration configuration) {
|
|
|
this.configuration = configuration;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void finalize() throws Throwable {
|
|
|
consumer.close();
|