Explorar el Código

pom 修改,camel-quarz废弃

huangzhiyong hace 6 años
padre
commit
0b3b5c8483

+ 32 - 9
pom.xml

@ -6,7 +6,7 @@
    <parent>
        <groupId>com.yihu.ehr</groupId>
        <artifactId>ehr-cloud-parent</artifactId>
        <version>1.13.1</version>
        <version>1.13.0</version>
    </parent>
    <artifactId>svr-eip-broker</artifactId>
@ -21,7 +21,6 @@
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <!-- spring-boot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -50,15 +49,19 @@
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>hos-web-framework</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-data-jpa</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
@ -114,11 +117,17 @@
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-quartz</artifactId>
            <artifactId>camel-quartz2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-xmljson</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>commons-lang</artifactId>
                    <groupId>commons-lang</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
@ -145,6 +154,20 @@
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>commons-lang</artifactId>
                    <groupId>commons-lang</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-ui-swagger</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 2 - 2
src/main/java/com/yihu/hos/broker/common/camelrouter/MonitorRouterBulider.java

@ -11,13 +11,13 @@ public class MonitorRouterBulider extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        // 服务器硬件数据采集
        from("quartz://monitor/serverMonitor?cron=0 0/1 * * * ?")
        from("quartz2://monitor/serverMonitor?cron=0 0/1 * * * ?")
                .to("bean:serverMonitorService?method=collectEnvHealth");
        // 服务器ip列表检查,用于检查服务器列表是否注册到数据库中,没注册则添加
        // @Scheduled(cron = "0 0 12 * * ?") //每天中午12点触发
        from("quartz://monitor/checkHost?cron=0 0 12 * * ?")
        from("quartz2://monitor/checkHost?cron=0 0 12 * * ?")
                .to("bean:serverMonitorService?method=checkHost");
    }

+ 0 - 23
src/main/java/com/yihu/hos/broker/configurations/ApplicationConfiguration.java

@ -1,23 +0,0 @@
package com.yihu.hos.broker.configurations;
import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
/**
 * @created Airhead 2016/8/1.
 */
@Configuration
public class ApplicationConfiguration implements ApplicationListener<EmbeddedServletContainerInitializedEvent> {
    private int port;
    @Override
    public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
        port = event.getEmbeddedServletContainer().getPort();
    }
    public int getPort() {
        return port;
    }
}

+ 0 - 53
src/main/java/com/yihu/hos/broker/configurations/MongoConfiguration.java

@ -1,53 +0,0 @@
package com.yihu.hos.broker.configurations;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
import static java.util.Collections.singletonList;
/**
 * @created Airhead 2016/7/27.
 */
@RefreshScope
@Configuration
public class MongoConfiguration extends AbstractMongoConfiguration {
//    @Value("${spring.data.mongodb.uri}")
//    private String uri;
    @Value("${spring.data.mongodb.host}")
    private String host;
    @Value("${spring.data.mongodb.port}")
    private int port;
    @Value("${spring.data.mongodb.username}")
    private String username;
    @Value("${spring.data.mongodb.password}")
    private String password;
    @Value("${spring.data.mongodb.authenticationDatabase}")
    private String authenticationDatabase;
    @Value("${spring.data.mongodb.database}")
    private String database;
    @Override
    public String getDatabaseName() {
        return database;
    }
    @Bean
    public Mongo mongo() throws Exception {
        return new MongoClient(singletonList(new ServerAddress(host, port)),
                singletonList(MongoCredential.createCredential(username, authenticationDatabase, password.toCharArray())));
    }
    @Bean
    public MongoClient mongoClient() throws Exception {
        return new MongoClient(singletonList(new ServerAddress(host, port)),
                singletonList(MongoCredential.createCredential(username, authenticationDatabase, password.toCharArray())));
    }
}

+ 0 - 45
src/main/java/com/yihu/hos/broker/configurations/SwaggerConfig.java

@ -1,45 +0,0 @@
package com.yihu.hos.broker.configurations;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig  {
    private static final String PUBLIC_API = "Default";
    @Bean
    public Docket publicAPI() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(PUBLIC_API)
                .genericModelSubstitutes(DeferredResult.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(PathSelectors.regex("/.*"))
                .build()
                .apiInfo(publicApiInfo());
    }
    private ApiInfo publicApiInfo() {
        ApiInfo apiInfo = new ApiInfo("ESB平台API",
                "向其他服务提供的接口。",
                "1.0",
                "No terms of service",
                new Contact("admin@jkzl.com", "", ""),
                "The Apache License, Version 2.0",
                "http://www.apache.org/licenses/LICENSE-2.0.html"
        );
        return apiInfo;
    }
}

+ 2 - 2
src/main/resources/logback-spring.xml

@ -38,8 +38,8 @@
        <InitialContextFactoryName>
            org.apache.activemq.jndi.ActiveMQInitialContextFactory
        </InitialContextFactoryName>
        <ProviderURL>tcp://192.168.200.60:61616</ProviderURL>
        <!--<ProviderURL>tcp://172.19.103.57:61616</ProviderURL>-->
        <!--<ProviderURL>tcp://192.168.200.60:61616</ProviderURL>-->
        <ProviderURL>tcp://172.19.103.57:61616</ProviderURL>
        <userName>admin</userName>
        <password>admin</password>
        <TopicConnectionFactoryBindingName>ConnectionFactory</TopicConnectionFactoryBindingName>