Jelajahi Sumber

Merge branch 'master' of luofaqiang/esb into master

luofaqiang 8 tahun lalu
induk
melakukan
f97ef50fee

+ 19 - 0
hos-arbiter/pom.xml

@ -68,4 +68,23 @@
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.yihu.hos.arbiter.HosArbiterApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 3 - 5
hos-arbiter/src/main/resources/application.yml

@ -22,7 +22,7 @@ arbiter:
  timer:
    period: 10000
  central:
    url: localhost:9020
    url: 172.19.103.57:9020
  tenant:
    name: jkzl
@ -45,9 +45,7 @@ arbiter:
  timer:
    period: 10000
  central:
    url: 172.17.110.202:15555
  terminal:
    url: 172.17.110.202:15555
    url: 172.19.103.57:9020
  tenant:
    name: jkzl
  mycat:
@ -71,6 +69,6 @@ arbiter:
  timer:
      period: 10000
  central:
    url: 192.168.131.38:15555
    url: 172.19.103.57:9020
  tenant:
    name: yichang

+ 7 - 1
hos-arbiter/src/test/java/com/yihu/hos/arbiter/services/ProxyServiceTest.java

@ -1,6 +1,9 @@
package com.yihu.hos.arbiter.services;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestComponent;
import org.zbus.broker.ZbusBroker;
import org.zbus.mq.Producer;
import org.zbus.net.http.Message;
@ -9,10 +12,13 @@ import org.zbus.net.http.Message;
 * @author Airhead
 * @since 2016/12/22.
 */
@SpringBootTest
public class ProxyServiceTest {
    @Autowired
    private ZbusBroker zbusBroker;
    @Test
    public void proxy() throws Exception {
        Producer producer = new Producer(new ZbusBroker("192.168.131.38:15555"), "RemoteControl");
        Producer producer = new Producer(zbusBroker, "RemoteControl");
        producer.createMQ();//确定为创建消息队列需要显示调用
        Message msg = new Message();
        msg.setBody("hello world"); //消息体底层是byte[]

+ 18 - 1
hos-broker/pom.xml

@ -129,5 +129,22 @@
        </dependency>
        <!-- camel end -->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.yihu.hos.broker.HosBrokerApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 3 - 5
hos-broker/src/main/java/com/yihu/hos/broker/services/BusinessLogService.java

@ -1,16 +1,13 @@
package com.yihu.hos.broker.services;
import ch.qos.logback.classic.spi.ILoggingEvent;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.hos.broker.models.BusinessLog;
import com.yihu.hos.core.datatype.DateUtil;
import com.yihu.hos.core.log.Logger;
import com.yihu.hos.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Date;
import java.util.Map;
@ -28,11 +25,12 @@ public class BusinessLogService {
     * camel.messageId The message id
     * camel.correlationId The correlation id of the exchange if it's correlated. For example a sub message from the Splitter EIP
     * camel.transactionKey The id of the transaction for transacted exchanges.
     *                      Note the id is not unique, but its the id of the transaction template that marks the transaction boundary for the given transaction.
     *                      Hence we decided to name the key transactionKey and not transactionID to point out this fact.
     * Note the id is not unique, but its the id of the transaction template that marks the transaction boundary for the given transaction.
     * Hence we decided to name the key transactionKey and not transactionID to point out this fact.
     * camel.routeId The id of the route, in which the exchange is currently being routed
     * camel.breadcrumbId An unique id used for tracking messages across transports.
     * camel.contextId The camel context id used for tracking the message from different camel context.
     *
     * @param event
     */
    public void log(ILoggingEvent event) {

+ 18 - 0
hos-dfs/pom.xml

@ -52,5 +52,23 @@
            <artifactId>commons-io</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.yihu.hos.dfs.HosDfsApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

+ 2 - 2
hos-dfs/src/main/java/com/yihu/com/hos/HosDfsApplication.java

@ -1,6 +1,6 @@
package com.yihu.com.hos;
package com.yihu.hos.dfs;
import com.yihu.com.hos.configuration.ZbusConfiguration;
import com.yihu.hos.dfs.configuration.ZbusConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;

+ 1 - 1
hos-dfs/src/main/java/com/yihu/com/hos/configuration/ZbusConfiguration.java

@ -1,4 +1,4 @@
package com.yihu.com.hos.configuration;
package com.yihu.hos.dfs.configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

+ 2 - 2
hos-dfs/src/main/java/com/yihu/com/hos/controller/DFSController.java

@ -1,6 +1,6 @@
package com.yihu.com.hos.controller;
package com.yihu.hos.dfs.controller;
import com.yihu.com.hos.service.DFSService;
import com.yihu.hos.dfs.service.DFSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

+ 1 - 1
hos-dfs/src/main/java/com/yihu/com/hos/service/DFSService.java

@ -1,4 +1,4 @@
package com.yihu.com.hos.service;
package com.yihu.hos.dfs.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

+ 1 - 1
hos-dfs/src/test/java/com/yihu/com/hos/HosFdsApplicationTests.java

@ -1,4 +1,4 @@
package com.yihu.com.hos;
package com.yihu.hos.dfs;
import org.junit.Test;
import org.junit.runner.RunWith;

+ 127 - 8
hos-parent/pom.xml

@ -9,12 +9,6 @@
    <packaging>pom</packaging>
    <version>1.3.0</version>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.5.RELEASE</version>
    </parent>
    <properties>
        <hos-version>1.3.0</hos-version>
        <spring-boot-version>1.4.5.RELEASE</spring-boot-version>
@ -77,6 +71,7 @@
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>
    <pluginRepositories>
@ -119,16 +114,140 @@
    </repositories>
    <build>
        <defaultGoal>install</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <maxmem>512M</maxmem>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.4.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>activemq-data</directory>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.15</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>camel-maven-plugin</artifactId>
                    <version>${camel-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>camel-package-maven-plugin</artifactId>
                    <version>${camel-version}</version>
                </plugin>
                <plugin>
                    <groupId>io.hawt</groupId>
                    <artifactId>hawtio-maven-plugin</artifactId>
                    <version>${hawtio-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${bundle-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.camel</groupId>
                    <artifactId>camel-api-component-maven-plugin</artifactId>
                    <version>${camel-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.10</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <childDelegation>false</childDelegation>
                    <useFile>true</useFile>
                    <failIfNoTests>false</failIfNoTests>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencyManagement>
        <dependencies>
            <!-- import Spring Boot before Camel -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot-version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>

+ 19 - 0
pom.xml

@ -186,4 +186,23 @@
        </dependency>
        <!-- swagger end -->
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>com.yihu.hos.ESBApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>