forked from vmware-archive/springsource-cloudfoundry-samples
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f269b29
commit e45ad6a
Showing
4 changed files
with
132 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.classpath | ||
.project | ||
.settings | ||
.springBeans | ||
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.cloudfoundry.samples</groupId> | ||
<artifactId>rabbit-rest</artifactId> | ||
<packaging>war</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>rabbit-rest</name> | ||
<description>RabbitMQ REST API</description> | ||
<properties> | ||
<java-version>1.6</java-version> | ||
<cloudfoundry-version>0.7.1</cloudfoundry-version> | ||
<spring-version>3.0.5.RELEASE</spring-version> | ||
<spring.integration-version>2.1.0.BUILD-SNAPSHOT</spring.integration-version> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>spring-milestone</id> | ||
<name>Spring Maven Milestone Repository</name> | ||
<url>http://maven.springframework.org/milestone</url> | ||
</repository> | ||
</repositories> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>${spring-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.integration</groupId> | ||
<artifactId>spring-integration-amqp</artifactId> | ||
<version>${spring.integration-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.integration</groupId> | ||
<artifactId>spring-integration-http</artifactId> | ||
<version>${spring.integration-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.cloudfoundry</groupId> | ||
<artifactId>cloudfoundry-runtime</artifactId> | ||
<version>${cloudfoundry-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>servlet-api</artifactId> | ||
<version>2.5</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>jstl</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>${java-version}</source> | ||
<target>${java-version}</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?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:mvc="http://www.springframework.org/schema/mvc" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:rabbit="http://www.springframework.org/schema/rabbit" | ||
xmlns:cloud="http://schema.cloudfoundry.org/spring" | ||
xmlns:int="http://www.springframework.org/schema/integration" | ||
xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp" | ||
xmlns:int-http="http://www.springframework.org/schema/integration/http" | ||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | ||
http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd | ||
http://schema.cloudfoundry.org/spring http://schema.cloudfoundry.org/spring/cloudfoundry-spring-0.7.xsd | ||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd | ||
http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp-2.1.xsd | ||
http://www.springframework.org/schema/integration/http http://www.springframework.org/schema/integration/http/spring-integration-http-2.1.xsd"> | ||
|
||
<int-http:inbound-channel-adapter id="restInbound" | ||
path="/message/{exchange}/{routingKey}" | ||
channel="amqpOutbound" | ||
supported-methods="POST"> | ||
<int-http:header name="exchange" expression="#pathVariables.exchange"/> | ||
<int-http:header name="routingKey" expression="#pathVariables.routingKey"/> | ||
</int-http:inbound-channel-adapter> | ||
|
||
<int-amqp:outbound-channel-adapter id="amqpOutbound" | ||
exchange-name-expression="headers.exchange" | ||
routing-key-expression="headers.routingKey" | ||
amqp-template="rabbitTemplate"/> | ||
|
||
<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/> | ||
|
||
<rabbit:template id="rabbitTemplate" connection-factory="rabbitConnectionFactory"/> | ||
|
||
<rabbit:admin connection-factory="rabbitConnectionFactory"/> | ||
|
||
<!-- cloud:rabbit-connection-factory id="rabbitConnectionFactory"/ --> | ||
|
||
<rabbit:connection-factory id="rabbitConnectionFactory"/> | ||
|
||
</beans> |
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,16 @@ | ||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | ||
|
||
<servlet> | ||
<servlet-name>rabbit</servlet-name> | ||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>rabbit</servlet-name> | ||
<url-pattern>/*</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> |