main
unity 9 months ago
parent 73fe457ac4
commit 66990995d2

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>food-mq</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>package</id>
<formats>
<format>dir</format>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>application.properties</include>
<include>logback.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/conf</directory>
<outputDirectory>conf</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/logs</directory>
<outputDirectory>logs</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/temp</directory>
<outputDirectory>temp</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${artifactId}-${version}.jar</source>
<outputDirectory>lib</outputDirectory>
<destName>${artifactId}-${version}.jar</destName>
</file>
</files>
</assembly>

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-amqp:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-rabbit:2.0.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.amqp:spring-amqp:2.0.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.3.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.rabbitmq:amqp-client:5.4.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-test:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.0.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
<orderEntry type="library" name="Maven: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.assertj:assertj-core:3.9.1" level="project" />
<orderEntry type="library" name="Maven: org.mockito:mockito-core:2.15.0" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.7.11" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy-agent:1.7.11" level="project" />
<orderEntry type="library" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-test:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.boot:dubbo-spring-boot-starter:0.2.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.9" level="project" />
<orderEntry type="library" name="Maven: jline:jline:0.9.94" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.boot:dubbo-spring-boot-autoconfigure:0.2.0" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:dubbo:2.6.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.spring:spring-context-support:1.0.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:4.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:4.0.1" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.31.Final" level="project" />
<orderEntry type="library" name="Maven: com.jwsaas:common-utils:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.0" level="project" />
<orderEntry type="module" module-name="food-api" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.4" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0" level="project" />
</component>
</module>

@ -0,0 +1,177 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jwsaas</groupId>
<artifactId>food-parent</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>food-mq</artifactId>
<name>food-mq</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.deploy.skip>true</maven.deploy.skip>
<spring-boot.version>2.0.8.RELEASE</spring-boot.version>
<dubbo-spring-boot-starter.version>0.2.0</dubbo-spring-boot-starter.version>
<!-- MQTT Client -->
<mqttv3.version>1.2.0</mqttv3.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!-- dubbo -->
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-spring-boot-starter.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version><!-- 2.6.4 -->
<exclusions>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.spring</groupId>
<artifactId>spring-context-support</artifactId>
<version>1.0.2</version>
</dependency>
<!-- curator -->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>4.0.1</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</dependency>
<!-- jwsaas -->
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>common-utils</artifactId>
</dependency>
<!-- foodv2 -->
<dependency>
<groupId>com.jwsaas</groupId>
<artifactId>food-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- MQTT Client -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${mqttv3.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>application.properties</exclude>
<exclude>logback.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,140 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general passthrough startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
rem as is.
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
rem If not set then all parameters starting with the second will be passed.
set _PASS_THROUGH=true
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -i %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

File diff suppressed because it is too large Load Diff

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -a %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -q %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -e %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,156 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general passthrough startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem
rem ********************************************************************
rem NOTE - This script has been modified to run the TestWrapper sample
rem application and should NOT be used as a base for your own
rem applications. All of the documentation assumes that you are
rem working from the default source script:
rem WRAPPER_HOME/src/bin/App.bat.in
rem ********************************************************************
rem
rem ********************************************************************
rem NOTE - This script has been modified to run the TestWrapper sample
rem application and should NOT be used as a base for your own
rem applications. All of the documentation assumes that you are
rem working from the default source script:
rem WRAPPER_HOME/src/bin/App.bat.in
rem ********************************************************************
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
rem as is.
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
rem If not set then all parameters starting with the second will be passed.
set _PASS_THROUGH=true
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -c %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -t %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -p %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -r %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -r %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,60 @@
encoding=UTF-8
wrapper.lang=zh_CN
#using the system default JDK environment variable
wrapper.java.command=java
#set.JAVA_HOME=/home/jdk1.8.0_65
#wrapper.java.command=%JAVA_HOME%/bin/java
wrapper.java.command.loglevel=INFO
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
wrapper.java.classpath.1=./
wrapper.java.classpath.2=../conf/
wrapper.java.classpath.3=../lib/*.jar
wrapper.java.library.path.1=../lib
wrapper.java.additional.auto_bits=TRUE
#set the default parameters
wrapper.java.additional.1=-Xms512m
wrapper.java.additional.2=-Xmx1024m
wrapper.java.additional.3=-XX:PermSize=256m
wrapper.java.additional.4=-XX:MaxPermSize=512m
wrapper.java.additional.5=-Djava.net.preferIPv4Stack=true
wrapper.java.additional.6=-Dsun.lang.ClassLoader.allowArraySyntax=true
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=128
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=512
# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=org.springframework.boot.loader.JarLauncher
wrapper.app.parameter.2=--spring.config.location=../conf/application.properties
wrapper.app.parameter.3=--logging.config=../conf/logback.xml
wrapper.app.parameter.4=--logging.path=../logs
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=../logs/mq_YYYYMMDD.log
wrapper.logfile.rollmode=DATE
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.maxsize=0
wrapper.logfile.maxfiles=0
wrapper.syslog.loglevel=NONE
wrapper.ignore_sequence_gaps=TRUE
wrapper.pidfile.strict=TRUE
wrapper.console.title=estore mq application
wrapper.name=estore_mq
wrapper.displayname=estore mq application
wrapper.description=estore mq application
wrapper.ntservice.dependency.1=
wrapper.ntservice.starttype=AUTO_START
wrapper.ntservice.interactive=false

@ -0,0 +1,15 @@
package com.jwsaas;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan(basePackages = "com.jwsaas")
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

@ -0,0 +1,30 @@
package com.jwsaas;
public class Constant {
/**
*
*/
public static final String DEFAULT_DB_SIGN = "10001";
/**
*
*/
public static final String CREATE_USER = "OpenApi";
/**
* redis
*/
public static final String DEFAULT_REDIS_PREFIX = "food20OpenApi";
/**
* (shared)
*/
public static final String SHARED_SIGN = "shared";
/**
* (food2)
*/
public static final String FOOD_SIGN = "food2";
}

@ -0,0 +1,29 @@
package com.jwsaas;
public class RabbitConstant {
public final static String EXCHANGE_NAME = "exchange";// 交换器
public final static String QUEUE_NAME_POS_MONITOR = "queue4posmonitor";// POS监控
public final static String QUEUE_NAME_ORDER_BURDEN = "queue4orderburden";// 订单库存耗料
public final static String QUEUE_NAME_BUSINESS_ORDER_PLUS = "queue4businessorderplus";// 销售数据上传
public final static String ROUTING_KEY_BUSINESS_ORDER_PLUS = "routing4businessorderplus";// 销售数据上传
public final static String QUEUE_NAME_BUSLOG = "queue4buslog";// 操作日志数据上传
public final static String QUEUE_NAME_PRODUCT_SALE_STOCK = "queue4productsalestock";// 商品库存扣减
public final static String QUEUE_NAME_PROGRAM_SALE_STOCK = "queue4programsalestock";// 小程序商品库存扣减
public static final String QUEUE_NAME_BUSINESS_ORDER_PLUS_DELAY = "queue4businessorderplus4delay";//销售数据延时上传
public static final String ROUTING_KEY_BUSINESS_ORDER_PLUS_DELAY = "routingkey4businessorderplusdelay";//
public static final String ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY = "routing4jwprogramordernotifydelay";//巨为小程序订单延时推送
public static final String QUEUE_NAME_JW_PROGRAM_ORDER_DELAY = "queue4jwprogramorderdelay";//巨为小程序订单推送延时队列;
public static final String ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY = "routing4jwprogramordernotify";//巨为小程序订单推送;
public static final String QUEUE_NAME_JW_PROGRAM_ORDER_NOTIFY = "queue4jwprogramordernotify";//巨为小程序订单推送队列;
}

@ -0,0 +1,91 @@
package com.jwsaas.config;
import org.springframework.stereotype.Component;
import com.alibaba.dubbo.config.annotation.Reference;
import com.jwsaas.cache.CacheService;
import com.jwsaas.service.food.PosInfoService;
import com.jwsaas.service.food.ProductStoreStockService;
import com.jwsaas.service.food.ProgramStoreOrderProductService;
import com.jwsaas.service.food.ProgramStoreProductService;
import com.jwsaas.service.food.StoreBusinessTicketService;
import com.jwsaas.service.food.StoreOperationLogService;
import com.jwsaas.service.food.StoreProductSaleStockService;
import com.jwsaas.service.food.StoreProductService;
import com.jwsaas.service.ops.TenantPosInfoService;
import com.jwsaas.service.ops.TenantStoreAuthService;
@Component
public class DubboSupport {
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private CacheService cacheService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private TenantPosInfoService tenantPosInfoService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private TenantStoreAuthService tenantStoreAuthService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private PosInfoService posInfoService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private ProductStoreStockService productStoreStockService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private StoreBusinessTicketService storeBusinessTicketService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private StoreOperationLogService storeOperationLogService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private StoreProductSaleStockService storeProductSaleStockService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private StoreProductService storeProductService;
@Reference(group = "${food.service.group}", version = "${food.service.version}", application = "${dubbo.application.id}", consumer = "${dubbo.consumer.id}", registry = "${dubbo.registry.id}")
private ProgramStoreOrderProductService programStoreOrderProductService;
public CacheService getCacheService() {
return cacheService;
}
public TenantPosInfoService getTenantPosInfoService() {
return tenantPosInfoService;
}
public TenantStoreAuthService getTenantStoreAuthService() {
return tenantStoreAuthService;
}
public PosInfoService getPosInfoService() {
return posInfoService;
}
public ProductStoreStockService getProductStoreStockService() {
return productStoreStockService;
}
public StoreBusinessTicketService getStoreBusinessTicketService() {
return storeBusinessTicketService;
}
public StoreOperationLogService getStoreOperationLogService() {
return storeOperationLogService;
}
public StoreProductSaleStockService getStoreProductSaleStockService() {
return storeProductSaleStockService;
}
public StoreProductService getStoreProductService() {
return storeProductService;
}
public ProgramStoreOrderProductService getProgramStoreOrderProductService() {
return programStoreOrderProductService;
}
}

@ -0,0 +1,27 @@
package com.jwsaas.config;
import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
/**
* 使
* @author yangaming
*
*/
public class ExpirationMessagePostProcessor implements MessagePostProcessor {
private final Long ttl;//毫秒
public ExpirationMessagePostProcessor(Long ttl) {
this.ttl = ttl;
}
@Override
public Message postProcessMessage(Message message) throws AmqpException {
message.getMessageProperties().setExpiration(ttl.toString());
return message;
}
}

@ -0,0 +1,38 @@
package com.jwsaas.config;
import com.jwsaas.RabbitConstant;
import com.jwsaas.util.JSONUtil;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class MQMessageSender {
@Autowired
private RabbitTemplate rabbitTemplate;
/**
* send4businessorderplus()
*/
public void send4businessorderplus(String tenantId, Map<String, Object> message, CorrelationData correlationData, long ttl) throws Exception {
message.put("tenantId", tenantId);
MessagePostProcessor msgPostProcessor = new ExpirationMessagePostProcessor(ttl);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_BUSINESS_ORDER_PLUS_DELAY, JSONUtil.toJSONString(message), msgPostProcessor, correlationData);
}
/**
* send4jwprogramordermessage()
*/
public void send4jwprogramordermessage(String tenantId, Map<String, Object> message, CorrelationData correlationData, long ttl) throws Exception {
message.put("tenantId", tenantId);
MessagePostProcessor msgPostProcessor = new ExpirationMessagePostProcessor(ttl);
this.rabbitTemplate.convertAndSend(RabbitConstant.EXCHANGE_NAME, RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY, JSONUtil.toJSONString(message), msgPostProcessor, correlationData);
}
}

@ -0,0 +1,874 @@
package com.jwsaas.config;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.jwsaas.cache.CacheService;
import com.jwsaas.mqtt.MqttClientExt;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.*;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.fasterxml.jackson.core.type.TypeReference;
import com.jwsaas.Constant;
import com.jwsaas.RabbitConstant;
import com.jwsaas.condition.Criteria;
import com.jwsaas.condition.Restrictions;
import com.jwsaas.entity.food.BusinessOrderUpload;
import com.jwsaas.entity.food.PosInfo;
import com.jwsaas.entity.food.ProductStoreStockLog;
import com.jwsaas.entity.food.ProgramStoreOrderProduct;
import com.jwsaas.entity.food.StoreBusinessTicket;
import com.jwsaas.entity.food.StoreBusinessTicketCheck;
import com.jwsaas.entity.food.StoreBusinessTicketDelivery;
import com.jwsaas.entity.food.StoreBusinessTicketInfo;
import com.jwsaas.entity.food.StoreOperationLog;
import com.jwsaas.entity.food.StoreOrderProduct;
import com.jwsaas.entity.food.StoreOrderProductInfo;
import com.jwsaas.entity.food.StoreOrderProductMake;
import com.jwsaas.entity.food.StorePay;
import com.jwsaas.entity.ops.TenantPosInfo;
import com.jwsaas.entity.ops.TenantStoreAuth;
import com.jwsaas.service.food.PosInfoService;
import com.jwsaas.service.food.ProductStoreStockService;
import com.jwsaas.service.food.ProgramStoreOrderProductService;
import com.jwsaas.service.food.StoreBusinessTicketService;
import com.jwsaas.service.food.StoreOperationLogService;
import com.jwsaas.service.food.StoreProductSaleStockService;
import com.jwsaas.service.food.StoreProductService;
import com.jwsaas.service.ops.TenantPosInfoService;
import com.jwsaas.service.ops.TenantStoreAuthService;
import com.jwsaas.util.JSONUtil;
import com.jwsaas.utils.DateUtils;
import com.rabbitmq.client.Channel;
import javax.annotation.Resource;
@Configuration
public class RabbitMQConfig {
private Logger logger = LoggerFactory.getLogger(getClass());
@Value("${spring.rabbitmq.host}")
private String host;
@Value("${spring.rabbitmq.port}")
private String port;
@Value("${spring.rabbitmq.username}")
private String username;
@Value("${spring.rabbitmq.password}")
private String password;
@Value("${spring.rabbitmq.publisherConfirms}")
private Boolean publisherConfirms;
@Value("${spring.rabbitmq.virtualHost}")
private String virtualHost;
@Autowired
private DubboSupport dubboSupport;
@Autowired
private MQMessageSender mqMessageSender;
@Resource
private MqttClientExt mqttClient;
private final static String DISABLED_BODUO_TENANTID_STRS = "";
// 创建工厂连接
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setAddresses(this.host);
connectionFactory.setUsername(this.username);
connectionFactory.setPassword(this.password);
connectionFactory.setVirtualHost(this.virtualHost);
connectionFactory.setPublisherConfirms(this.publisherConfirms); // 必须要设置
connectionFactory.setChannelCacheSize(100);
return connectionFactory;
}
// 直连交换机
@Bean
public DirectExchange defaultExchange() {
return new DirectExchange(RabbitConstant.EXCHANGE_NAME);
}
// 队列-POS监控
@Bean(name = "queue4posmonitor")
public Queue queue4posmonitor() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_POS_MONITOR).build();
}
@Bean(name = "messageContainer4posmonitor")
public SimpleMessageListenerContainer messageContainer4posmonitor() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
// container.setTaskExecutor(taskExecutor);
container.setQueues(this.queue4posmonitor()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(10);
container.setConcurrentConsumers(5);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.debug("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
TenantPosInfo tenantPosInfo = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("tenantPosInfo")), new TypeReference<TenantPosInfo>() {
});
logger.debug("tenantId:" + tenantId);
logger.debug("type:" + type);
logger.debug("tenantPosInfo:" + tenantPosInfo);
TenantPosInfoService tenantPosInfoService = dubboSupport.getTenantPosInfoService();
TenantStoreAuthService tenantStoreAuthService = dubboSupport.getTenantStoreAuthService();
PosInfoService posInfoService = dubboSupport.getPosInfoService();
Date currentDate = new Date();
int rows = tenantPosInfoService.updateMonitorInfo(Constant.DEFAULT_DB_SIGN, tenantPosInfo);
List<TenantStoreAuth> listAuth = tenantStoreAuthService.findList(Constant.DEFAULT_DB_SIGN, "storeId", tenantPosInfo.getStoreId());
if (listAuth != null) {
for (TenantStoreAuth auth : listAuth) {
auth.setLastDate(DateUtils.format(currentDate, "yyyy-MM-dd HH:mm:ss"));
tenantStoreAuthService.update(Constant.DEFAULT_DB_SIGN, auth);
}
}
logger.debug("rows:" + rows);
if (rows == 0) {
saveMissPos(tenantId, tenantPosInfoService, posInfoService, tenantPosInfo.getStoreId(), tenantPosInfo.getPosNo());
}
logger.info("MQ消息(POS监控信息)处理完成--->[{},{},{}]", tenantId, type, currentDate);
} catch (Exception e) {
logger.error("MQ消息(POS监控信息)处理发生异常", e);
}
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}
});
return container;
}
/**
* POS
*/
private void saveMissPos(String tenantId, TenantPosInfoService tenantPosInfoService, PosInfoService posInfoService, String storeId, String posNo) {
String info = "遗漏POS信息处理";
logger.debug(">>>>>>>" + info + "。。。");
logger.debug("tenantId:" + tenantId);
logger.debug("storeId:" + storeId);
logger.debug("posNo:" + posNo);
try {
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("storeId", storeId));
criteria.add(Restrictions.eq("posNo", posNo));
List<PosInfo> posInfoList = posInfoService.getList(tenantId, criteria);
if (CollectionUtils.isNotEmpty(posInfoList)) {
PosInfo posInfo = posInfoList.get(0);
TenantPosInfo tenantPosInfo = new TenantPosInfo();
tenantPosInfo.setAppSign(posInfo.getAppSign());
tenantPosInfo.setCpuNumber(posInfo.getCpuNumber());
tenantPosInfo.setDeleteFlag(posInfo.getDeleteFlag());
tenantPosInfo.setDescription(posInfo.getDescription());
tenantPosInfo.setMACAddress(posInfo.getMACAddress());
tenantPosInfo.setName(posInfo.getName());
tenantPosInfo.setPosNo(posInfo.getPosNo());
tenantPosInfo.setSerialNumber(posInfo.getSerialNumber());
tenantPosInfo.setStatus(0);
tenantPosInfo.setStoreId(posInfo.getStoreId());
tenantPosInfo.setStoreNo(posInfo.getStoreNo());
tenantPosInfo.setTenantCode(tenantId);
tenantPosInfo.setTenantId(Constant.DEFAULT_DB_SIGN);
tenantPosInfo.setTerminalType(posInfo.getTerminalType());
tenantPosInfo.setCreateDate(posInfo.getCreateDate());
tenantPosInfo.setCreateUser(posInfo.getCreateUser());
tenantPosInfo.setStoreName(null);
tenantPosInfo.setAliasName(posInfo.getAliasName());// 别名
tenantPosInfoService.save(Constant.DEFAULT_DB_SIGN, tenantPosInfo);
}
} catch (Exception e) {
logger.error(info + ",发生异常", e);
}
}
// 队列-销售耗料
@Bean(name = "queue4orderburden")
public Queue queue4orderburden() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_ORDER_BURDEN).build();
}
@Bean(name = "messageContainer4orderburden")
public SimpleMessageListenerContainer messageContainer4orderburden() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
// container.setTaskExecutor(taskExecutor);
container.setQueues(this.queue4orderburden()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(1);
container.setConcurrentConsumers(1);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.debug("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
List<ProductStoreStockLog> stockList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("stockList")), new TypeReference<List<ProductStoreStockLog>>() {
});
logger.debug("tenantId:" + tenantId);
logger.debug("type:" + type);
logger.debug("stockList:" + stockList);
Date currentDate = new Date();
ProductStoreStockService productStoreStockService = dubboSupport.getProductStoreStockService();
productStoreStockService.saveStockOutBySalesOrder(tenantId, stockList);
logger.info("MQ消息(库存耗料数据)处理完成--->[{},{},{}]", tenantId, type, currentDate);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {
logger.error("MQ消息(库存耗料数据)处理发生异常", e);
}
}
});
return container;
}
// 队列-销售数据上传
@Bean(name = "queue4businessorderplus")
public Queue queue4businessorderplus() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_BUSINESS_ORDER_PLUS).build();
}
@Bean(name = "messageContainer4businessorderplus")
public SimpleMessageListenerContainer messageContainer4businessorderplus() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
// container.setTaskExecutor(taskExecutor);
container.setQueues(this.queue4businessorderplus()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(10);
container.setConcurrentConsumers(10);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.debug("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
StoreBusinessTicket storeBusinessTicket = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("storeBusinessTicket")), new TypeReference<StoreBusinessTicket>() {
});
List<StoreBusinessTicketInfo> ticketInfoList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("ticketInfoList")), new TypeReference<List<StoreBusinessTicketInfo>>() {
});
List<StoreOrderProduct> orderProductList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("orderProductList")), new TypeReference<List<StoreOrderProduct>>() {
});
for (StoreOrderProduct storeOrderProduct : orderProductList) {
storeOrderProduct.setProductName(filter(storeOrderProduct.getProductName()));
}
List<StoreOrderProductInfo> orderProductInfoList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("orderProductInfoList")), new TypeReference<List<StoreOrderProductInfo>>() {
});
List<StorePay> payList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("payList")), new TypeReference<List<StorePay>>() {
});
List<StoreOrderProductMake> makeList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("makeList")), new TypeReference<List<StoreOrderProductMake>>() {
});
List<StoreBusinessTicketDelivery> deliveryList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("deliveryList")), new TypeReference<List<StoreBusinessTicketDelivery>>() {
});
storeBusinessTicket.setId(null);
storeBusinessTicket.setCreateDate(null);
logger.debug("tenantId:" + tenantId);
logger.debug("type:" + type);
logger.debug("storeBusinessTicket:" + storeBusinessTicket);
logger.debug("ticketInfoList:" + ticketInfoList);
logger.debug("orderProductList:" + orderProductList);
logger.debug("orderProductInfoList:" + orderProductInfoList);
logger.debug("payList:" + payList);
logger.debug("makeList:" + makeList);
logger.debug("deliveryList:" + deliveryList);
Date currentDate = new Date();
StoreBusinessTicketService storeBusinessTicketService = dubboSupport.getStoreBusinessTicketService();
Map<String, Object> extData = new HashMap<>();
if (storeBusinessTicket.getBusMode() == 2) {
// 门店外送单
// 营业模式,busMode,0 柜台-1 外带-2 电话外卖
// 3-餐桌4-美团外卖5-饿了么6-百度外卖7-微信点餐
// 单据状态,status,0等待付款1已支付2已退单3已取消4已完成
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("storeId", storeBusinessTicket.getStoreId()));
criteria.add(Restrictions.eq("`no`", storeBusinessTicket.getNo()));
criteria.add(Restrictions.order("saleDate", "DESC"));
List<StoreBusinessTicket> ticketList = storeBusinessTicketService.getList(tenantId, criteria);
logger.debug("============ticketList:" + JSONUtil.toJSONString(ticketList));
List<String> ticketIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(ticketList)) {
for (StoreBusinessTicket ticket : ticketList) {
ticketIdList.add(ticket.getId());
}
}
extData.put("ticketIdList", ticketIdList);
}
BusinessOrderUpload businessOrderUpload = new BusinessOrderUpload();
businessOrderUpload.setTicket(storeBusinessTicket);
businessOrderUpload.setTicketInfos(ticketInfoList);
businessOrderUpload.setProducts(orderProductList);
businessOrderUpload.setProductInfos(orderProductInfoList);
businessOrderUpload.setPays(payList);
businessOrderUpload.setMakes(makeList);
businessOrderUpload.setDeliveryInfos(deliveryList);
// 保存上传数据
StoreBusinessTicketCheck ticketCheck = storeBusinessTicketService.saveBusinessTicketPlus(tenantId, businessOrderUpload, extData);
if ("1".equals(ticketCheck.getStatus())) {
// 保存成功之后的事件处理
if (storeBusinessTicket.getBusMode() == 2) {
if (storeBusinessTicket.getStatus() != 0) {
// 在这儿处理门店外送(外卖)订单重复上传的问题
List<String> ticketIdList = (List<String>) extData.get("ticketIdList");
if (CollectionUtils.isNotEmpty(ticketIdList)) {
String storeId = storeBusinessTicket.getStoreId();
String ticketNo = storeBusinessTicket.getNo();
for (String tempTicketId : ticketIdList) {
try {
storeBusinessTicketService.updateTicketToInvalid(tenantId, storeId, tempTicketId, ticketNo);
} catch (Exception e) {
logger.error("MQ消息(销售数据上传)(updateTicketToInvalid操作),发生异常[{},{},{},{}]", tenantId, storeId, tempTicketId, ticketNo);
logger.error("MQ消息(销售数据上传)(updateTicketToInvalid操作),发生异常", e);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
try{
mqMessageSender.send4businessorderplus(tenantId,dataMap,correlationData,1000L*60*10);//延时10分钟;
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}catch (Exception ex){
logger.error("MQ消息(销售数据上传,updateTicketToInvalid操作延时队列报错)处理发生异常", ex);
}
}
}
}
}
}
logger.info("MQ消息(销售数据上传)处理完成--->[{},{},{}]", tenantId, type, currentDate);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} else {
logger.error("MQ消息(销售数据上传)服务器繁忙,重新处理--->[{},{},{}]", tenantId, type, currentDate);
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
try{
mqMessageSender.send4businessorderplus(tenantId,dataMap,correlationData,1000L*60*10);//延时10分钟;
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}catch (Exception e){
logger.error("MQ消息(销售数据上传,未接收到消息处,延时队列报错)处理发生异常", e);
}
}
} catch (Exception e) {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.info("receive msg : " + bodyContent);
logger.error("MQ消息(销售数据上传)处理发生异常", e);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
String tenantId = dataMap.get("tenantId").toString();
CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString());
try{
mqMessageSender.send4businessorderplus(tenantId,dataMap,correlationData,1000L*60*10);//延时10分钟;
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}catch (Exception ex){
logger.error("MQ消息(销售数据上传,未接收到消息------catch---处,延时队列报错)处理发生异常", ex);
}
}
}
});
return container;
}
// 队列-操作日志上传
@Bean(name = "queue4buslog")
public Queue queue4buslog() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_BUSLOG).build();
}
@Bean(name = "messageContainer4buslog")
public SimpleMessageListenerContainer messageContainer4buslog() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
container.setQueues(this.queue4buslog()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(1);
container.setConcurrentConsumers(1);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.debug("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
List<StoreOperationLog> logList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("buslog")), new TypeReference<List<StoreOperationLog>>() {
});
logger.debug("tenantId:" + tenantId);
logger.debug("type:" + type);
logger.debug("logList:" + logList);
Date currentDate = new Date();
StoreOperationLogService storeOperationLogService = dubboSupport.getStoreOperationLogService();
storeOperationLogService.save(tenantId, logList);
logger.info("MQ消息(操作日志上传)处理完成--->[{},{},{}]", tenantId, type, currentDate);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {
logger.error("MQ消息(操作日志上传)处理发生异常", e);
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}
}
});
return container;
}
// 队列-操作日志上传
@Bean(name = "queue4productsalestock")
public Queue queue4productsalestock() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_PRODUCT_SALE_STOCK).build();
}
@Bean(name = "messageContainer4productsalestock")
public SimpleMessageListenerContainer messageContainer4productsalestock() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
container.setQueues(this.queue4productsalestock()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(1);
container.setConcurrentConsumers(1);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.debug("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
List<StoreOrderProduct> orderProductList = JSONUtil.parseObject(JSONUtil.toJSONString(dataMap.get("orderProductList")), new TypeReference<List<StoreOrderProduct>>() {
});
logger.debug("tenantId:" + tenantId);
logger.debug("type:" + type);
logger.debug("orderProductList:" + orderProductList);
Date currentDate = new Date();
StoreProductSaleStockService storeProductSaleStockService = dubboSupport.getStoreProductSaleStockService();
sortOrderProductBurden(orderProductList);
Map<String, Object> typeMap = new HashMap<String, Object>();
String specId_temp = "";
int i = 0;
double count = 0.00;
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
int listLength = orderProductList.size();
for (StoreOrderProduct storeOrderProduct : orderProductList) {
String specId = storeOrderProduct.getSpecId();
if (!specId_temp.equals(specId)) {
if (i != 0) {
typeMap.put("tenantId", storeOrderProduct.getTenantId());
typeMap.put("storeId", storeOrderProduct.getStoreId());
typeMap.put("specId", specId_temp);
typeMap.put("count", storeOrderProduct.getCount() - storeOrderProduct.getRcount());
result.add(typeMap);
// 分类改变时,清除缓存
typeMap = new HashMap<String, Object>();
}
count = 0.00;
specId_temp = storeOrderProduct.getSpecId();
}
count = count + (storeOrderProduct.getCount() - storeOrderProduct.getRcount());
i = i + 1;
if (i == listLength) {
typeMap.put("tenantId", storeOrderProduct.getTenantId());
typeMap.put("storeId", storeOrderProduct.getStoreId());
typeMap.put("specId", specId_temp);
typeMap.put("count", count);
result.add(typeMap);
// 分类改变时,清除缓存
typeMap = new HashMap<String, Object>();
}
}
List<StoreOrderProduct> list = new ArrayList<StoreOrderProduct>();
for (Map<String, Object> map : result) {
StoreOrderProduct entityProduct = new StoreOrderProduct();
entityProduct.setTenantId(map.get("tenantId").toString());
entityProduct.setStoreId(map.get("storeId").toString());
entityProduct.setSpecId(map.get("specId").toString());
entityProduct.setCount(Double.parseDouble(map.get("count").toString()));
list.add(entityProduct);
}
// 库存扣减项
storeProductSaleStockService.updateStoreProductSaleStock(tenantId, list);
logger.info("MQ消息(商品库存扣减)处理完成--->[{},{},{}]", tenantId, type, currentDate);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {
logger.error("MQ消息(商品库存扣减)处理发生异常", e);
}
}
});
return container;
}
private void sortOrderProductBurden(List<StoreOrderProduct> data) {
Collections.sort(data, new Comparator<StoreOrderProduct>() {
@Override
public int compare(StoreOrderProduct o1, StoreOrderProduct o2) {
String a = o1.getSpecId();
String b = o2.getSpecId();
// 升序
return a.compareTo(b);
}
});
}
private void sortOrderProgramBurden(List<ProgramStoreOrderProduct> data) {
Collections.sort(data, new Comparator<ProgramStoreOrderProduct>() {
@Override
public int compare(ProgramStoreOrderProduct o1, ProgramStoreOrderProduct o2) {
String a = o1.getSpecId();
String b = o2.getSpecId();
// 升序
return a.compareTo(b);
}
});
}
public static String filter(String str) {
if (str.trim().isEmpty()) {
return str;
}
String pattern = "[\uD83C\uDC04-\uD83C\uDE1A]|[\uD83D\uDC66-\uD83D\uDC69]|[\uD83D\uDC66\uD83C\uDFFB-\uD83D\uDC69\uD83C\uDFFF]|[\uD83D\uDE45\uD83C\uDFFB-\uD83D\uDE4F\uD83C\uDFFF]|[\uD83C\uDC00-\uD83D\uDFFF]|[\uD83E\uDD10-\uD83E\uDDC0]|[\uD83D\uDE00-\uD83D\uDE4F]|[\uD83D\uDE80-\uD83D\uDEF6]|[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]";
String reStr = "";
Pattern emoji = Pattern.compile(pattern);
Matcher emojiMatcher = emoji.matcher(str);
str = emojiMatcher.replaceAll(reStr);
return str.replace("\\", "");
}
// 队列-小程序库存变更日志上传
@Bean(name = "queue4programsalestock")
public Queue queue4programsalestock() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_PROGRAM_SALE_STOCK).build();
}
@Bean(name = "messageContainer4programsalestock")
public SimpleMessageListenerContainer messageContainer4programsalestock() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
container.setQueues(this.queue4programsalestock()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(1);
container.setConcurrentConsumers(1);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener() {
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try {
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.error("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
String tenantId = dataMap.get("tenantId").toString();
String type = dataMap.get("type").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
String storeId = dataMap.get("storeId").toString();
String busNo = dataMap.get("busNo").toString();
logger.error("tenantId:====>" + tenantId);
logger.error("type:====>" + type);
logger.error("storeId:====>" + storeId);
logger.error("busNo:====>" + busNo);
Date currentDate = new Date();
ProgramStoreOrderProductService programStoreOrderProductService = dubboSupport.getProgramStoreOrderProductService();
StoreProductService storeProductService = dubboSupport.getStoreProductService();
Criteria criteria = new Criteria();
criteria.add(Restrictions.eq("tenantId", tenantId));
criteria.add(Restrictions.eq("storeId", storeId));
criteria.add(Restrictions.eq("busNo", busNo));
List<ProgramStoreOrderProduct> orderProductList = programStoreOrderProductService.getList(tenantId, criteria);
sortOrderProgramBurden(orderProductList);
Map<String, Object> typeMap = new HashMap<String, Object>();
String specId_temp = "";
int i = 0;
double count = 0.00;
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
int listLength = orderProductList.size();
for (ProgramStoreOrderProduct storeOrderProduct : orderProductList) {
String specId = storeOrderProduct.getSpecId();
if (!specId_temp.equals(specId)) {
if (i != 0) {
typeMap.put("tenantId", storeOrderProduct.getTenantId());
typeMap.put("storeId", storeOrderProduct.getStoreId());
typeMap.put("specId", specId_temp);
typeMap.put("count", storeOrderProduct.getCount() - storeOrderProduct.getRcount());
result.add(typeMap);
// 分类改变时,清除缓存
typeMap = new HashMap<String, Object>();
}
count = 0.00;
specId_temp = storeOrderProduct.getSpecId();
}
count = count + (storeOrderProduct.getCount() - storeOrderProduct.getRcount());
i = i + 1;
if (i == listLength) {
typeMap.put("tenantId", storeOrderProduct.getTenantId());
typeMap.put("storeId", storeOrderProduct.getStoreId());
typeMap.put("specId", specId_temp);
typeMap.put("count", count);
result.add(typeMap);
// 分类改变时,清除缓存
typeMap = new HashMap<String, Object>();
}
}
List<ProgramStoreOrderProduct> list = new ArrayList<ProgramStoreOrderProduct>();
for (Map<String, Object> map : result) {
ProgramStoreOrderProduct entityProduct = new ProgramStoreOrderProduct();
entityProduct.setTenantId(map.get("tenantId").toString());
entityProduct.setStoreId(map.get("storeId").toString());
entityProduct.setSpecId(map.get("specId").toString());
if ("refundagree".equals(type)) {
entityProduct.setCount(0 - Double.parseDouble(map.get("count").toString()));
} else if ("confirm".equals(type)) {
entityProduct.setCount(Double.parseDouble(map.get("count").toString()));
}
list.add(entityProduct);
}
// 库存扣减项
storeProductService.updateStoreProductSaleStock(tenantId, list);
logger.info("MQ消息(小程序商品库存扣减)处理完成--->[{},{},{}]", tenantId, type, currentDate);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (Exception e) {
logger.error("MQ消息(小程序商品库存扣减)处理发生异常", e);
}
}
});
return container;
}
/**
*
*/
@Bean(name = "queue4businessorderplus4delay")
public Queue queue4businessorderplus4delay() {
logger.error("queue4businessorderplus4delay --------------------------->>>>>>>>>>>>>>> 已创建 ");
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_BUSINESS_ORDER_PLUS_DELAY)
.withArgument("x-dead-letter-exchange", RabbitConstant.EXCHANGE_NAME)
.withArgument("x-dead-letter-routing-key", RabbitConstant.ROUTING_KEY_BUSINESS_ORDER_PLUS)
.build();
}
@Bean(name = "binding4businessorderplus4delay")
public Binding binding4businessorderplus4delay() {
return BindingBuilder.bind(this.queue4businessorderplus4delay()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_BUSINESS_ORDER_PLUS_DELAY);
}
@Bean(name = "queue4jwprogramordernotify")
public Queue queue4jwprogramordernotify() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_JW_PROGRAM_ORDER_NOTIFY).build();
}
@Bean(name = "messageContainer4jwprogramordernotify")
public SimpleMessageListenerContainer messageContainer4jwprogramordernotify() {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(this.connectionFactory());
container.setQueues(this.queue4jwprogramordernotify()); // 设置要监听的队列
container.setExposeListenerChannel(true);
container.setMaxConcurrentConsumers(3);
container.setConcurrentConsumers(1);
container.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 设置确认模式手工确认
container.setMessageListener(new ChannelAwareMessageListener(){
@Override
public void onMessage(Message message, Channel channel) throws Exception {
try{
byte[] body = message.getBody();
String bodyContent = new String(body);
logger.error("receive msg : " + bodyContent);
Map<String, Object> dataMap = JSONUtil.parseObject(bodyContent, new TypeReference<Map<String, Object>>() {
});
logger.debug("dataMap: " + JSONUtil.toJSONString(dataMap));
CacheService cacheService = dubboSupport.getCacheService();
String tenantId = dataMap.get("tenantId").toString();
String storeId = dataMap.get("storeId").toString();
String orderNo = dataMap.get("orderNo").toString();
//2023-04-14 定制租户号直接返回确认
if(DISABLED_BODUO_TENANTID_STRS.contains(tenantId)){
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
return ;
}
Integer reSendNums = dataMap.get("reSendNums") == null ? 0:(Integer)dataMap.get("reSendNums");
Object programOrderIds = cacheService.get(tenantId, "program_" + storeId);
if (programOrderIds != null) {
Map<String, String> orderIds = (Map<String, String>) cacheService.get(tenantId, "program_" + storeId);
if(orderIds.containsKey(orderNo)){
if(reSendNums < 5){
reSendNums = reSendNums + 1;
String ids = "";
for (Map.Entry<String, String> entry : orderIds.entrySet()) {
ids = ids + entry.getKey() + ",";
}
if (ids.length() > 0) {
ids = ids.substring(0, ids.length() - 1);
}
if (ids != null && !"".equals(ids)) {
DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Map<String, String> order = new HashMap<>();
order.put("program", ids);
order.put("date", fmt.format(new Date()));
mqttClient.Publish("program/cy2/" + tenantId + "/" + storeId, JSONUtil.toJSONString(order));
logger.error( " mqtt 推送信息 ," + tenantId + "/" + storeId+"/order:{}", JSONUtil.toJSONString(order));
} else {
logger.error( "mqtt 推送信息,"+tenantId+","+storeId+","+orderNo+",未发布");
}
Map<String,Object> orderMap = new HashMap<>();
orderMap.put("tenantId",tenantId);
orderMap.put("storeId",storeId);
orderMap.put("orderNo",orderNo);
orderMap.put("reSendNums",reSendNums);
mqMessageSender.send4jwprogramordermessage(tenantId,orderMap,new CorrelationData(UUID.randomUUID().toString()),1000L*90);
}
}
}
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}catch (Exception e){
logger.error("MQ消息(巨为小程序订单推送)处理发生异常", e);
// 确认消息成功消费
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
}
}
});
return container;
}
/**
*
*/
@Bean(name = "queue4jwprogramorder4delay")
public Queue queue4jwprogramorder4delay() {
return QueueBuilder.durable(RabbitConstant.QUEUE_NAME_JW_PROGRAM_ORDER_DELAY)
.withArgument("x-dead-letter-exchange", RabbitConstant.EXCHANGE_NAME)
.withArgument("x-dead-letter-routing-key", RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY)
.build();
}
@Bean(name = "binding4jwprogramorder4delay")
public Binding binding4jwprogramorder4delay() {
return BindingBuilder.bind(this.queue4jwprogramorder4delay()).to(this.defaultExchange()).with(RabbitConstant.ROUTING_KEY_JW_PROGRAM_ORDER_NOTIFY_DELAY);
}
}

@ -0,0 +1,308 @@
package com.jwsaas.mqtt;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
//// @Resource private MqttClientExt mqttClient;
// mqttClient.Publisher();
public class MqttClientExt {
private static Logger logger = LoggerFactory.getLogger(MqttClientExt.class);
private final int QOS = 2;
private ScheduledExecutorService scheduler;
private MqttClient mqttClient;
private MqttConnectOptions options;
private String clientId;
private String host;
private Integer port;
private Integer keepAlive;
private Integer connectionTimeout;
private String userName = "00000";
private String passwd = "0000000000000000000";
private Queue<Map<String,Object>> wait = null;
public MqttClientExt() {
wait = new ConcurrentLinkedQueue<Map<String,Object>>();
}
private void connect() {
try {
logger.info("初始化MQTT消息服务......");
String serverURI = "tcp://" + this.getHost() + ":" + this.getPort();
MemoryPersistence persistence = new MemoryPersistence();
this.mqttClient = new MqttClient(serverURI, this.getClientId(), persistence);
// MQTT的连接设置
this.options = new MqttConnectOptions();
//设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录这里设置为true表示每次连接到服务器都以新的身份连接
//如果是true那么清理所有离线消息即QoS1或者2的所有未接收内容
this.options.setCleanSession(false);
this.options.setMaxInflight(10000);
// 设置超时时间 单位为秒
this.options.setConnectionTimeout(this.getConnectionTimeout());
// 设置会话心跳时间 单位为秒 服务器会每隔20秒的时间向客户端发送个消息判断客户端是否在线但这个方法并没有重连的机制
this.options.setKeepAliveInterval(this.getKeepAlive());
this.options.setUserName(this.getUserName());
this.options.setPassword(this.getPasswd().toCharArray());
//设置是否自动重连
this.options.setAutomaticReconnect(false);// this.options.setAutomaticReconnect(true);
// 设置回调
mqttClient.setCallback(new PushCallback());
mqttClient.connect(options);
} catch (Exception ex) {
mqttClient = null;
logger.error("连接MQTT消息中心异常",ex);
}
}
public void init() {
try {
this.connect();
} catch (Exception ex) {
logger.error("连接MQTT消息中心异常",ex);
}
finally {
logger.info("连接MQTT消息中心状态:" + this.isConnected());
scheduler = Executors.newSingleThreadScheduledExecutor();
scheduler.scheduleAtFixedRate(new Runnable() {
public void run() {
try {
logger.info("MQTT消息中心状态<{}>,消息队列<{}>",isConnected(),wait.size());
if(!isConnected()) {
logger.info("重新连接MQTT消息中心......");
connect();
}
if(!wait.isEmpty()) {
//循环次数
int loop = wait.size() > 100 ? 100 : wait.size();
for(int i = 0;i<loop;i++) {
Map<String,Object> data = wait.poll();
Date date = (Date) data.get("date");
Integer count = (Integer) data.get("count");
long currDate = new Date().getTime();
//发送超过10次或超过5分钟丢弃
if(count > 10 || currDate - date.getTime() > 5*60*60*1000) {
return;
}
if(isConnected()) {
String topic = data.get("topic").toString();
String payload = data.get("payload").toString();
Publish(topic,payload);
}
else {
data.put("date", new Date());
count++;
data.put("count", count);
wait.add(data);
}
Thread.sleep(10);
}
}
} catch (Exception e) {
logger.error("检测MQTT消息中心状态异常",e);
}
}
}, 20 * 1000, 30 * 1000, TimeUnit.MILLISECONDS);
}
}
public void destroy() {
try {
if(this.isConnected()) {
this.mqttClient.disconnect();
logger.info("断开MQTT消息中心连接");
}
this.mqttClient = null;
} catch (MqttException ex) {
logger.error("断开MQTT消息中心连接异常",ex);
}
}
public boolean isConnected() {
return this.mqttClient != null && this.mqttClient.isConnected();
}
public void Publish(String topic, String payload,Integer count) {
try {
if(this.isConnected()) {
MqttMessage message = new MqttMessage(payload.getBytes());
message.setQos(this.QOS);
mqttClient.publish(topic, message);
logger.debug("<{}>进行第<{}>次发布...",topic,count);
}
else
{
Map<String,Object> data = new HashMap<String,Object>();
data.put("topic", topic);
data.put("payload", payload);
data.put("date", new Date());
count++;
data.put("count", count);
this.wait.add(data);
}
}catch (Exception ex) {
logger.error("MQTT发布消息异常",ex);
}
}
public void Publish(String topic, String payload) {
Publish(topic, payload,1);
}
public void Subscribe(String topicFilter) throws MqttException {
try {
if(this.isConnected()) {
mqttClient.subscribe(topicFilter, this.QOS);
}
}catch (Exception ex) {
logger.error("MQTT订阅异常",ex);
}
}
public void Unsubscribe(String topicFilter) throws MqttException {
try {
if(this.isConnected()) {
mqttClient.unsubscribe(topicFilter);
}
}catch (Exception ex) {
logger.error("MQTT退订异常",ex);
}
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public Integer getKeepAlive() {
return keepAlive;
}
public void setKeepAlive(Integer keepAlive) {
this.keepAlive = keepAlive;
}
public Integer getConnectionTimeout() {
return connectionTimeout;
}
public void setConnectionTimeout(Integer connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd;
}
}

@ -0,0 +1,48 @@
package com.jwsaas.mqtt;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MqttConfiguration {
@Value("${mqtt.clientId:clientId}")
private String clientId;
@Value("${mqtt.host:0.0.0.0}")
private String mqttHost;
@Value("${mqtt.port:1883}")
private Integer mqttPort;
@Value("${mqtt.keepalive:60}")
private int keepAlive;
@Value("${mqtt.connection.timeout:10}")
private Integer connectionTimeout;
@Value("${mqtt.username:admin}")
private String userName;
@Value("${mqtt.passwd:admin}")
private String passwd;
@Bean(initMethod = "init")
public MqttClientExt mqttClient() {
MqttClientExt mqttClient = new MqttClientExt();
mqttClient.setClientId(clientId);
mqttClient.setHost(mqttHost);
mqttClient.setPort(mqttPort);
mqttClient.setKeepAlive(keepAlive);
mqttClient.setConnectionTimeout(connectionTimeout);
mqttClient.setUserName(userName);
mqttClient.setPasswd(passwd);
return mqttClient;
}
}

@ -0,0 +1,32 @@
package com.jwsaas.mqtt;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PushCallback implements MqttCallback {
private static Logger logger = LoggerFactory.getLogger(PushCallback.class);
@Override
public void connectionLost(Throwable cause) {
logger.error("连接失败,原因", cause);
}
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
// subscribe后得到的消息会执行到这里面
logger.debug("接收消息主题:" + topic);
logger.debug("接收消息Qos:" + message.getQos());
logger.debug("接收消息内容:" + new String(message.getPayload()));
}
@Override
public void deliveryComplete(IMqttDeliveryToken token) {
// publish后会执行到这里
logger.debug("消息发送成功!" + ((token == null || token.getResponse() == null) ? "null" : token.getResponse().getKey()));
}
}

@ -0,0 +1,74 @@
package com.jwsaas.mqtt;
import java.util.Map;
public class Topic {
public static String cardPayMsg = "%s:%s:pay";
private String topicName; // 主题名称
private String tenantId; // 企业编号
private String shopNo; // 门店编号
private String posNo; // pos编号
private String workerNo; // 员工编号
private Map<String, Object> ext; // 附加信息
public String getTopicName() {
return topicName;
}
public void setTopicName(String topicName) {
this.topicName = topicName;
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getShopNo() {
return shopNo;
}
public void setShopNo(String shopNo) {
this.shopNo = shopNo;
}
public String getPosNo() {
return posNo;
}
public void setPosNo(String posNo) {
this.posNo = posNo;
}
public String getWorkerNo() {
return workerNo;
}
public void setWorkerNo(String workerNo) {
this.workerNo = workerNo;
}
public Map<String, Object> getExt() {
return ext;
}
public void setExt(Map<String, Object> ext) {
this.ext = ext;
}
@Override
public String toString() {
return "Topic [topicName=" + topicName + ", shopNo=" + shopNo + ", posNo=" + posNo + ", workerNo=" + workerNo + ", ext=" + ext + "]";
}
}

@ -0,0 +1,18 @@
package com.jwsaas.util;
@SuppressWarnings("serial")
public class JSONException extends RuntimeException {
public JSONException(){
super();
}
public JSONException(String message){
super(message);
}
public JSONException(String message, Throwable cause){
super(message, cause);
}
}

@ -0,0 +1,167 @@
package com.jwsaas.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationConfig;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.node.ObjectNode;
public class JSONUtil {
protected static Logger logger = LoggerFactory.getLogger(JSONUtil.class);
private static ObjectMapper objectMapper = new ObjectMapper();
private static final String charsetName = "UTF-8";
static {
objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
serializationConfig = serializationConfig.without(SerializationFeature.WRAP_ROOT_VALUE)
.with(SerializationFeature.INDENT_OUTPUT);
SerializerProvider serializerProvider = objectMapper.getSerializerProvider();
serializerProvider.setNullValueSerializer(new JsonSerializer<Object>() {
@Override
public void serialize(Object value, JsonGenerator jgen, SerializerProvider serializers)
throws IOException, JsonProcessingException {
jgen.writeString("");
}
});
}
// public static ObjectMapper getObjectMapper() {
// return CollectionUtils.deepCopy(objectMapper);
// }
public static String toJSONString(Object object) {
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
try {
JsonGenerator jsonGenerator = objectMapper.getFactory().createGenerator(bos, JsonEncoding.UTF8);
objectMapper.writeValue(jsonGenerator, object);
return bos.toString(charsetName);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
} finally {
try {
bos.close();
} catch (Exception ex) {
logger.error("toJSONString(bos.close) Exception ", ex);
}
}
}
public static JsonNode parseJsonNode(String text) {
try {
return objectMapper.readTree(text);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static <T> T parseObject(String text, Class<T> clazz) {
try {
return objectMapper.readValue(text, clazz);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static <T> T parseObject(String text, Class<T> clazz, String charsetName) {
try {
return objectMapper.readValue(text.getBytes(charsetName), clazz);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static <T> T parseObject(String text, TypeReference<T> valueTypeRef) {
try {
return objectMapper.readValue(objectMapper.getFactory().createParser(text), valueTypeRef);
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
public static ObjectNode createObjectNode() {
try {
return objectMapper.createObjectNode();
} catch (Exception e) {
throw new JSONException(e.getMessage(), e);
}
}
/**
* jsontagPath tagPath :
*
* @param json
* @param tagPath
* @return
* @throws Exception
*/
public static List<String> readValueFromJson(String json, String tagPath) throws Exception {
// 返回值
List<String> value = new ArrayList<String>();
if (StringUtils.isBlank(json) || StringUtils.isBlank(tagPath)) {
return value;
}
String[] path = tagPath.split(":");
JsonNode node = objectMapper.readTree(json);
getJsonValue(node, path, value, 1);
return value;
}
public static void getJsonValue(JsonNode node, String[] path, List<String> values, int nextIndex) {
if (node == null) {
return;
}
// 是路径的最后就直接取值
if (nextIndex == path.length) {
if (node.isArray()) {
for (int i = 0; i < node.size(); i++) {
JsonNode child = node.get(i).get(path[nextIndex - 1]);
if (child == null) {
continue;
}
values.add(child.toString());
}
} else {
JsonNode child = node.get(path[nextIndex - 1]);
if (child != null) {
values.add(child.toString());
}
}
return;
}
// 判断是Node下是集合还是一个节点
node = node.get(path[nextIndex - 1]);
if (node.isArray()) {
for (int i = 0; i < node.size(); i++) {
getJsonValue(node.get(i), path, values, nextIndex + 1);
}
} else {
getJsonValue(node, path, values, nextIndex + 1);
}
}
}

Binary file not shown.

@ -0,0 +1,49 @@
#application
application.name=food-mq
application.owner=
#RabbitMQ
spring.rabbitmq.host=127.0.0.1
spring.rabbitmq.port=5672
spring.rabbitmq.virtualHost=/dev_test
spring.rabbitmq.publisherConfirms=true
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
# Dubbo service version
food.service.group=default
food.service.version=2.0.0
# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service
dubbo.scan.basePackages=com.jwsaas
# Dubbo Config properties
## ApplicationConfig Bean
dubbo.application.id=food-mq
dubbo.application.name=food-mq
dubbo.application.qos-enable=false
dubbo.application.qos-port=22222
## ConsumerConfig Bean
dubbo.consumer.id=dubbo
dubbo.consumer.name=dubbo
dubbo.consumer.client=netty4
## RegistryConfig Bean
dubbo.registry.id=food-registry
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.registry.client=curator
dubbo.registry.file=/home/project/foodv2/dubbo/food-mq.cache
## consume
dubbo.consumer.timeout=600000
# \u670D\u52A1\u542F\u52A8\u65F6\u68C0\u67E5\u88AB\u8C03\u7528\u670D\u52A1\u662F\u5426\u53EF\u7528
dubbo.consumer.check=true
dubbo.consumer.retries=0
#MQTT
mqtt.clientId=cy2_foodmq_kaifa_01
mqtt.host=iotv2.ffcygl.com
mqtt.port=18830
mqtt.keepalive=60
mqtt.connection.timeout=10

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="APP_Name" value="estore-mq" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.core" level="INFO" />
<logger name="org.springframework.beans" level="INFO" />
<logger name="org.springframework.context" level="INFO" />
<logger name="org.springframework.aop" level="INFO" />
<logger name="org.springframework.boot.autoconfigure.logging" level="INFO" />
<logger name="org.apache.zookeeper" level="INFO" />
<logger name="com.alibaba.dubbo" level="INFO" />
<!-- <logger name="com.jwsaas" level="DEBUG" /> -->
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

@ -0,0 +1,49 @@
#application
application.name=food-mq
application.owner=
#RabbitMQ
spring.rabbitmq.host=127.0.0.1
spring.rabbitmq.port=5672
spring.rabbitmq.virtualHost=/dev_test
spring.rabbitmq.publisherConfirms=true
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest
# Dubbo service version
food.service.group=default
food.service.version=2.0.0
# Base packages to scan Dubbo Component: @com.alibaba.dubbo.config.annotation.Service
dubbo.scan.basePackages=com.jwsaas
# Dubbo Config properties
## ApplicationConfig Bean
dubbo.application.id=food-mq
dubbo.application.name=food-mq
dubbo.application.qos-enable=false
dubbo.application.qos-port=22222
## ConsumerConfig Bean
dubbo.consumer.id=dubbo
dubbo.consumer.name=dubbo
dubbo.consumer.client=netty4
## RegistryConfig Bean
dubbo.registry.id=food-registry
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.registry.client=curator
dubbo.registry.file=/home/project/foodv2/dubbo/food-mq.cache
## consume
dubbo.consumer.timeout=600000
# \u670D\u52A1\u542F\u52A8\u65F6\u68C0\u67E5\u88AB\u8C03\u7528\u670D\u52A1\u662F\u5426\u53EF\u7528
dubbo.consumer.check=true
dubbo.consumer.retries=0
#MQTT
mqtt.clientId=cy2_foodmq_kaifa_01
mqtt.host=iotv2.ffcygl.com
mqtt.port=18830
mqtt.keepalive=60
mqtt.connection.timeout=10

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="APP_Name" value="estore-mq" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%-5level] %logger{120} - %msg %n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.core" level="INFO" />
<logger name="org.springframework.beans" level="INFO" />
<logger name="org.springframework.context" level="INFO" />
<logger name="org.springframework.aop" level="INFO" />
<logger name="org.springframework.boot.autoconfigure.logging" level="INFO" />
<logger name="org.apache.zookeeper" level="INFO" />
<logger name="com.alibaba.dubbo" level="INFO" />
<!-- <logger name="com.jwsaas" level="DEBUG" /> -->
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

Binary file not shown.

Binary file not shown.

@ -0,0 +1,140 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general passthrough startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
rem as is.
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
rem If not set then all parameters starting with the second will be passed.
set _PASS_THROUGH=true
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -i %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -i %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

File diff suppressed because it is too large Load Diff

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -a %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -a %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -q %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -q %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -e %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -e %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,156 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general passthrough startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem
rem ********************************************************************
rem NOTE - This script has been modified to run the TestWrapper sample
rem application and should NOT be used as a base for your own
rem applications. All of the documentation assumes that you are
rem working from the default source script:
rem WRAPPER_HOME/src/bin/App.bat.in
rem ********************************************************************
rem
rem ********************************************************************
rem NOTE - This script has been modified to run the TestWrapper sample
rem application and should NOT be used as a base for your own
rem applications. All of the documentation assumes that you are
rem working from the default source script:
rem WRAPPER_HOME/src/bin/App.bat.in
rem ********************************************************************
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem _PASS_THROUGH tells the script to pass all parameters through to the JVM
rem as is.
rem If _WRAPPER_CONF_OVERRIDE is specified then all parameters will be passed.
rem If not set then all parameters starting with the second will be passed.
set _PASS_THROUGH=true
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -c %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -c %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -t %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -t %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

@ -0,0 +1,135 @@
@echo off
setlocal
rem
rem Copyright (c) 1999, 2016 Tanuki Software, Ltd.
rem http://www.tanukisoftware.com
rem All rights reserved.
rem
rem This software is the proprietary information of Tanuki Software.
rem You shall use it only in accordance with the terms of the
rem license agreement you entered into with Tanuki Software.
rem http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html
rem
rem Java Service Wrapper general startup script.
rem
rem -----------------------------------------------------------------------------
rem These settings can be modified to fit the needs of your application
rem Optimized for use with version 3.5.28 of the Wrapper.
rem The base name for the Wrapper binary.
set _WRAPPER_BASE=wrapper
rem The directory where the Wrapper binary (.exe) file is located. It can be
rem either an absolute or a relative path. If the path contains any special
rem characters, please make sure to quote the variable.
set _WRAPPER_DIR=
rem The name and location of the Wrapper configuration file. This will be used
rem if the user does not specify a configuration file as the first parameter to
rem this script.
set _WRAPPER_CONF_DEFAULT="../conf/%_WRAPPER_BASE%.conf"
rem Makes it possible to override the Wrapper configuration file by specifying it
rem as the first parameter.
rem set _WRAPPER_CONF_OVERRIDE=true
rem Note that it is only possible to pass parameters through to the JVM when
rem installing the service, or when running in a console.
rem Do not modify anything beyond this point
rem -----------------------------------------------------------------------------
rem
rem Resolve the real path of the wrapper.exe
rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
rem can be hard-coded below and the following test removed.
rem
if "%OS%"=="Windows_NT" goto nt
echo This script only works with NT-based versions of Windows.
goto :eof
:nt
rem Find the application home.
rem if no path path specified do the default action
IF not DEFINED _WRAPPER_DIR goto dir_undefined
set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR:"=%"
if not "%_WRAPPER_DIR:~-2,1%" == "\" set _WRAPPER_DIR_QUOTED="%_WRAPPER_DIR_QUOTED:"=%\"
rem check if absolute path
if "%_WRAPPER_DIR_QUOTED:~2,1%" == ":" goto absolute_path
if "%_WRAPPER_DIR_QUOTED:~1,1%" == "\" goto absolute_path
rem everythig else means relative path
set _REALPATH="%~dp0%_WRAPPER_DIR_QUOTED:"=%"
goto pathfound
:dir_undefined
rem Use a relative path to the wrapper %~dp0 is location of current script under NT
set _REALPATH="%~dp0"
goto pathfound
:absolute_path
rem Use an absolute path to the wrapper
set _REALPATH="%_WRAPPER_DIR_QUOTED:"=%"
:pathfound
rem
rem Decide on the specific Wrapper binary to use (See delta-pack)
rem
if "%PROCESSOR_ARCHITEW6432%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto amd64
if "%PROCESSOR_ARCHITECTURE%"=="IA64" goto ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-32.exe"
goto search
:amd64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-x86-64.exe"
goto search
:ia64
set _WRAPPER_L_EXE="%_REALPATH:"=%%_WRAPPER_BASE%-windows-ia-64.exe"
goto search
:search
set _WRAPPER_EXE="%_WRAPPER_L_EXE:"=%"
if exist %_WRAPPER_EXE% goto conf
set _WRAPPER_EXE="%_REALPATH:"=%%_WRAPPER_BASE%.exe"
if exist %_WRAPPER_EXE% goto conf
echo Unable to locate a Wrapper executable using any of the following names:
echo %_WRAPPER_L_EXE%
echo %_WRAPPER_EXE%
pause
goto :eof
rem
rem Find the wrapper.conf
rem
:conf
if [%_WRAPPER_CONF_OVERRIDE%]==[true] (
set _WRAPPER_CONF="%~f1"
if not [%_WRAPPER_CONF%]==[""] (
shift
goto :startup
)
)
set _WRAPPER_CONF="%_WRAPPER_CONF_DEFAULT:"=%"
rem
rem Start the Wrapper
rem
:startup
if not [%_PASS_THROUGH%]==[true] (
if not [%1]==[] (
echo WARNING: Extra arguments will be ignored. Please check usage in the batch file.
)
)
rem Collect the application parameters
:parameters
set _PARAMETERS=%_PARAMETERS% %1
shift
if not [%1]==[] goto :parameters
if not [%_PASS_THROUGH%]==[true] (
%_WRAPPER_EXE% -p %_WRAPPER_CONF%
) else (
%_WRAPPER_EXE% -p %_WRAPPER_CONF% -- %_PARAMETERS%
)
if not errorlevel 1 goto :eof
pause

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save