activeMQ
This commit is contained in:
parent
25439fbe07
commit
9d0a00d1e9
555
pom.xml
555
pom.xml
@ -1,240 +1,335 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>osc.git.eh3</groupId>
|
<groupId>osc.git.eh3</groupId>
|
||||||
<artifactId>useful-code</artifactId>
|
<artifactId>useful-code</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>useful-code Maven Webapp</name>
|
<name>useful-code Maven Webapp</name>
|
||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<spring.version>4.2.4.RELEASE</spring.version>
|
<spring.version>4.0.2.RELEASE</spring.version>
|
||||||
<servlet.version>2.5</servlet.version>
|
<servlet.version>2.5</servlet.version>
|
||||||
<mybatis.version>3.2.7</mybatis.version>
|
<mybatis.version>3.2.7</mybatis.version>
|
||||||
<mybatis.spring.version>1.1.1</mybatis.spring.version>
|
<mybatis.spring.version>1.1.1</mybatis.spring.version>
|
||||||
<mybatis.paging.version>0.0.1</mybatis.paging.version>
|
<mybatis.paging.version>0.0.1</mybatis.paging.version>
|
||||||
<mybatis.generator.core.version>1.3.2</mybatis.generator.core.version>
|
<mybatis.generator.core.version>1.3.2</mybatis.generator.core.version>
|
||||||
<file_encoding>utf-8</file_encoding>
|
<file_encoding>utf-8</file_encoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.jcraft</groupId>
|
||||||
<artifactId>jsch</artifactId>
|
<artifactId>jsch</artifactId>
|
||||||
<version>0.1.53</version>
|
<version>0.1.53</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.bouncycastle</groupId>
|
|
||||||
<artifactId>bcprov-jdk16</artifactId>
|
|
||||||
<version>1.46</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.11</version>
|
|
||||||
<!-- <scope>test</scope> -->
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<version>1.1.3</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.shiro</groupId>
|
|
||||||
<artifactId>shiro-core</artifactId>
|
|
||||||
<version>1.2.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-core</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-web</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-oxm</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-tx</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-jdbc</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-webmvc</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-aop</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context-support</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-test</artifactId>
|
|
||||||
<version>${spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<version>1.6</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.json-lib</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>json-lib</artifactId>
|
<artifactId>bcprov-jdk16</artifactId>
|
||||||
<version>2.4</version>
|
<version>1.46</version>
|
||||||
<classifier>jdk15</classifier>
|
</dependency>
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.caucho</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>hessian</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.0.38</version>
|
<version>4.11</version>
|
||||||
</dependency>
|
<!-- <scope>test</scope> -->
|
||||||
<dependency>
|
</dependency>
|
||||||
<groupId>redis.clients</groupId>
|
|
||||||
<artifactId>jedis</artifactId>
|
|
||||||
<version>2.8.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<version>5.1.38</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- servlet -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.servlet</groupId>
|
|
||||||
<artifactId>servlet-api</artifactId>
|
|
||||||
<version>${servlet.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- mybatis start -->
|
<dependency>
|
||||||
<dependency>
|
<groupId>commons-logging</groupId>
|
||||||
<groupId>org.mybatis</groupId>
|
<artifactId>commons-logging</artifactId>
|
||||||
<artifactId>mybatis</artifactId>
|
<version>1.1.3</version>
|
||||||
<version>${mybatis.version}</version>
|
</dependency>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis</groupId>
|
|
||||||
<artifactId>mybatis-spring</artifactId>
|
|
||||||
<version>${mybatis.spring.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.loafer</groupId>
|
|
||||||
<artifactId>mybatis-paging</artifactId>
|
|
||||||
<version>${mybatis.paging.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.generator</groupId>
|
|
||||||
<artifactId>mybatis-generator-core</artifactId>
|
|
||||||
<version>${mybatis.generator.core.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>c3p0</groupId>
|
|
||||||
<artifactId>c3p0</artifactId>
|
|
||||||
<version>0.9.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- mybatis end -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>4.5.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.cxf</groupId>
|
|
||||||
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
|
||||||
<version>3.1.6</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.cxf</groupId>
|
|
||||||
<artifactId>cxf-rt-transports-http</artifactId>
|
|
||||||
<version>3.1.6</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<finalName>useful-code</finalName>
|
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<!-- mybatis-generator 插件; Run AS——>Maven Build… ——>在Goals框中输入:mybatis-generator:generate -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.mybatis.generator</groupId>
|
|
||||||
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
|
||||||
<version>1.3.2</version>
|
|
||||||
<configuration>
|
|
||||||
<verbose>true</verbose>
|
|
||||||
<overwrite>true</overwrite>
|
|
||||||
</configuration>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<version>5.1.38</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- 指定JDK编译版本 -->
|
<dependency>
|
||||||
<plugin>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<artifactId>shiro-core</artifactId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<version>1.2.2</version>
|
||||||
<configuration>
|
</dependency>
|
||||||
<source>1.7</source>
|
|
||||||
<target>1.7</target>
|
|
||||||
<encoding>${file_encoding}</encoding>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- jetty 服务器; Maven build... -> jetty:run -->
|
<!-- spring begin-->
|
||||||
<plugin>
|
<dependency>
|
||||||
<groupId>org.mortbay.jetty</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>jetty-maven-plugin</artifactId>
|
<artifactId>spring-core</artifactId>
|
||||||
<version>8.1.15.v20140411</version>
|
<version>${spring.version}</version>
|
||||||
<configuration>
|
</dependency>
|
||||||
<webApp>
|
|
||||||
<contextPath>/usefull-code</contextPath>
|
<dependency>
|
||||||
</webApp>
|
<groupId>org.springframework</groupId>
|
||||||
<stopKey>exit</stopKey>
|
<artifactId>spring-beans</artifactId>
|
||||||
<stopPort>9090</stopPort>
|
<version>${spring.version}</version>
|
||||||
<scanIntervalSeconds>1</scanIntervalSeconds>
|
</dependency>
|
||||||
<connectors>
|
|
||||||
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
|
<dependency>
|
||||||
<port>8080</port>
|
<groupId>org.springframework</groupId>
|
||||||
<maxIdleTime>60000</maxIdleTime>
|
<artifactId>spring-context</artifactId>
|
||||||
</connector>
|
<version>${spring.version}</version>
|
||||||
</connectors>
|
</dependency>
|
||||||
<requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">
|
|
||||||
<filename>target/access.log</filename>
|
<dependency>
|
||||||
<retainDays>90</retainDays>
|
<groupId>org.springframework</groupId>
|
||||||
<append>false</append>
|
<artifactId>spring-web</artifactId>
|
||||||
<extended>false</extended>
|
<version>${spring.version}</version>
|
||||||
<logTimeZone>GMT+8:00</logTimeZone>
|
</dependency>
|
||||||
</requestLog>
|
|
||||||
<!-- <systemProperties> <systemProperty> <name>productionMode</name>
|
<dependency>
|
||||||
<value>${productionMode}</value> </systemProperty> </systemProperties> -->
|
<groupId>org.springframework</groupId>
|
||||||
</configuration>
|
<artifactId>spring-oxm</artifactId>
|
||||||
</plugin>
|
<version>${spring.version}</version>
|
||||||
</plugins>
|
</dependency>
|
||||||
</pluginManagement>
|
|
||||||
<defaultGoal>compile</defaultGoal>
|
<dependency>
|
||||||
</build>
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-tx</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-jdbc</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-aop</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context-support</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-jms</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-expression</artifactId>
|
||||||
|
<version>${spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- spring end-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.json-lib</groupId>
|
||||||
|
<artifactId>json-lib</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<classifier>jdk15</classifier>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.caucho</groupId>
|
||||||
|
<artifactId>hessian</artifactId>
|
||||||
|
<version>4.0.38</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.38</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- servlet -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
<version>${servlet.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis start -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>${mybatis.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis-spring</artifactId>
|
||||||
|
<version>${mybatis.spring.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.loafer</groupId>
|
||||||
|
<artifactId>mybatis-paging</artifactId>
|
||||||
|
<version>${mybatis.paging.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.generator</groupId>
|
||||||
|
<artifactId>mybatis-generator-core</artifactId>
|
||||||
|
<version>${mybatis.generator.core.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>c3p0</groupId>
|
||||||
|
<artifactId>c3p0</artifactId>
|
||||||
|
<version>0.9.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis end -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>4.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-frontend-jaxws</artifactId>
|
||||||
|
<version>3.1.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.cxf</groupId>
|
||||||
|
<artifactId>cxf-rt-transports-http</artifactId>
|
||||||
|
<version>3.1.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.activemq</groupId>
|
||||||
|
<artifactId>activemq-all</artifactId>
|
||||||
|
<version>5.13.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.xbean</groupId>
|
||||||
|
<artifactId>xbean-spring</artifactId>
|
||||||
|
<version>4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<finalName>useful-code</finalName>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<!-- mybatis-generator 插件; Run AS——>Maven Build… ——>在Goals框中输入:mybatis-generator:generate -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.mybatis.generator</groupId>
|
||||||
|
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
||||||
|
<version>1.3.2</version>
|
||||||
|
<configuration>
|
||||||
|
<verbose>true</verbose>
|
||||||
|
<overwrite>true</overwrite>
|
||||||
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.38</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- 指定JDK编译版本 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.7</source>
|
||||||
|
<target>1.7</target>
|
||||||
|
<encoding>${file_encoding}</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- jetty 服务器; Maven build... -> jetty:run -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.mortbay.jetty</groupId>
|
||||||
|
<artifactId>jetty-maven-plugin</artifactId>
|
||||||
|
<version>8.1.15.v20140411</version>
|
||||||
|
<configuration>
|
||||||
|
<webApp>
|
||||||
|
<contextPath>/usefull-code</contextPath>
|
||||||
|
</webApp>
|
||||||
|
<stopKey>exit</stopKey>
|
||||||
|
<stopPort>9090</stopPort>
|
||||||
|
<scanIntervalSeconds>1</scanIntervalSeconds>
|
||||||
|
<connectors>
|
||||||
|
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
|
||||||
|
<port>8080</port>
|
||||||
|
<maxIdleTime>60000</maxIdleTime>
|
||||||
|
</connector>
|
||||||
|
</connectors>
|
||||||
|
<requestLog implementation="org.eclipse.jetty.server.NCSARequestLog">
|
||||||
|
<filename>target/access.log</filename>
|
||||||
|
<retainDays>90</retainDays>
|
||||||
|
<append>false</append>
|
||||||
|
<extended>false</extended>
|
||||||
|
<logTimeZone>GMT+8:00</logTimeZone>
|
||||||
|
</requestLog>
|
||||||
|
<!-- <systemProperties> <systemProperty> <name>productionMode</name>
|
||||||
|
<value>${productionMode}</value> </systemProperty> </systemProperties> -->
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<!-- 生成javadoc文档包的插件 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.10.2</version>
|
||||||
|
<configuration>
|
||||||
|
<aggregate>true</aggregate>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- 生成sources源码包的插件 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>2.1.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
<defaultGoal>compile</defaultGoal>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package com.pxene.dsp.archer.dao;
|
|
||||||
|
|
||||||
import com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel;
|
|
||||||
import com.pxene.dsp.archer.model.AdGroupAppTargetFilterModelExample;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface AdGroupAppTargetFilterDao {
|
|
||||||
int countByExample(AdGroupAppTargetFilterModelExample example);
|
|
||||||
|
|
||||||
int deleteByExample(AdGroupAppTargetFilterModelExample example);
|
|
||||||
|
|
||||||
int deleteByPrimaryKey(String id);
|
|
||||||
|
|
||||||
int insert(AdGroupAppTargetFilterModel record);
|
|
||||||
|
|
||||||
int insertSelective(AdGroupAppTargetFilterModel record);
|
|
||||||
|
|
||||||
List<AdGroupAppTargetFilterModel> selectByExample(AdGroupAppTargetFilterModelExample example);
|
|
||||||
|
|
||||||
AdGroupAppTargetFilterModel selectByPrimaryKey(String id);
|
|
||||||
|
|
||||||
int updateByExampleSelective(@Param("record") AdGroupAppTargetFilterModel record, @Param("example") AdGroupAppTargetFilterModelExample example);
|
|
||||||
|
|
||||||
int updateByExample(@Param("record") AdGroupAppTargetFilterModel record, @Param("example") AdGroupAppTargetFilterModelExample example);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(AdGroupAppTargetFilterModel record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(AdGroupAppTargetFilterModel record);
|
|
||||||
|
|
||||||
public List<Map<String,String>> selectAdxByAppParentCode(String parentcode);
|
|
||||||
}
|
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.pxene.dsp.archer.dao;
|
||||||
|
|
||||||
|
import com.pxene.dsp.archer.model.GroupTargetAuditModel;
|
||||||
|
import com.pxene.dsp.archer.model.GroupTargetAuditModelExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface GroupTargetAuditDao {
|
||||||
|
int countByExample(GroupTargetAuditModelExample example);
|
||||||
|
|
||||||
|
int deleteByExample(GroupTargetAuditModelExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int insert(GroupTargetAuditModel record);
|
||||||
|
|
||||||
|
int insertSelective(GroupTargetAuditModel record);
|
||||||
|
|
||||||
|
List<GroupTargetAuditModel> selectByExample(GroupTargetAuditModelExample example);
|
||||||
|
|
||||||
|
GroupTargetAuditModel selectByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") GroupTargetAuditModel record, @Param("example") GroupTargetAuditModelExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") GroupTargetAuditModel record, @Param("example") GroupTargetAuditModelExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(GroupTargetAuditModel record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(GroupTargetAuditModel record);
|
||||||
|
}
|
@ -1,14 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.pxene.dsp.archer.dao.AdGroupAppTargetFilterDao" >
|
<mapper namespace="com.pxene.dsp.archer.dao.GroupTargetAuditDao" >
|
||||||
<resultMap id="BaseResultMap" type="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel" >
|
<resultMap id="BaseResultMap" type="com.pxene.dsp.archer.model.GroupTargetAuditModel" >
|
||||||
<id column="id" property="id" jdbcType="VARCHAR" />
|
<id column="id" property="id" jdbcType="VARCHAR" />
|
||||||
<result column="groupid" property="groupid" jdbcType="VARCHAR" />
|
<result column="groupid" property="groupid" jdbcType="VARCHAR" />
|
||||||
<result column="appcategory" property="appcategory" jdbcType="VARCHAR" />
|
<result column="result" property="result" jdbcType="VARCHAR" />
|
||||||
<result column="keyword" property="keyword" jdbcType="VARCHAR" />
|
<result column="reason" property="reason" jdbcType="VARCHAR" />
|
||||||
<result column="filterValLi" property="filtervalli" jdbcType="VARCHAR" />
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
||||||
<result column="searchValLi" property="searchvalli" jdbcType="VARCHAR" />
|
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
|
||||||
<result column="adxid" property="adxid" jdbcType="VARCHAR" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause" >
|
<sql id="Example_Where_Clause" >
|
||||||
<where >
|
<where >
|
||||||
@ -69,16 +68,16 @@
|
|||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="Base_Column_List" >
|
<sql id="Base_Column_List" >
|
||||||
id, groupid, appcategory, keyword, filterValLi, searchValLi, adxid
|
id, groupid, result, reason, remark, createtime
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModelExample" >
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModelExample" >
|
||||||
select
|
select
|
||||||
<if test="distinct" >
|
<if test="distinct" >
|
||||||
distinct
|
distinct
|
||||||
</if>
|
</if>
|
||||||
'true' as QUERYID,
|
'true' as QUERYID,
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from dsp_t_ad_group_apptarget_filter
|
from dsp_t_group_target_audit
|
||||||
<if test="_parameter != null" >
|
<if test="_parameter != null" >
|
||||||
<include refid="Example_Where_Clause" />
|
<include refid="Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
@ -89,29 +88,29 @@
|
|||||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from dsp_t_ad_group_apptarget_filter
|
from dsp_t_group_target_audit
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
||||||
delete from dsp_t_ad_group_apptarget_filter
|
delete from dsp_t_group_target_audit
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</delete>
|
</delete>
|
||||||
<delete id="deleteByExample" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModelExample" >
|
<delete id="deleteByExample" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModelExample" >
|
||||||
delete from dsp_t_ad_group_apptarget_filter
|
delete from dsp_t_group_target_audit
|
||||||
<if test="_parameter != null" >
|
<if test="_parameter != null" >
|
||||||
<include refid="Example_Where_Clause" />
|
<include refid="Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel" >
|
<insert id="insert" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModel" >
|
||||||
insert into dsp_t_ad_group_apptarget_filter (id, groupid, appcategory,
|
insert into dsp_t_group_target_audit (id, groupid, result,
|
||||||
keyword, filterValLi, searchValLi,
|
reason, remark, createtime
|
||||||
adxid)
|
)
|
||||||
values (#{id,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{appcategory,jdbcType=VARCHAR},
|
values (#{id,jdbcType=VARCHAR}, #{groupid,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR},
|
||||||
#{keyword,jdbcType=VARCHAR}, #{filtervalli,jdbcType=VARCHAR}, #{searchvalli,jdbcType=VARCHAR},
|
#{reason,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}
|
||||||
#{adxid,jdbcType=VARCHAR})
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel" >
|
<insert id="insertSelective" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModel" >
|
||||||
insert into dsp_t_ad_group_apptarget_filter
|
insert into dsp_t_group_target_audit
|
||||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||||
<if test="id != null" >
|
<if test="id != null" >
|
||||||
id,
|
id,
|
||||||
@ -119,20 +118,17 @@
|
|||||||
<if test="groupid != null" >
|
<if test="groupid != null" >
|
||||||
groupid,
|
groupid,
|
||||||
</if>
|
</if>
|
||||||
<if test="appcategory != null" >
|
<if test="result != null" >
|
||||||
appcategory,
|
result,
|
||||||
</if>
|
</if>
|
||||||
<if test="keyword != null" >
|
<if test="reason != null" >
|
||||||
keyword,
|
reason,
|
||||||
</if>
|
</if>
|
||||||
<if test="filtervalli != null" >
|
<if test="remark != null" >
|
||||||
filterValLi,
|
remark,
|
||||||
</if>
|
</if>
|
||||||
<if test="searchvalli != null" >
|
<if test="createtime != null" >
|
||||||
searchValLi,
|
createtime,
|
||||||
</if>
|
|
||||||
<if test="adxid != null" >
|
|
||||||
adxid,
|
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||||
@ -142,31 +138,28 @@
|
|||||||
<if test="groupid != null" >
|
<if test="groupid != null" >
|
||||||
#{groupid,jdbcType=VARCHAR},
|
#{groupid,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appcategory != null" >
|
<if test="result != null" >
|
||||||
#{appcategory,jdbcType=VARCHAR},
|
#{result,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="keyword != null" >
|
<if test="reason != null" >
|
||||||
#{keyword,jdbcType=VARCHAR},
|
#{reason,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="filtervalli != null" >
|
<if test="remark != null" >
|
||||||
#{filtervalli,jdbcType=VARCHAR},
|
#{remark,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="searchvalli != null" >
|
<if test="createtime != null" >
|
||||||
#{searchvalli,jdbcType=VARCHAR},
|
#{createtime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
|
||||||
<if test="adxid != null" >
|
|
||||||
#{adxid,jdbcType=VARCHAR},
|
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<select id="countByExample" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModelExample" resultType="java.lang.Integer" >
|
<select id="countByExample" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModelExample" resultType="java.lang.Integer" >
|
||||||
select count(*) from dsp_t_ad_group_apptarget_filter
|
select count(*) from dsp_t_group_target_audit
|
||||||
<if test="_parameter != null" >
|
<if test="_parameter != null" >
|
||||||
<include refid="Example_Where_Clause" />
|
<include refid="Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<update id="updateByExampleSelective" parameterType="map" >
|
<update id="updateByExampleSelective" parameterType="map" >
|
||||||
update dsp_t_ad_group_apptarget_filter
|
update dsp_t_group_target_audit
|
||||||
<set >
|
<set >
|
||||||
<if test="record.id != null" >
|
<if test="record.id != null" >
|
||||||
id = #{record.id,jdbcType=VARCHAR},
|
id = #{record.id,jdbcType=VARCHAR},
|
||||||
@ -174,20 +167,17 @@
|
|||||||
<if test="record.groupid != null" >
|
<if test="record.groupid != null" >
|
||||||
groupid = #{record.groupid,jdbcType=VARCHAR},
|
groupid = #{record.groupid,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.appcategory != null" >
|
<if test="record.result != null" >
|
||||||
appcategory = #{record.appcategory,jdbcType=VARCHAR},
|
result = #{record.result,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.keyword != null" >
|
<if test="record.reason != null" >
|
||||||
keyword = #{record.keyword,jdbcType=VARCHAR},
|
reason = #{record.reason,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.filtervalli != null" >
|
<if test="record.remark != null" >
|
||||||
filterValLi = #{record.filtervalli,jdbcType=VARCHAR},
|
remark = #{record.remark,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="record.searchvalli != null" >
|
<if test="record.createtime != null" >
|
||||||
searchValLi = #{record.searchvalli,jdbcType=VARCHAR},
|
createtime = #{record.createtime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
|
||||||
<if test="record.adxid != null" >
|
|
||||||
adxid = #{record.adxid,jdbcType=VARCHAR},
|
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
<if test="_parameter != null" >
|
<if test="_parameter != null" >
|
||||||
@ -195,60 +185,45 @@
|
|||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByExample" parameterType="map" >
|
<update id="updateByExample" parameterType="map" >
|
||||||
update dsp_t_ad_group_apptarget_filter
|
update dsp_t_group_target_audit
|
||||||
set id = #{record.id,jdbcType=VARCHAR},
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
groupid = #{record.groupid,jdbcType=VARCHAR},
|
groupid = #{record.groupid,jdbcType=VARCHAR},
|
||||||
appcategory = #{record.appcategory,jdbcType=VARCHAR},
|
result = #{record.result,jdbcType=VARCHAR},
|
||||||
keyword = #{record.keyword,jdbcType=VARCHAR},
|
reason = #{record.reason,jdbcType=VARCHAR},
|
||||||
filterValLi = #{record.filtervalli,jdbcType=VARCHAR},
|
remark = #{record.remark,jdbcType=VARCHAR},
|
||||||
searchValLi = #{record.searchvalli,jdbcType=VARCHAR},
|
createtime = #{record.createtime,jdbcType=TIMESTAMP}
|
||||||
adxid = #{record.adxid,jdbcType=VARCHAR}
|
|
||||||
<if test="_parameter != null" >
|
<if test="_parameter != null" >
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel" >
|
<update id="updateByPrimaryKeySelective" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModel" >
|
||||||
update dsp_t_ad_group_apptarget_filter
|
update dsp_t_group_target_audit
|
||||||
<set >
|
<set >
|
||||||
<if test="groupid != null" >
|
<if test="groupid != null" >
|
||||||
groupid = #{groupid,jdbcType=VARCHAR},
|
groupid = #{groupid,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="appcategory != null" >
|
<if test="result != null" >
|
||||||
appcategory = #{appcategory,jdbcType=VARCHAR},
|
result = #{result,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="keyword != null" >
|
<if test="reason != null" >
|
||||||
keyword = #{keyword,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="filtervalli != null" >
|
<if test="remark != null" >
|
||||||
filterValLi = #{filtervalli,jdbcType=VARCHAR},
|
remark = #{remark,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="searchvalli != null" >
|
<if test="createtime != null" >
|
||||||
searchValLi = #{searchvalli,jdbcType=VARCHAR},
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
|
||||||
<if test="adxid != null" >
|
|
||||||
adxid = #{adxid,jdbcType=VARCHAR},
|
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateByPrimaryKey" parameterType="com.pxene.dsp.archer.model.AdGroupAppTargetFilterModel" >
|
<update id="updateByPrimaryKey" parameterType="com.pxene.dsp.archer.model.GroupTargetAuditModel" >
|
||||||
update dsp_t_ad_group_apptarget_filter
|
update dsp_t_group_target_audit
|
||||||
set groupid = #{groupid,jdbcType=VARCHAR},
|
set groupid = #{groupid,jdbcType=VARCHAR},
|
||||||
appcategory = #{appcategory,jdbcType=VARCHAR},
|
result = #{result,jdbcType=VARCHAR},
|
||||||
keyword = #{keyword,jdbcType=VARCHAR},
|
reason = #{reason,jdbcType=VARCHAR},
|
||||||
filterValLi = #{filtervalli,jdbcType=VARCHAR},
|
remark = #{remark,jdbcType=VARCHAR},
|
||||||
searchValLi = #{searchvalli,jdbcType=VARCHAR},
|
createtime = #{createtime,jdbcType=TIMESTAMP}
|
||||||
adxid = #{adxid,jdbcType=VARCHAR}
|
|
||||||
where id = #{id,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
<select id="selectAdxByAppParentCode" parameterType="java.lang.String" resultType="java.util.Map">
|
|
||||||
SELECT DISTINCT
|
|
||||||
t0.adxtype,
|
|
||||||
t1.id adxid
|
|
||||||
FROM
|
|
||||||
dsp_t_syn_app_adx t0
|
|
||||||
LEFT JOIN dsp_t_adx t1 ON t0.adxtype = t1.`value`
|
|
||||||
WHERE
|
|
||||||
t0.parentcode = #{parentcode,jdbcType=VARCHAR}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
90
src/main/java/osc/git/eh3/activemq/JMSProducer.java
Normal file
90
src/main/java/osc/git/eh3/activemq/JMSProducer.java
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
package osc.git.eh3.activemq;
|
||||||
|
|
||||||
|
import org.apache.activemq.ActiveMQConnection;
|
||||||
|
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||||
|
|
||||||
|
import javax.jms.Connection;
|
||||||
|
import javax.jms.ConnectionFactory;
|
||||||
|
import javax.jms.Destination;
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.MessageProducer;
|
||||||
|
import javax.jms.Session;
|
||||||
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息的生产者(发送者)
|
||||||
|
* Created by lixiangrong on 2016-07-11.
|
||||||
|
*/
|
||||||
|
public class JMSProducer {
|
||||||
|
|
||||||
|
//默认连接用户名
|
||||||
|
private static final String USERNAME = ActiveMQConnection.DEFAULT_USER;
|
||||||
|
//默认连接密码
|
||||||
|
private static final String PASSWORD = ActiveMQConnection.DEFAULT_PASSWORD;
|
||||||
|
//默认连接地址
|
||||||
|
private static final String BROKEURL = ActiveMQConnection.DEFAULT_BROKER_URL;
|
||||||
|
//发送的消息数量
|
||||||
|
private static final int SENDNUM = 10;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
//连接工厂
|
||||||
|
ConnectionFactory connectionFactory;
|
||||||
|
//连接
|
||||||
|
Connection connection = null;
|
||||||
|
//会话 接受或者发送消息的线程
|
||||||
|
Session session;
|
||||||
|
//消息的目的地
|
||||||
|
Destination destination;
|
||||||
|
//消息生产者
|
||||||
|
MessageProducer messageProducer;
|
||||||
|
//实例化连接工厂
|
||||||
|
connectionFactory = new ActiveMQConnectionFactory(JMSProducer.USERNAME, JMSProducer.PASSWORD, JMSProducer.BROKEURL);
|
||||||
|
|
||||||
|
try {
|
||||||
|
//通过连接工厂获取连接
|
||||||
|
connection = connectionFactory.createConnection();
|
||||||
|
//启动连接
|
||||||
|
connection.start();
|
||||||
|
//创建session
|
||||||
|
session = connection.createSession(true, javax.jms.Session.AUTO_ACKNOWLEDGE);
|
||||||
|
//创建一个名称为HelloWorld的消息队列
|
||||||
|
destination = session.createQueue("HelloWorld");
|
||||||
|
//创建消息生产者
|
||||||
|
messageProducer = session.createProducer(destination);
|
||||||
|
//发送消息
|
||||||
|
sendMessage(session, messageProducer);
|
||||||
|
|
||||||
|
session.commit();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (connection != null) {
|
||||||
|
try {
|
||||||
|
connection.close();
|
||||||
|
} catch (JMSException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息
|
||||||
|
*
|
||||||
|
* @param session
|
||||||
|
* @param messageProducer 消息生产者
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void sendMessage(Session session, MessageProducer messageProducer) throws Exception {
|
||||||
|
for (int i = 0; i < JMSProducer.SENDNUM; i++) {
|
||||||
|
//创建一条文本消息
|
||||||
|
TextMessage message = session.createTextMessage("ActiveMQ 发送消息" + i);
|
||||||
|
System.out.println("发送消息:Activemq 发送消息" + i);
|
||||||
|
//通过消息生产者发出消息
|
||||||
|
messageProducer.send(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package osc.git.eh3.springamq.controller;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import osc.git.eh3.springamq.mq.producer.queue.QueueSender;
|
||||||
|
import osc.git.eh3.springamq.mq.producer.topic.TopicSender;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description controller测试
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/activemq")
|
||||||
|
public class ActivemqController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
QueueSender queueSender;
|
||||||
|
@Resource
|
||||||
|
TopicSender topicSender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息到队列
|
||||||
|
* Queue队列:仅有一个订阅者会收到消息,消息一旦被处理就不会存在队列中
|
||||||
|
* @param message
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("queueSender")
|
||||||
|
public String queueSender(@RequestParam("message")String message){
|
||||||
|
String opt="";
|
||||||
|
try {
|
||||||
|
queueSender.send("test.queue", message);
|
||||||
|
opt = "suc";
|
||||||
|
} catch (Exception e) {
|
||||||
|
opt = e.getCause().toString();
|
||||||
|
}
|
||||||
|
return opt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息到主题
|
||||||
|
* Topic主题 :放入一个消息,所有订阅者都会收到
|
||||||
|
* 这个是主题目的地是一对多的
|
||||||
|
* @param message
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("topicSender")
|
||||||
|
public String topicSender(@RequestParam("message")String message){
|
||||||
|
String opt = "";
|
||||||
|
try {
|
||||||
|
topicSender.send("test.topic", message);
|
||||||
|
opt = "suc";
|
||||||
|
} catch (Exception e) {
|
||||||
|
opt = e.getCause().toString();
|
||||||
|
}
|
||||||
|
return opt;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
package osc.git.eh3.springamq.mq.consumer.queue;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.MessageListener;
|
||||||
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description 队列消息监听器
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class QueueReceiver1 implements MessageListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(Message message) {
|
||||||
|
try {
|
||||||
|
System.out.println("QueueReceiver1接收到消息:"+((TextMessage)message).getText());
|
||||||
|
} catch (JMSException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
package osc.git.eh3.springamq.mq.consumer.queue;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.MessageListener;
|
||||||
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description 队列消息监听器
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class QueueReceiver2 implements MessageListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(Message message) {
|
||||||
|
try {
|
||||||
|
System.out.println("QueueReceiver2接收到消息:"+((TextMessage)message).getText());
|
||||||
|
} catch (JMSException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package osc.git.eh3.springamq.mq.consumer.topic;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.MessageListener;
|
||||||
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description Topic消息监听器
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class TopicReceiver1 implements MessageListener{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(Message message) {
|
||||||
|
try {
|
||||||
|
System.out.println("TopicReceiver1接收到消息:"+((TextMessage)message).getText());
|
||||||
|
} catch (JMSException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package osc.git.eh3.springamq.mq.consumer.topic;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.MessageListener;
|
||||||
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description Topic消息监听器
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class TopicReceiver2 implements MessageListener{
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessage(Message message) {
|
||||||
|
try {
|
||||||
|
System.out.println("TopicReceiver2接收到消息:"+((TextMessage)message).getText());
|
||||||
|
} catch (JMSException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package osc.git.eh3.springamq.mq.producer.queue;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.jms.core.JmsTemplate;
|
||||||
|
import org.springframework.jms.core.MessageCreator;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.Session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description 队列消息生产者,发送消息到队列
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Component("queueSender")
|
||||||
|
public class QueueSender {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("jmsQueueTemplate")
|
||||||
|
private JmsTemplate jmsTemplate;//通过@Qualifier修饰符来注入对应的bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送一条消息到指定的队列(目标)
|
||||||
|
* @param queueName 队列名称
|
||||||
|
* @param message 消息内容
|
||||||
|
*/
|
||||||
|
public void send(String queueName,final String message){
|
||||||
|
jmsTemplate.send(queueName, new MessageCreator() {
|
||||||
|
@Override
|
||||||
|
public Message createMessage(Session session) throws JMSException {
|
||||||
|
return session.createTextMessage(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package osc.git.eh3.springamq.mq.producer.topic;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.jms.core.JmsTemplate;
|
||||||
|
import org.springframework.jms.core.MessageCreator;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.jms.JMSException;
|
||||||
|
import javax.jms.Message;
|
||||||
|
import javax.jms.Session;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author liang
|
||||||
|
* @description Topic生产者发送消息到Topic
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component("topicSender")
|
||||||
|
public class TopicSender {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("jmsTopicTemplate")
|
||||||
|
private JmsTemplate jmsTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送一条消息到指定的队列(目标)
|
||||||
|
* @param topicName 队列名称
|
||||||
|
* @param message 消息内容
|
||||||
|
*/
|
||||||
|
public void send(String topicName,final String message){
|
||||||
|
jmsTemplate.send(topicName, new MessageCreator() {
|
||||||
|
@Override
|
||||||
|
public Message createMessage(Session session) throws JMSException {
|
||||||
|
return session.createTextMessage(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
68
src/main/resources/ActiveMQ.xml
Normal file
68
src/main/resources/ActiveMQ.xml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amq="http://activemq.apache.org/schema/core"
|
||||||
|
xmlns:jms="http://www.springframework.org/schema/jms"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/jms
|
||||||
|
http://www.springframework.org/schema/jms/spring-jms-4.0.xsd
|
||||||
|
http://activemq.apache.org/schema/core
|
||||||
|
http://activemq.apache.org/schema/core/activemq-core-5.8.0.xsd">
|
||||||
|
|
||||||
|
<!-- ActiveMQ 连接工厂 -->
|
||||||
|
<!-- 真正可以产生Connection的ConnectionFactory,由对应的 JMS服务厂商提供-->
|
||||||
|
<!-- 如果连接网络:tcp://ip:61616;未连接网络:tcp://localhost:61616 以及用户名,密码-->
|
||||||
|
<amq:connectionFactory id="amqConnectionFactory"
|
||||||
|
brokerURL="tcp://192.168.1.251:61616" userName="admin" password="admin" />
|
||||||
|
|
||||||
|
<!-- Spring Caching连接工厂 -->
|
||||||
|
<!-- Spring用于管理真正的ConnectionFactory的ConnectionFactory -->
|
||||||
|
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
|
||||||
|
<!-- 目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory -->
|
||||||
|
<property name="targetConnectionFactory" ref="amqConnectionFactory"></property>
|
||||||
|
<!-- 同上,同理 -->
|
||||||
|
<!-- <constructor-arg ref="amqConnectionFactory" /> -->
|
||||||
|
<!-- Session缓存数量 -->
|
||||||
|
<property name="sessionCacheSize" value="100" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- Spring JmsTemplate 的消息生产者 start-->
|
||||||
|
|
||||||
|
<!-- 定义JmsTemplate的Queue类型 -->
|
||||||
|
<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||||
|
<!-- 这个connectionFactory对应的是我们定义的Spring提供的那个ConnectionFactory对象 -->
|
||||||
|
<constructor-arg ref="connectionFactory" />
|
||||||
|
<!-- 非pub/sub模型(发布/订阅),即队列模式 -->
|
||||||
|
<property name="pubSubDomain" value="false" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- 定义JmsTemplate的Topic类型 -->
|
||||||
|
<bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate">
|
||||||
|
<!-- 这个connectionFactory对应的是我们定义的Spring提供的那个ConnectionFactory对象 -->
|
||||||
|
<constructor-arg ref="connectionFactory" />
|
||||||
|
<!-- pub/sub模型(发布/订阅) -->
|
||||||
|
<property name="pubSubDomain" value="true" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!--Spring JmsTemplate 的消息生产者 end-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 消息消费者 start-->
|
||||||
|
|
||||||
|
<!-- 定义Queue监听器 -->
|
||||||
|
<jms:listener-container destination-type="queue" container-type="default" connection-factory="connectionFactory" acknowledge="auto">
|
||||||
|
<jms:listener destination="test.queue" ref="queueReceiver1"/>
|
||||||
|
<jms:listener destination="test.queue" ref="queueReceiver2"/>
|
||||||
|
</jms:listener-container>
|
||||||
|
|
||||||
|
<!-- 定义Topic监听器 -->
|
||||||
|
<jms:listener-container destination-type="topic" container-type="default" connection-factory="connectionFactory" acknowledge="auto">
|
||||||
|
<jms:listener destination="test.topic" ref="topicReceiver1"/>
|
||||||
|
<jms:listener destination="test.topic" ref="topicReceiver2"/>
|
||||||
|
</jms:listener-container>
|
||||||
|
|
||||||
|
<!-- 消息消费者 end -->
|
||||||
|
</beans>
|
25
src/main/resources/applicationContext.xml
Normal file
25
src/main/resources/applicationContext.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- 查找最新的schemaLocation 访问 http://www.springframework.org/schema/ -->
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
||||||
|
http://activemq.apache.org/schema/core
|
||||||
|
http://activemq.apache.org/schema/core/activemq-core-5.9.0.xsd">
|
||||||
|
|
||||||
|
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
|
||||||
|
|
||||||
|
<!-- 配置扫描路径 -->
|
||||||
|
<context:component-scan base-package="osc.git.eh3.springamq">
|
||||||
|
<!-- 只扫描Service,也可以添加Repostory,但是要把Controller排除在外,Controller由spring-mvc.xml去加载 -->
|
||||||
|
<!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Service" /> -->
|
||||||
|
<!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository" /> -->
|
||||||
|
<!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Component" /> -->
|
||||||
|
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||||
|
</context:component-scan>
|
||||||
|
|
||||||
|
</beans>
|
@ -23,7 +23,7 @@
|
|||||||
<javaClientGenerator type="XMLMAPPER" targetPackage="com.pxene.dsp.archer.dao" targetProject="src/main/java">
|
<javaClientGenerator type="XMLMAPPER" targetPackage="com.pxene.dsp.archer.dao" targetProject="src/main/java">
|
||||||
<property name="enableSubPackages" value="true"/>
|
<property name="enableSubPackages" value="true"/>
|
||||||
</javaClientGenerator>
|
</javaClientGenerator>
|
||||||
<table tableName="dsp_t_ad_group_apptarget_filter" domainObjectName="AdGroupAppTargetFilterModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
|
<table tableName="dsp_t_group_target_audit" domainObjectName="GroupTargetAuditModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
|
||||||
<!--
|
<!--
|
||||||
<table tableName="dsp_t_advertiser" domainObjectName="AdvertiserModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
|
<table tableName="dsp_t_advertiser" domainObjectName="AdvertiserModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
|
||||||
<table tableName="dsp_t_open_request_data" domainObjectName="OpenRequestDataModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table>
|
<table tableName="dsp_t_open_request_data" domainObjectName="OpenRequestDataModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table>
|
||||||
|
27
src/main/resources/log4j.properties
Normal file
27
src/main/resources/log4j.properties
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
### direct log messages to stdout and logFile###
|
||||||
|
log4j.rootCategory=INFO, stdout,logFile
|
||||||
|
|
||||||
|
# OpenSymphony Stuff
|
||||||
|
log4j.logger.com.opensymphony=INFO
|
||||||
|
log4j.logger.org.apache.struts2=INFO
|
||||||
|
log4j.logger.org.apache.commons=INFO
|
||||||
|
|
||||||
|
# Spring Stuff
|
||||||
|
log4j.logger.org.springframework=INFO
|
||||||
|
log4j.logger.org.springframework.oxm=INFO
|
||||||
|
|
||||||
|
# Hibernate Stuff
|
||||||
|
log4j.logger.org.hibernate=INFO
|
||||||
|
log4j.logger.org.hibernate.type=INFO
|
||||||
|
log4j.logger.org.hibernate.tool.hbm2ddl=INFO
|
||||||
|
|
||||||
|
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||||
|
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.stdout.layout.ConversionPattern=[%p] %-d{yyyy-MM-dd HH\:mm\:ss} [%t] [%c.%M\:%L] %m%n
|
||||||
|
|
||||||
|
log4j.appender.logFile=org.apache.log4j.RollingFileAppender
|
||||||
|
log4j.appender.logFile.File=${webapp.root}/logs/amq.log
|
||||||
|
log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
|
||||||
|
log4j.appender.logFile.layout.ConversionPattern=[%p] %-d{yyyy-MM-dd HH\:mm\:ss} [%t] [%c.%M\:%L] %m%n
|
||||||
|
log4j.appender.logFile.MaxFileSize = 5MB
|
||||||
|
log4j.appender.logFile.MaxBackupIndex =3
|
40
src/main/resources/spring-mvc.xml
Normal file
40
src/main/resources/spring-mvc.xml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- 查找最新的schemaLocation 访问 http://www.springframework.org/schema/ -->
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||||
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/aop
|
||||||
|
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/beans
|
||||||
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/context
|
||||||
|
http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/mvc
|
||||||
|
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
|
||||||
|
http://www.springframework.org/schema/tx
|
||||||
|
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
|
||||||
|
|
||||||
|
<!-- 启用MVC注解 -->
|
||||||
|
<mvc:annotation-driven />
|
||||||
|
|
||||||
|
<!-- 静态资源文件,不会被Spring MVC拦截 -->
|
||||||
|
<mvc:resources location="/resources/" mapping="/resources/**"/>
|
||||||
|
|
||||||
|
<!-- 指定Sping组件扫描的基本包路径 -->
|
||||||
|
<context:component-scan base-package="osc.git.eh3.springamq" >
|
||||||
|
<!-- 这里只扫描Controller,不可重复加载Service -->
|
||||||
|
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||||
|
</context:component-scan>
|
||||||
|
|
||||||
|
<!-- JSP视图解析器-->
|
||||||
|
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||||
|
<property name="prefix" value="/WEB-INF/views/" />
|
||||||
|
<property name="suffix" value=".jsp" />
|
||||||
|
<!-- 定义其解析视图的order顺序为1 -->
|
||||||
|
<property name="order" value="1" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
@ -1,7 +1,71 @@
|
|||||||
<!DOCTYPE web-app PUBLIC
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||||
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
|
||||||
|
version="3.0">
|
||||||
|
<display-name>ActiveMQSpringDemo</display-name>
|
||||||
|
|
||||||
<web-app>
|
<!-- Log4J Start -->
|
||||||
<display-name>Archetype Created Web Application</display-name>
|
<context-param>
|
||||||
</web-app>
|
<param-name>log4jConfigLocation</param-name>
|
||||||
|
<param-value>classpath:log4j.properties</param-value>
|
||||||
|
</context-param>
|
||||||
|
<context-param>
|
||||||
|
<param-name>log4jRefreshInterval</param-name>
|
||||||
|
<param-value>6000</param-value>
|
||||||
|
</context-param>
|
||||||
|
<!-- Spring Log4J config -->
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
<!-- Log4J End -->
|
||||||
|
|
||||||
|
<!-- Spring 编码过滤器 start -->
|
||||||
|
<filter>
|
||||||
|
<filter-name>characterEncoding</filter-name>
|
||||||
|
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||||
|
<init-param>
|
||||||
|
<param-name>encoding</param-name>
|
||||||
|
<param-value>UTF-8</param-value>
|
||||||
|
</init-param>
|
||||||
|
<init-param>
|
||||||
|
<param-name>forceEncoding</param-name>
|
||||||
|
<param-value>true</param-value>
|
||||||
|
</init-param>
|
||||||
|
</filter>
|
||||||
|
<filter-mapping>
|
||||||
|
<filter-name>characterEncoding</filter-name>
|
||||||
|
<url-pattern>/*</url-pattern>
|
||||||
|
</filter-mapping>
|
||||||
|
<!-- Spring 编码过滤器 End -->
|
||||||
|
|
||||||
|
<!-- Spring Application Context Listener Start -->
|
||||||
|
<context-param>
|
||||||
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
<param-value>classpath*:applicationContext.xml,classpath*:ActiveMQ.xml</param-value>
|
||||||
|
</context-param>
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
<!-- Spring Application Context Listener End -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Spring MVC Config Start -->
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>SpringMVC</servlet-name>
|
||||||
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||||
|
|
||||||
|
<init-param>
|
||||||
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
<param-value>classpath:spring-mvc.xml</param-value>
|
||||||
|
</init-param>
|
||||||
|
<load-on-startup>1</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>SpringMVC</servlet-name>
|
||||||
|
<!-- Filter all resources -->
|
||||||
|
<url-pattern>/</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<!-- Spring MVC Config End -->
|
||||||
|
|
||||||
|
</web-app>
|
@ -1,5 +1,104 @@
|
|||||||
|
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
||||||
|
<%
|
||||||
|
String path = request.getContextPath();
|
||||||
|
System.out.println(path);
|
||||||
|
String basePath = request.getScheme() + "://"
|
||||||
|
+ request.getServerName() + ":" + request.getServerPort()
|
||||||
|
+ path + "/";
|
||||||
|
System.out.println(basePath);
|
||||||
|
%>
|
||||||
|
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<base href="<%=basePath%>">
|
||||||
|
|
||||||
|
<title>ActiveMQ Demo程序</title>
|
||||||
|
|
||||||
|
<meta http-equiv="pragma" content="no-cache">
|
||||||
|
<meta http-equiv="cache-control" content="no-cache">
|
||||||
|
<meta http-equiv="expires" content="0">
|
||||||
|
<script type="text/javascript" src="resources/jquery-1.11.0.min.js"></script>
|
||||||
|
<style type="text/css">
|
||||||
|
.h1 {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#producer{
|
||||||
|
width: 48%;
|
||||||
|
border: 1px solid blue;
|
||||||
|
height: 80%;
|
||||||
|
align:center;
|
||||||
|
margin:0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
body{
|
||||||
|
text-align :center;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
text-align :center;
|
||||||
|
}
|
||||||
|
textarea{
|
||||||
|
width:80%;
|
||||||
|
height:100px;
|
||||||
|
border:1px solid gray;
|
||||||
|
}
|
||||||
|
button{
|
||||||
|
background-color: rgb(62, 156, 66);
|
||||||
|
border: none;
|
||||||
|
font-weight: bold;
|
||||||
|
color: white;
|
||||||
|
height:30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function send(controller){
|
||||||
|
if($("#message").val()==""){
|
||||||
|
$("#message").css("border","1px solid red");
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
$("#message").css("border","1px solid gray");
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
type: 'post',
|
||||||
|
url:'<%=basePath%>activemq/'+controller,
|
||||||
|
dataType:'text',
|
||||||
|
data:{"message":$("#message").val()},
|
||||||
|
success:function(data){
|
||||||
|
if(data=="suc"){
|
||||||
|
$("#status").html("<font color=green>发送成功</font>");
|
||||||
|
setTimeout(clear,1000);
|
||||||
|
}else{
|
||||||
|
$("#status").html("<font color=red>"+data+"</font>");
|
||||||
|
setTimeout(clear,5000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error:function(data){
|
||||||
|
$("#status").html("<font color=red>ERROR:"+data["status"]+","+data["statusText"]+"</font>");
|
||||||
|
setTimeout(clear,5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function clear(){
|
||||||
|
$("#status").html("");
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h2>Hello World!</h2>
|
<h1>Hello ActiveMQ</h1>
|
||||||
|
<div id="producer">
|
||||||
|
<h2>Producer</h2>
|
||||||
|
<textarea id="message"></textarea>
|
||||||
|
<br>
|
||||||
|
<button onclick="send('queueSender')">发送Queue消息</button>
|
||||||
|
<button onclick="send('topicSender')">发送Topic消息</button>
|
||||||
|
<br>
|
||||||
|
<span id="status"></span>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
4
src/main/webapp/resources/jquery-1.11.0.min.js
vendored
Normal file
4
src/main/webapp/resources/jquery-1.11.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user