Browse Source

流程编辑器逻辑修改

zhenglingfeng 8 years ago
parent
commit
38db89104d

+ 1 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/routers/SerivceHealthRouter.java

@ -6,7 +6,7 @@ import org.springframework.stereotype.Component;
/**
 * @created Airhead 2016/8/1.
 */
@Component
//@Component
public class SerivceHealthRouter extends RouteBuilder {
    @Override
    public void configure() throws Exception {

+ 1 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/BrokerServerService.java

@ -64,7 +64,7 @@ public class BrokerServerService {
        WriteResult writeResult = mongoOperations.upsert(query, update, BrokerServer.class);
        if (writeResult.isUpdateOfExisting()) {
            //避免Broker重启的情况
            HTTPResponse response = HttpClientKit.post(brokerServer.getURL() + "/esb/heartbeat");
            HTTPResponse response = HttpClientKit.get(brokerServer.getURL() + "/esb/heartbeat");
            if (response.getStatusCode() == 200 && brokerServer.isRegistered()) {
                return;
            }

+ 5 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/EndpointService.java

@ -1,6 +1,7 @@
package com.yihu.hos.arbiter.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.core.datatype.StringUtil;
import com.yihu.hos.core.http.HTTPResponse;
import com.yihu.hos.core.http.HttpClientKit;
import com.yihu.hos.web.framework.model.bo.Endpoint;
@ -102,6 +103,10 @@ public class EndpointService {
     */
    private void remoteCheck(Endpoint endpoint) {
        String url = endpoint.getHealthCheckURL();
        if (StringUtil.isEmpty(url)) {
            return;
        }
        HTTPResponse response = HttpClientKit.get(url);
        if (response.getStatusCode() == 200) {
            return;

+ 1 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ServiceFlowService.java

@ -321,7 +321,7 @@ public class ServiceFlowService {
                BrokerServer brokerServer = objectMapper.readValue(msg, BrokerServer.class);
                String serviceFlowMsg = objectMapper.writeValueAsString(serviceFlow);
                boolean result = sendMessage(brokerServer, "post", "/esb/serviceFlow/serverServiceFlow", serviceFlowMsg);
                boolean result = sendMessage(brokerServer, "post", "/esb/serviceFlow/start", serviceFlowMsg);
                if (!result) {
                    logger.error("sendMessage to broker start failed, broker:" + brokerServer.getURL() + ", msg:" + serviceFlowMsg);

+ 2 - 2
hos-arbiter/src/main/resources/application.yml

@ -22,9 +22,9 @@ arbiter:
  timer:
    period: 10000
  central:
    url:
    url: localhost:15555
  terminal:
    url: 192.168.131.119:15555
    url: localhost:15555
  tenant:
    name: jkzl

+ 1 - 1
hos-broker/src/main/resources/application.yml

@ -48,7 +48,7 @@ spring:
    port: 8066
hos:
  esb:
    rest-url: http://192.168.131.119:8080/esb
    rest-url: http://localhost:8080/esb
  arbiter:
    enable: true
    url: http://localhost:10135

+ 4 - 4
hos-camel/src/main/java/crawler/route/CrawlerRouteBulider.java

@ -13,19 +13,19 @@ public class CrawlerRouteBulider extends RouteBuilder {
    public void configure() throws Exception {
        from("jetty:http://192.168.131.96:8066/crawlerPull").routeId("crawlerPull")
                .process(new DefaultHttpProcessor()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .process(new DefaultHttpProcessor("{\"jobId\":\"5ad5c11655d443c30155d477a6b10000\"}")).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientList");
        from("jetty:http://192.168.131.96:8066/crawlerPush").routeId("crawlerPush")
                .process(new DefaultHttpProcessor()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .process(new DefaultHttpProcessor("{\"jobId\":\"5ad5c11655d443c30155d477a6b10000\"}")).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patient");
        from("jetty:http://192.168.131.96:8066/crawlerFlowPull").routeId("crawlerFlowPull")
                .process(new DefaultHttpProcessor()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .process(new DefaultHttpProcessor("{\"jobId\":\"5ad5c11655d443c30155d477a6b10000\"}")).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientListFlow");
        from("jetty:http://192.168.131.96:8066/crawlerFlowPush").routeId("crawlerFlowPush")
                .process(new DefaultHttpProcessor()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .process(new DefaultHttpProcessor("{\"jobId\":\"5ad5c11655d443c30155d477a6b10000\"}")).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientFlow");
    }
}

+ 1 - 1
hos-camel/src/main/java/crawler/route/QuartzRoute.java

@ -15,7 +15,7 @@ public class QuartzRoute extends RouteBuilder {
        from("quartz://myGroupName/myTimerName?cron=0/5+*+*+*+*+?")
                .process(new DefaultHttpProcessor() {
                .process(new DefaultHttpProcessor("{\"jobId\":\"5ad5c11655d443c30155d477a6b10000\"}") {
                    @Override
                    public void process(Exchange exchange) throws Exception {
                        System.out.println("I'm running every 5 sec...Change by XXXX===========");

+ 1 - 1
hos-camel/src/main/java/crawler/route/RouteBulider1.java

@ -15,7 +15,7 @@ public class RouteBulider1 extends RouteBuilder {
        from("quartz://myGroup/myTimerName?cron=0/5 * * * * ? ").routeId("list")
                .to("http://localhost:9999/list")
                .split().method(Split.class, "splitJsonArray")
                .process(new HttpProcessor()).to("http://localhost:9999/str")
                .process(new HttpProcessor("str")).to("http://localhost:9999/str")
                .process(new AggregateProcessor("key1"))
                .aggregate(header("test_correlation_key"), new Aggregate()).completionSize(3).to("stream:out");