koca-cloud-gateway适配东方通(tongweb)7.0.E.6_P7

003_TongWeb_V7.0嵌入式版_响应式编程容器用户指南_70E6P7A01.pdf (1.7 MB)
参考上述文档对网关进行适配

pom.xml参考

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.szkingdom.koca.parent</groupId>
        <artifactId>koca-parent</artifactId>
        <version>5.1.0</version>
    </parent>
    <groupId>szkingdom.yf.koca</groupId>
    <artifactId>koca-gate</artifactId>
    <name>KOCA :: Gateway :: Bootapps</name>

    <properties>
        <springfox.version>3.0.0</springfox.version>
    </properties>

    <dependencies>
        <!--网关服务模块-->
        <dependency>
            <groupId>com.szkingdom.koca.cloud</groupId>
            <artifactId>koca-cloud-starter-gateway</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.projectreactor.ipc</groupId>
                    <artifactId>reactor-netty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor.addons</groupId>
                    <artifactId>reactor-extra</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor.netty</groupId>
                    <artifactId>reactor-netty-http</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor.netty</groupId>
                    <artifactId>reactor-netty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.projectreactor</groupId>
                    <artifactId>reactor-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.szkingdom.koca.cloud</groupId>
            <artifactId>koca-cloud-gateway-server</artifactId>
            <version>5.1.1</version>
        </dependency>

        <dependency>
            <groupId>com.tongweb</groupId>
            <artifactId>tongweb-spring-boot-reactor-starter</artifactId>
            <version>7.0.E.6_P7</version>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-resolver-dns-native-macos</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.szkingdom.koca.cloud</groupId>
            <artifactId>koca-cloud-gateway-support</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.projectreactor</groupId>
                    <artifactId>reactor-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.szkingdom.koca.boot</groupId>
            <artifactId>koca-boot-starter-auth-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-spring-web</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.szkingdom.koca.cloud</groupId>
            <artifactId>koca-cloud-tracing</artifactId>
        </dependency>
        <dependency>
            <groupId>com.szkingdom.koca.boot</groupId>
            <artifactId>koca-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.szkingdom.koca.boot</groupId>
            <artifactId>koca-boot-properties-migrator</artifactId>
        </dependency>
        <!-- 针对Linux/Unix系统的IO包 -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-unix-common</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <classifier>linux-x86_64</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <classifier>osx-x86_64</classifier>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bootstrap</artifactId>
            <version>3.0.5</version>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>fat</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                </manifest>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default-jar</id>
                                <phase>package</phase>
                                <configuration>
                                    <excludes>
                                        <exclude>config/**</exclude>
                                        <exclude>*.yml</exclude>
                                        <exclude>logback-spring.xml</exclude>
                                        <exclude>banner.txt</exclude>
                                    </excludes>
                                    <classifier>assembly</classifier>
                                </configuration>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>full-jar</id>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>full</classifier>
                                </configuration>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default</id>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>assembly</classifier>
                                </configuration>
                                <goals>
                                    <goal>build-info</goal>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>full-jar</id>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>full</classifier>
                                </configuration>
                                <goals>
                                    <goal>build-info</goal>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>

                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/assembly-fat.xml</descriptor>
                            </descriptors>
                            <outputDirectory>target</outputDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>thin</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                </manifest>
                            </archive>
                        </configuration>
                        <executions>
                            <execution>
                                <id>plain-jar</id>
                                <phase>package</phase>
                                <configuration>
                                    <excludes>
                                        <exclude>config/**</exclude>
                                        <exclude>*.yml</exclude>
                                        <exclude>logback-spring.xml</exclude>
                                        <exclude>banner.txt</exclude>
                                    </excludes>
                                    <classifier>bootapp</classifier>
                                </configuration>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default</id>
                                <phase>package</phase>
                                <configuration>
                                    <classifier>full</classifier>
                                </configuration>
                                <goals>
                                    <goal>build-info</goal>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>target/lib</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/assembly-thin.xml</descriptor>
                            </descriptors>
                            <outputDirectory>target</outputDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

配置参考

server:
  tongweb:
    license:
      type: flie
      path: classpath:license.dat

注意:koca-cloud-gateway-server的版本必须是5.1.1

        <dependency>
            <groupId>com.szkingdom.koca.cloud</groupId>
            <artifactId>koca-cloud-gateway-server</artifactId>
            <version>5.1.1</version>
        </dependency>

FAQ: 如果出现下图报错,请升级koca-cloud-gateway-server的版本5.1.1