Added JMS Channel Adapter sample (INT-430).
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-1.0.0.jar" sourcepath="/IVY_CACHE/org.aopalliance/com.springsource.org.aopalliance/1.0.0/com.springsource.org.aopalliance-sources-1.0.0.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.apache.activemq/com.springsource.org.apache.activemq/5.1.0/com.springsource.org.apache.activemq-5.1.0.jar" sourcepath="/IVY_CACHE/org.apache.activemq/com.springsource.org.apache.activemq/5.1.0/com.springsource.org.apache.activemq-sources-5.1.0.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar" sourcepath="/IVY_CACHE/org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-sources-1.1.1.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.apache.geronimo.specs/com.springsource.javax.management.j2ee/1.0.1/com.springsource.javax.management.j2ee-1.0.1.jar" sourcepath="/IVY_CACHE/org.apache.geronimo.specs/com.springsource.javax.management.j2ee/1.0.1/com.springsource.javax.management.j2ee-sources-1.0.1.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-4.4.0.jar" sourcepath="/IVY_CACHE/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.aop/2.5.5.A/org.springframework.aop-2.5.5.A.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.aop/2.5.5.A/org.springframework.aop-sources-2.5.5.A.jar"/>
|
||||
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.beans/2.5.5.A/org.springframework.beans-2.5.5.A.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.beans/2.5.5.A/org.springframework.beans-sources-2.5.5.A.jar"/>
|
||||
@@ -18,6 +20,7 @@
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration.adapter"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration.file"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration.jms"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration.ws"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration.stream"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency org="javax.jms" name="com.springsource.javax.jms" rev="1.1.0" conf="provided->runtime"/>
|
||||
<dependency org="org.apache.activemq" name="com.springsource.org.apache.activemq" rev="5.1.0" conf="optional->runtime"/>
|
||||
<dependency org="org.apache.geronimo.specs" name="com.springsource.javax.management.j2ee" rev="1.0.1" conf="provided->compile"/>
|
||||
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.4.0" conf="test->runtime"/>
|
||||
<dependency org="org.springframework.integration" name="org.springframework.integration" rev="latest.integration" conf="compile->compile"/>
|
||||
<dependency org="org.springframework.integration" name="org.springframework.integration.ws" rev="latest.integration" conf="compile->compile"/>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.samples.jms;
|
||||
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
* Bootstrap for starting the JMS Channel Adapters.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public class ChannelAdaptersDemo {
|
||||
|
||||
private final static String[] configFiles = {
|
||||
"common.xml", "inboundChannelAdapter.xml", "outboundChannelAdapter.xml"
|
||||
};
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
new ClassPathXmlApplicationContext(configFiles, ChannelAdaptersDemo.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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:integration="http://www.springframework.org/schema/integration"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd">
|
||||
|
||||
<integration:message-bus/>
|
||||
|
||||
<bean id="connectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">
|
||||
<property name="targetConnectionFactory">
|
||||
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
|
||||
<property name="brokerURL" value="vm://localhost"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="demoQueue" class="org.apache.activemq.command.ActiveMQQueue">
|
||||
<constructor-arg value="queue.demo"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:stream="http://www.springframework.org/schema/integration/stream"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
|
||||
http://www.springframework.org/schema/integration/jms
|
||||
http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd
|
||||
http://www.springframework.org/schema/integration/stream
|
||||
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">
|
||||
|
||||
<jms:inbound-channel-adapter id="jmsin" destination="demoQueue" channel="jmsinToStdoutChannel"/>
|
||||
|
||||
<channel id="jmsinToStdoutChannel"/>
|
||||
|
||||
<stream:stdout-channel-adapter id="stdout" channel="jmsinToStdoutChannel" append-newline="true"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/integration"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:jms="http://www.springframework.org/schema/integration/jms"
|
||||
xmlns:stream="http://www.springframework.org/schema/integration/stream"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/integration
|
||||
http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
|
||||
http://www.springframework.org/schema/integration/jms
|
||||
http://www.springframework.org/schema/integration/jms/spring-integration-jms-1.0.xsd
|
||||
http://www.springframework.org/schema/integration/stream
|
||||
http://www.springframework.org/schema/integration/stream/spring-integration-stream-1.0.xsd">
|
||||
|
||||
<stream:stdin-channel-adapter id="stdin" channel="stdinToJmsoutChannel"/>
|
||||
|
||||
<channel id="stdinToJmsoutChannel"/>
|
||||
|
||||
<jms:outbound-channel-adapter id="jmsout" channel="stdinToJmsoutChannel" destination="demoQueue"/>
|
||||
|
||||
</beans:beans>
|
||||
Reference in New Issue
Block a user