forked from heroku/devcenter-java-web-worker
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial modularization into worker and web
- Loading branch information
1 parent
a5820a0
commit 9210972
Showing
29 changed files
with
1,148 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea | ||
*.iml | ||
.classpath | ||
.settings/ | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
sender: sh target/bin/sender | ||
receiver: sh target/bin/receiver | ||
web: java $JAVA_OPTS_WEB -jar web/target/dependency/webapp-runner.jar --port $PORT web/target/*.war | ||
receiver: sh worker/target/bin/receiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.heroku.devcenter.webworker</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>common</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.rabbitmq</groupId> | ||
<artifactId>amqp-client</artifactId> | ||
<version>2.7.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.amqp</groupId> | ||
<artifactId>spring-rabbit</artifactId> | ||
<version>1.0.0.RELEASE</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,18 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.heroku.devcenter</groupId> | ||
<artifactId>rabbitMqSample</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.rabbitmq</groupId> | ||
<artifactId>amqp-client</artifactId> | ||
<version>2.7.0</version> | ||
</dependency> | ||
|
||
<!-- Required only if using Spring --> | ||
<dependency> | ||
<groupId>org.springframework.amqp</groupId> | ||
<artifactId>spring-rabbit</artifactId> | ||
<version>1.0.0.RELEASE</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>appassembler-maven-plugin</artifactId> | ||
<version>1.1.1</version> | ||
<configuration> | ||
<assembleDirectory>target</assembleDirectory> | ||
<programs> | ||
<program> | ||
<mainClass>com.heroku.devcenter.PojoSender</mainClass> | ||
<name>sender</name> | ||
</program> | ||
<program> | ||
<mainClass>com.heroku.devcenter.PojoReceiver</mainClass> | ||
<name>receiver</name> | ||
</program> | ||
</programs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>assemble</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.heroku.devcenter.webworker</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>common</module> | ||
<module>web</module> | ||
<module>worker</module> | ||
</modules> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
</project> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.heroku.devcenter.webworker</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>web</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<artifactId>common</artifactId> | ||
<groupId>com.heroku.devcenter.webworker</groupId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.amqp</groupId> | ||
<artifactId>spring-rabbit</artifactId> | ||
<version>1.0.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.0.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>3.1.1.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>taglibs</groupId> | ||
<artifactId>standard</artifactId> | ||
<version>1.1.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>jstl</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.jsimone</groupId> | ||
<artifactId>webapp-runner</artifactId> | ||
<version>7.0.27.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>com.github.jsimone</groupId> | ||
<artifactId>webapp-runner</artifactId> | ||
<version>7.0.27.1</version> | ||
<destFileName>webapp-runner.jar</destFileName> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
10 changes: 7 additions & 3 deletions
10
...va/com/heroku/devcenter/SpringSender.java → ...om/heroku/devcenter/RabbitController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:mvc="http://www.springframework.org/schema/mvc" | ||
xmlns:rabbit="http://www.springframework.org/schema/rabbit" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | ||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd | ||
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd"> | ||
|
||
<context:annotation-config /> | ||
<context:component-scan base-package="com.heroku.devcenter" /> | ||
|
||
<mvc:annotation-driven/> | ||
|
||
<bean id="cf" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory"> | ||
<constructor-arg><value>#{ T(com.heroku.devcenter.RabbitFactory).getConnectionFactory()}</value></constructor-arg> | ||
</bean> | ||
|
||
<rabbit:queue id="sample-queue" durable="true" auto-delete="false" exclusive="false" name="sample-queue"/> | ||
|
||
<rabbit:direct-exchange name="sample-exchange" durable="true" auto-delete="false" id="sample-exchange"> | ||
<rabbit:bindings> | ||
<rabbit:binding queue="sample-queue" key="sample-key"/> | ||
</rabbit:bindings> | ||
</rabbit:direct-exchange> | ||
|
||
<bean id="template" class="org.springframework.amqp.rabbit.core.RabbitTemplate"> | ||
<property name="connectionFactory" ref="cf"/> | ||
<property name="exchange" value="sample-exchange"/> | ||
<property name="queue" value="sample-queue"/> | ||
<property name="routingKey" value="sample-key"/> | ||
</bean> | ||
|
||
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> | ||
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> | ||
<property name="prefix" value="/WEB-INF/jsp/" /> | ||
<property name="suffix" value=".jsp" /> | ||
<property name="redirectHttp10Compatible" value="false" /> | ||
</bean> | ||
|
||
<!--suppress SpringModelInspection --> | ||
<mvc:resources mapping="/resources/**" location="/resources/" /> | ||
|
||
</beans> |
Oops, something went wrong.