Explorar o código

增加arbiter的saas化处理

Airhead %!s(int64=8) %!d(string=hai) anos
pai
achega
eda1db7ed4
Modificáronse 18 ficheiros con 306 adicións e 60 borrados
  1. 11 6
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/HosArbiterApplication.java
  2. 40 0
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/configuration/ArbiterServerConfiguration.java
  3. 34 0
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ArbiterServerController.java
  4. 2 1
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ProxyController.java
  5. 0 34
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ServiceFlowController.java
  6. 25 0
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/listener/ApplicationStartListener.java
  7. 45 0
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/models/ArbiterServer.java
  8. 1 1
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/routers/ServiceFlowEventRouter.java
  9. 77 0
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ArbiterServerService.java
  10. 1 1
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/BrokerServerService.java
  11. 24 10
      hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ServiceFlowService.java
  12. 15 0
      hos-arbiter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  13. 14 1
      hos-arbiter/src/main/resources/application.yml
  14. 7 2
      hos-core/src/main/java/com/yihu/hos/core/http/DefaultClientImpl.java
  15. 1 1
      hos-core/src/main/java/com/yihu/hos/core/http/HTTPClient.java
  16. 5 1
      hos-core/src/main/java/com/yihu/hos/core/http/HttpClientKit.java
  17. 2 1
      hos-web-framework/src/main/java/com/yihu/hos/web/framework/constant/ServiceFlowConstant.java
  18. 2 1
      src/main/java/com/yihu/hos/ESBApplication.java

+ 11 - 6
hos-arbiter/src/main/java/com/yihu/hos/arbiter/HosArbiterApplication.java

@ -1,5 +1,6 @@
package com.yihu.hos.arbiter;
package com.yihu.hos.arbiter;
import com.yihu.hos.arbiter.listener.ApplicationStartListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -9,13 +10,17 @@ import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfigurat
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class HosArbiterApplication implements CommandLineRunner {
public class HosArbiterApplication implements CommandLineRunner {
    public static void main(String[] args) {
//        SpringApplication.run(HosArbiterApplication.class, args);
	public static void main(String[] args) {
		SpringApplication.run(HosArbiterApplication.class, args);
	}
        SpringApplication app = new SpringApplication(HosArbiterApplication.class);
        app.addListeners(new ApplicationStartListener());
        app.run(args);
    }
	@Override
	public void run(String... strings) throws Exception {
    @Override
    public void run(String... strings) throws Exception {
    }
	}
}
}

+ 40 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/configuration/ArbiterServerConfiguration.java

@ -0,0 +1,40 @@
package com.yihu.hos.arbiter.configuration;
import com.yihu.hos.core.datatype.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
 * @author Airhead
 * @since 2016/12/9.
 */
@Configuration
public class ArbiterServerConfiguration {
    @Value("${arbiter.central.url}")
    private String centralUrl;
    @Value("${arbiter.terminal.url}")
    private String terminalUrl;
    @Value("${arbiter.tenant.name}")
    private String tenant;
    public String getCentralUrl() {
        return centralUrl;
    }
    public String getTerminalUrl() {
        return terminalUrl;
    }
    public String getTenant() {
        return tenant;
    }
    public boolean isCentral() {
        return StringUtil.isEmpty(centralUrl);
    }
//    public boolean isTerminal() {
//        return !isCentral();
//    }
}

+ 34 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ArbiterServerController.java

@ -0,0 +1,34 @@
package com.yihu.hos.arbiter.controllers;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.arbiter.models.ArbiterServer;
import com.yihu.hos.arbiter.services.ArbiterServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
/**
 * @author Airhead
 * @since 2016/12/9.
 */
@RestController
@RequestMapping("/arbiter")
public class ArbiterServerController {
    @Autowired
    private ArbiterServerService arbiterServerService;
    @Autowired
    private ObjectMapper objectMapper;
    @RequestMapping()
    public void register(@RequestBody String body) {
        try {
            ArbiterServer arbiterServer = objectMapper.readValue(body, ArbiterServer.class);
            arbiterServerService.save(arbiterServer);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

+ 2 - 1
hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ProxyController.java

@ -1,5 +1,6 @@
package com.yihu.hos.arbiter.controllers;
package com.yihu.hos.arbiter.controllers;
import com.yihu.hos.web.framework.constant.ServiceFlowConstant;
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.ProducerTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -28,6 +29,6 @@ public class ProxyController {
        header.put("event", headers.get("event"));
        header.put("event", headers.get("event"));
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
        producerTemplate.sendBodyAndHeader("service.flow.event", body, header);
        producerTemplate.sendBodyAndHeaders(ServiceFlowConstant.FLOW_EVENT_ENDPOINT, body, header);
    }
    }
}
}

+ 0 - 34
hos-arbiter/src/main/java/com/yihu/hos/arbiter/controllers/ServiceFlowController.java

@ -1,34 +0,0 @@
package com.yihu.hos.arbiter.controllers;
import com.yihu.hos.arbiter.services.ServiceFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
 * @created Airhead 2016/8/16.
 */
@RestController
@RequestMapping("/serviceFlow")
public class ServiceFlowController {
    @Autowired
    private ServiceFlowService serviceFlowService;
    @RequestMapping(method = RequestMethod.POST)
    public void save(String serviceFlow) {
        serviceFlowService.save(null);
    }
    @RequestMapping(method = RequestMethod.GET)
    public String get(String serviceFlow) {
        return serviceFlowService.get(serviceFlow);
    }
    @RequestMapping(method = RequestMethod.PUT)
    public String put(String serviceFlow, String clientInfo) {
        return serviceFlowService.put(serviceFlow, clientInfo);
    }
}

+ 25 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/listener/ApplicationStartListener.java

@ -0,0 +1,25 @@
package com.yihu.hos.arbiter.listener;
import com.yihu.hos.arbiter.services.ArbiterServerService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
public class ApplicationStartListener implements ApplicationListener<ContextRefreshedEvent> {
    private static Logger logger = LogManager.getLogger(ApplicationStartListener.class);
    @Autowired
    private ArbiterServerService arbiterServerService;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        arbiterServerStart();
    }
    public void arbiterServerStart(){
        arbiterServerService.start();
    }
}

+ 45 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/models/ArbiterServer.java

@ -0,0 +1,45 @@
package com.yihu.hos.arbiter.models;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
/**
 * @author Airhead
 * @since 2016/12/9.
 */
@Document
public class ArbiterServer {
    @Id
    private String id;
    @Indexed
    private String tenant;
    private String url;
    public ArbiterServer() {
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getTenant() {
        return tenant;
    }
    public void setTenant(String tenant) {
        this.tenant = tenant;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
}

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

@ -26,7 +26,7 @@ public class ServiceFlowEventRouter extends RouteBuilder {
                activemqConfiguration.getUser(), activemqConfiguration.getPassword(), activemqConfiguration.getBrokerURL());
                activemqConfiguration.getUser(), activemqConfiguration.getPassword(), activemqConfiguration.getBrokerURL());
        // Note we can explicit name the component
        // Note we can explicit name the component
        context.addComponent("service.flow.event", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        context.addComponent("service.flow.event", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        from("service.flow.event:queue:configuration.service.flow")
        from(ServiceFlowConstant.FLOW_EVENT_ENDPOINT)
                .choice()
                .choice()
                .when(header("tenant").isNotNull()).to("bean:serviceFlowService?method=proxy")
                .when(header("tenant").isNotNull()).to("bean:serviceFlowService?method=proxy")
                .when(header("event").isEqualTo(ServiceFlowConstant.SERVICE_FLOW_STARTED)).to("bean:serviceFlowService?method=serviceFlowStarted")
                .when(header("event").isEqualTo(ServiceFlowConstant.SERVICE_FLOW_STARTED)).to("bean:serviceFlowService?method=serviceFlowStarted")

+ 77 - 0
hos-arbiter/src/main/java/com/yihu/hos/arbiter/services/ArbiterServerService.java

@ -0,0 +1,77 @@
package com.yihu.hos.arbiter.services;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.arbiter.configuration.ArbiterServerConfiguration;
import com.yihu.hos.arbiter.models.ArbiterServer;
import com.yihu.hos.core.http.HTTPResponse;
import com.yihu.hos.core.http.HttpClientKit;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
/**
 * @author Airhead
 * @since 2016/12/9.
 */
@Service
public class ArbiterServerService {
    private static final Logger logger = LogManager.getLogger(BrokerServerService.class);
    @Autowired
    private MongoOperations mongoOperations;
    @Autowired
    private ArbiterServerConfiguration configuration;
    @Autowired
    private ObjectMapper objectMapper;
    public void start() {
        //中心Arbiter服务器直接注册
        if (configuration.isCentral()) {
            ArbiterServer arbiterServer = new ArbiterServer();
            arbiterServer.setTenant(configuration.getTenant());
            arbiterServer.setUrl(configuration.getTerminalUrl());
            this.save(arbiterServer);
            return;
        }
        //终端Arbiter服务器调用中心Arbiter服务进行注册
        ArbiterServer arbiterServer = new ArbiterServer();
        arbiterServer.setTenant(configuration.getTenant());
        arbiterServer.setUrl(configuration.getTerminalUrl());
        try {
            String jsonBody = objectMapper.writeValueAsString(arbiterServer);
            HTTPResponse response = HttpClientKit.post(configuration.getCentralUrl(), jsonBody);
            if (response.getStatusCode() != 200) {
                logger.error("register terminal arbiter server failed");
            }
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
    }
    public void save(ArbiterServer arbiterServer) {
        Query query = new Query();
        query.addCriteria(Criteria.where("tenant").is(arbiterServer.getTenant()));
        Update update = new Update();
        update.set("tenant", arbiterServer.getTenant());
        update.set("url", arbiterServer.getUrl());
        mongoOperations.upsert(query, update, ArbiterServer.class);
    }
    public ArbiterServer get(String tenant) {
        Query query = new Query();
        query.addCriteria(Criteria.where("tenant").is(tenant));
        return mongoOperations.findOne(query, ArbiterServer.class);
    }
}

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

@ -80,7 +80,7 @@ public class BrokerServerService {
            ProducerTemplate producerTemplate = createProducerTemplate();
            ProducerTemplate producerTemplate = createProducerTemplate();
            Map<String, Object> header = new HashMap<>();
            Map<String, Object> header = new HashMap<>();
            header.put("event", ServiceFlowConstant.BROKER_SERVER_ON);
            header.put("event", ServiceFlowConstant.BROKER_SERVER_ON);
            producerTemplate.sendBodyAndHeaders("service.flow.event:queue:configuration.service.flow", msg, header);
            producerTemplate.sendBodyAndHeaders(ServiceFlowConstant.FLOW_EVENT_ENDPOINT, msg, header);
        } catch (JsonProcessingException e) {
        } catch (JsonProcessingException e) {
            e.printStackTrace();
            e.printStackTrace();
            logger.error(e.getMessage());
            logger.error(e.getMessage());

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

@ -1,6 +1,7 @@
package com.yihu.hos.arbiter.services;
package com.yihu.hos.arbiter.services;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.arbiter.models.ArbiterServer;
import com.yihu.hos.arbiter.models.BrokerServer;
import com.yihu.hos.arbiter.models.BrokerServer;
import com.yihu.hos.core.http.HTTPResponse;
import com.yihu.hos.core.http.HTTPResponse;
import com.yihu.hos.core.http.HttpClientKit;
import com.yihu.hos.core.http.HttpClientKit;
@ -33,13 +34,15 @@ import java.util.Map;
@Service("serviceFlowService")
@Service("serviceFlowService")
public class ServiceFlowService {
public class ServiceFlowService {
    private static final Logger logger = LogManager.getLogger(BrokerServerService.class);
    private static final Logger logger = LogManager.getLogger(BrokerServerService.class);
    @Autowired
    @Autowired
    private MongoOperations mongoOperations;
    private MongoOperations mongoOperations;
    @Autowired
    @Autowired
    private ObjectMapper objectMapper;
    private ObjectMapper objectMapper;
    @Autowired
    @Autowired
    private BrokerServerService brokerServerService;
    private BrokerServerService brokerServerService;
    @Autowired
    private ArbiterServerService arbiterServerService;
    public void save(ServiceFlow serviceFlow) {
    public void save(ServiceFlow serviceFlow) {
@ -76,17 +79,24 @@ public class ServiceFlowService {
        return mongoOperations.findAll(ServiceFlow.class);
        return mongoOperations.findAll(ServiceFlow.class);
    }
    }
    public String put(String serviceName, String ClientInfo) {
        return null;
    }
    /**
     * admin发过来的服务流程启动事件处理。
     *
     * @param msg serviceFlow
     */
    public void serviceFlowStarted(String msg) {
    public void serviceFlowStarted(String msg) {
        flowController("post", "/esb/serviceFlow/start", msg);
        flowController("post", "/esb/serviceFlow/start", msg);
    }
    }
//    public void serviceFlowStarted(String msg, BrokerServer brokerServer) {
//        flowController("post", "/esb/serviceFlow/start", msg, brokerServer);
//    }
    /**
     * 没有使用重载,是因为Camel在判断路由时会产生歧义,而无法路由。
     *
     * @param msg          serviceFlow
     * @param brokerServer brokerServer Info
     */
    public void serviceFlowStart(String msg, BrokerServer brokerServer) {
        flowController("post", "/esb/serviceFlow/start", msg, brokerServer);
    }
    public void serviceFlowStopped(String msg) {
    public void serviceFlowStopped(String msg) {
        flowController("post", "/esb/serviceFlow/stop", msg);
        flowController("post", "/esb/serviceFlow/stop", msg);
@ -114,7 +124,7 @@ public class ServiceFlowService {
            try {
            try {
                BrokerServer brokerServer = objectMapper.readValue(msg, BrokerServer.class);
                BrokerServer brokerServer = objectMapper.readValue(msg, BrokerServer.class);
                String serviceFlowMsg = objectMapper.writeValueAsString(serviceFlow);
                String serviceFlowMsg = objectMapper.writeValueAsString(serviceFlow);
                serviceFlowStarted(serviceFlowMsg);
                serviceFlowStart(serviceFlowMsg, brokerServer);
            } catch (IOException e) {
            } catch (IOException e) {
                e.printStackTrace();
                e.printStackTrace();
            }
            }
@ -133,7 +143,11 @@ public class ServiceFlowService {
     * @param header 消息头部信息
     * @param header 消息头部信息
     * @param msg    消息
     * @param msg    消息
     */
     */
    public void proxy(Map<String, Object> header, String msg) {
    public void proxy(Map<String, String> header, String msg) {
        String tenant = header.get("tenant");
        ArbiterServer arbiterServer = arbiterServerService.get(tenant);
        header.remove("tenant");
        HttpClientKit.post(arbiterServer.getUrl(), msg, header);
    }
    }
    private void flowController(String method, String path, String msg) {
    private void flowController(String method, String path, String msg) {

+ 15 - 0
hos-arbiter/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -4,6 +4,21 @@
      "name": "arbiter.timer.period",
      "name": "arbiter.timer.period",
      "type": "java.lang.String",
      "type": "java.lang.String",
      "description": "Description for arbiter.timer.period."
      "description": "Description for arbiter.timer.period."
    },
    {
      "name": "arbiter.central.url",
      "type": "java.lang.String",
      "description": "Description for arbiter.central.url."
    },
    {
      "name": "arbiter.terminal.url",
      "type": "java.lang.String",
      "description": "Description for arbiter.terminal.url."
    },
    {
      "name": "arbiter.tenant.name",
      "type": "java.lang.String",
      "description": "Description for arbiter.tenant.name."
    }
    }
  ]
  ]
}
}

+ 14 - 1
hos-arbiter/src/main/resources/application.yml

@ -3,6 +3,8 @@ server:
spring:
spring:
  application:
  application:
    name: ArbiterServer
    name: ArbiterServer
  central:
    url: http://127.0.0.1:10135
---
---
spring:
spring:
@ -22,6 +24,8 @@ spring:
arbiter:
arbiter:
  timer:
  timer:
      period: 10000
      period: 10000
  central:
    url: http://127.0.0.1:10135
---
---
spring:
spring:
@ -41,6 +45,8 @@ spring:
arbiter:
arbiter:
  timer:
  timer:
      period: 10000
      period: 10000
  central:
    url: http://127.0.0.1:10135
---
---
spring:
spring:
@ -60,7 +66,8 @@ spring:
arbiter:
arbiter:
  timer:
  timer:
      period: 10000
      period: 10000
  central:
    url: http://127.0.0.1:10135
---
---
spring:
spring:
  profiles: lfq
  profiles: lfq
@ -79,3 +86,9 @@ spring:
arbiter:
arbiter:
  timer:
  timer:
      period: 10000
      period: 10000
  central:
    url:
  terminal:
    url: http://127.0.0.1:10135
  tenant:
    name: jkzl

+ 7 - 2
hos-core/src/main/java/com/yihu/hos/core/http/DefaultClientImpl.java

@ -89,11 +89,16 @@ class DefaultClientImpl implements HTTPClient {
    }
    }
    @Override
    @Override
    public HTTPResponse post(String url, String json) {
    public HTTPResponse post(String url, String json, Map<String, String> headers) {
        try {
        try {
            Request.Builder builder = new Request.Builder();
            if (headers != null) {
                builder.headers(Headers.of(headers));
            }
            final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
            final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
            RequestBody body = RequestBody.create(JSON, json);
            RequestBody body = RequestBody.create(JSON, json);
            Request request = new Request.Builder()
            Request request = builder
                    .url(url)
                    .url(url)
                    .post(body)
                    .post(body)
                    .build();
                    .build();

+ 1 - 1
hos-core/src/main/java/com/yihu/hos/core/http/HTTPClient.java

@ -24,7 +24,7 @@ public interface HTTPClient {
    HTTPResponse post(String url, Map<String, String> params, Map<String, String> headers);
    HTTPResponse post(String url, Map<String, String> params, Map<String, String> headers);
    HTTPResponse post(String url, String json);
    HTTPResponse post(String url, String json, Map<String, String> headers);
    HTTPResponse postFile(String url, String path);
    HTTPResponse postFile(String url, String path);

+ 5 - 1
hos-core/src/main/java/com/yihu/hos/core/http/HttpClientKit.java

@ -67,7 +67,11 @@ public class HttpClientKit {
    }
    }
    public static HTTPResponse post(String url, String json) {
    public static HTTPResponse post(String url, String json) {
        return use().post(url, json);
        return use().post(url, json, null);
    }
    public static HTTPResponse post(String url, String json, Map<String, String> headers){
        return use().post(url, json, headers);
    }
    }
    public static HTTPResponse post(String url, Map<String, String> params, Map<String, String> headers) {
    public static HTTPResponse post(String url, Map<String, String> params, Map<String, String> headers) {

+ 2 - 1
hos-web-framework/src/main/java/com/yihu/hos/web/framework/constant/ServiceFlowConstant.java

@ -6,7 +6,8 @@ package com.yihu.hos.web.framework.constant;
 */
 */
public interface ServiceFlowConstant {
public interface ServiceFlowConstant {
    //流程-队列名称
    //流程-队列名称
    String FLOW_QUEUE_NAME = "configuration.service.flow";
    String FLOW_EVENT_QUEUE = "configuration.service.flow";
    String FLOW_EVENT_ENDPOINT = "service.flow.event:queue:configuration.service.flow";
    //流程-模板类型
    //流程-模板类型
    String JAVA = "java";
    String JAVA = "java";

+ 2 - 1
src/main/java/com/yihu/hos/ESBApplication.java

@ -1,5 +1,6 @@
package com.yihu.hos;
package com.yihu.hos;
import com.yihu.hos.web.framework.constant.ServiceFlowConstant;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -16,6 +17,6 @@ public class ESBApplication {
    @Bean
    @Bean
    public Queue queue() {
    public Queue queue() {
        return new ActiveMQQueue("configuration.service.flow");
        return new ActiveMQQueue(ServiceFlowConstant.FLOW_EVENT_QUEUE);
    }
    }
}
}