upgraded spring and SI versions, clean up

This commit is contained in:
David Turanski
2013-03-15 12:11:29 -04:00
parent a513a2b389
commit eb41f9a5bd
43 changed files with 135 additions and 1004 deletions

View File

@@ -1,22 +1,22 @@
Spring Integration Flow
-----------------------
========================
NOTE: If you want to get right to the code, see the unit tests and check out (literally :) the spring-integration-flow-samples project
*NOTE: If you want to get right to the code, see the unit tests and check out (literally :) the [spring-integration-flow-samples](http:github.com/dturanski/spring-integration-flow-samples) project*
Goals
---------
#Goals
Spring Integration components already support common enterprise integration patterns. Sometimes it is desirable to
create common message flows which implement higher level messaging patterns or "cross cutting concerns" for your
application environment. This is especially true in more complex applications.
Out of the box, a best practice is to define a common message flow in its own bean definition
file which may be imported into other message flows. This approach however has some limitations:
- It's input and output channels are referenced in every consuming flow. Each common flow must ensure unique channel names
- True encapsuation is impossible as any internal channels and components are exposed to the consuming flow. Note that these must have
* It's input and output channels are referenced in every consuming flow. Each common flow must ensure unique channel names
* True encapsuation is impossible as any internal channels and components are exposed to the consuming flow. Note that these must have
unique names as well
- Since a common flow is statically bound to channels, it cannot be used in a chain without implementing some type of service-activator/
* Since a common flow is statically bound to channels, it cannot be used in a chain without implementing some type of service-activator/
gateway wrapper.
- Since the common flow is part of the same application context (an imported resource), is not practical to configure multiple instances with
* Since the common flow is part of the same application context (an imported resource), is not practical to configure multiple instances with
different property values, bean definitions, etc. (As of Spring 3.1 it may possible to do something with environment profiles, but would be overly complex)
The spring-integration-flow module provides a way to implement and use common flows while addressing the above limitations. A flow is an
@@ -33,47 +33,49 @@ The flow is not bound to input and output channels in the consumer context and m
a chain. It is also possible in theory to compose flows of other flows (NOTE: This hasn't been tested yet).
Usage
--------
# Usage
The flow consumer instantiates a flow and configures one or more flow outbound-gateways.
Instantiating a flow is very simple:
<int-flow:flow id="subflow1"/>
<int-flow:flow id="subflow1"/>
The above bean definition instantiates a flow defined as "subflow1". The flow id references an existing flow implementation, presumably packaged in a
separate jar. The flow element also provides optional 'properties' attribute and a 'referenced-bean-locations' attributes to inject properties and a list of
bean definition locations respectively. Note that any bean definition or property in the parent context may also be referenced (inherited) by the flow. As
an alternative to the properties attribute which references a util:properties bean, A properties object may be configured as an inner bean. The following are
functionally equivalent:
an alternative to the properties attribute which references a util:properties bean, A properties object may be configured as an inner bean. The following are functionally equivalent:
-----------------------------------------------------------
<util:properties id="myprops">
<prop key="key1>val1</prop>
</util:properties>
<util:properties id="myprops">
<prop key="key1>val1</prop>
</util:properties>
<int-flow:flow id="subflow1" properties="myprops"/>
<int-flow:flow id="subflow1" properties="myprops"/>
---------------------------------------------------------
<int-flow:flow id="subflow1">
<props>
<prop key="key1>val1</prop>
<int-flow:flow id="subflow1">
<props>
<prop key="key1>val1</prop>
</props>
</int-flow:flow>
---------------------------------------------------------
</int-flow:flow>
If there are multiple instances of the same flow, you must specify a flow-id attribute:
<int-flow:flow id="flow1" flow-id="subflow1">
<props>
<prop key="key1>some value</prop>
</props>
</int-flow:flow>
<int-flow:flow id="flow1" flow-id="subflow1">
<props>
<prop key="key1>some value</prop>
</props>
</int-flow:flow>
<int-flow:flow id="flow2" flow-id="subflow1">
<props>
<prop key="key1>another value</prop>
</props>
</int-flow:flow>
<int-flow:flow id="flow2" flow-id="subflow1">
<props>
<prop key="key1>another value</prop>
</props>
</int-flow:flow>
By default the id attribute is used as the flow-id.
@@ -83,25 +85,30 @@ An optional help attribute, if set to true will output the flow's description do
The flow is invoked via an outbound-gateway:
<int-flow:outbound-gateway flow="flow1" input-channel="inputChannel1" output-channel="outputChannel1"/>
<int-flow:outbound-gateway flow="flow1" input-channel="inputChannel1" output-channel="outputChannel1"/>
<int-flow:outbound-gateway flow="flow2" input-channel="inputChannel2" output-channel="outputChannel2"/>
<int-flow:outbound-gateway flow="flow2" input-channel="inputChannel2" output-channel="outputChannel2"/>
A message sent on the gateway's input-channel is delegated to the flow. The message on the output-channel is a response from one of the flows output
ports. The output port name is contained in the response message header 'flow.output.port'
NOTE: An optional input-port attribute is available if the flow defines multiple inputs, otherwise the input port it will be automatically mapped.
*NOTE: An optional input-port attribute is available if the flow defines multiple inputs, otherwise the input port it will be automatically mapped.*
Flows may also be used in a chain just as any AbstractReplyProducingMessageHandler:
<chain input-channel="inputChannel" output-channel="outputChannel">
<int-flow:outbound-gateway flow="flow1"/>
<int-flow:outbound-gateway flow="flow2"/>
</chain>
<chain input-channel="inputChannel" output-channel="outputChannel">
<int-flow:outbound-gateway flow="flow1"/>
<int-flow:outbound-gateway flow="flow2"/>
</chain>
## Referencing External Bean Definitions
Sometimes you may want to reference external bean definitions that must be defined differently for each flow instance. To do this, simply provide a list of resources containing these bean definitions.
<int-flow:flow id="myflow" referenced-bean-locations=
"/org/springframework/integration/flow/config/xml/ref-bean-config.xml">
Implementing a Flow
-------------------
# Implementing a Flow
The flow element is used to locate the flow's spring bean definition file(s) by convention (classpath:META-INF/spring/flows/[flow-id]/*.xml). It's bean definition
files and any referenced-bean-locations will be used to create a child application context. The flow context must provide a FlowConfiguration bean which defines the
flows input and output ports and maps them to internal input and output channels.
@@ -109,22 +116,22 @@ flows input and output ports and maps them to internal input and output channels
Namespace support is provided for FlowConfiguration. In the simplest case, a flow implementation encapsulates a Spring Integration flow with a single input-channel and
a single output-channel. The required configuration is simply declared:
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="inputChannel" output-channel="outputChannel"/>
</int-flow:flow-configuration>
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="inputChannel" output-channel="outputChannel"/>
</int-flow:flow-configuration>
Note: The output-channel attribute is optional if the flow does not produce a response.
For more complex scenarios, the flow configuration supports multiple port-mappings, each bound to a single input channel and 0 or more output channels. A configuration
for specifying multiple outputs looks like:
<int-flow:flow-configuration>
<int-flow:port-mapping>
<int-flow:input-port name="input" channel="inputChannel"/>
<int-flow:output-port name="output" channel="outputChannel"/>
<int-flow:output-port name="discard" channel="discardChannel"/>
</int-flow:port-mapping>
</int-flow:flow-configuration>
<int-flow:flow-configuration>
<int-flow:port-mapping>
<int-flow:input-port name="input" channel="inputChannel"/>
<int-flow:output-port name="output" channel="outputChannel"/>
<int-flow:output-port name="discard" channel="discardChannel"/>
</int-flow:port-mapping>
</int-flow:flow-configuration>
If the flow defines multiple inputs, then multiple port-mapping elements must be configured. Additionally the flow client must specify the input-port in the outbound-gateway.

20
pom.xml
View File

@@ -4,11 +4,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-flow</artifactId>
<version>2.1.0.M1</version>
<version>1.0.0.SNAPSHOT-BUILD</version>
<name>Spring Integration Flow Support</name>
<properties>
<spring.version>3.1.0.RELEASE</spring.version>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version>
<spring.version>3.2.2.RELEASE</spring.version>
<spring.integration.version>3.0.0.BUILD-SNAPSHOT</spring.integration.version>
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
</properties>
<licenses>
@@ -76,20 +76,16 @@
</build>
<repositories>
<repository>
<id>SpringSource External Bundle Repository</id>
<url>http://repository.springsource.com/maven/bundles/external/</url>
<id>SpringSource Plugin Repository</id>
<url>http://repo.springsource.org/plugins-release</url>
</repository>
<repository>
<id>SpringSource Milestone Repository</id>
<url>http://maven.springframework.org/milestone/</url>
<url>http://repo.springsource.org/libs-milestone</url>
</repository>
<repository>
<id>SpringSource Release Bundle Repository</id>
<url>http://repository.springsource.com/maven/bundles/release/</url>
</repository>
<repository>
<id>SpringSource Release Repository</id>
<url>http://maven.springframework.org/release/</url>
<id>SpringSource Snapshot Repository</id>
<url>http://repo.springsource.org/libs-snapshot</url>
</repository>
</repositories>
<dependencies>

View File

@@ -1,2 +1,2 @@
http\://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd=org/springframework/integration/flow/config/spring-integration-flow-2.1.xsd
http\://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd=org/springframework/integration/flow/config/spring-integration-flow-2.1.xsd
http\://www.springframework.org/schema/integration/flow/spring-integration-flow-1.0.xsd=org/springframework/integration/flow/config/spring-integration-flow-1.0.xsd
http\://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd=org/springframework/integration/flow/config/spring-integration-flow-1.0.xsd

View File

@@ -8,7 +8,7 @@
<xsd:import namespace="http://www.springframework.org/schema/tool" />
<xsd:import namespace="http://www.springframework.org/schema/beans"
schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" />
schemaLocation="http://www.springframework.org/schema/beans/spring-beans.xsd" />
<xsd:import namespace="http://www.springframework.org/schema/integration" />
<xsd:element name="flow">

View File

@@ -1,48 +0,0 @@
package org.springframework.integration.flow;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.PublishSubscribeChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.core.SubscribableChannel;
import org.springframework.integration.flow.config.FlowUtils;
import org.springframework.integration.message.GenericMessage;
/**
*
* @author David Turanski
*
*/
public class FlowUtilsTest {
@Test
public void buildBridge(){
SubscribableChannel inputChannel = new DirectChannel();
SubscribableChannel outputChannel = new PublishSubscribeChannel();
PollableChannel receiveChannel = new QueueChannel();
FlowUtils.bridgeChannels(inputChannel, outputChannel);
FlowUtils.bridgeChannels(outputChannel, receiveChannel);
Message<?> message = new GenericMessage<String>("hello");
inputChannel.send(message);
Message<?> result = receiveChannel.receive(100);
assertNotNull(result);
assertSame(message, result);
}
@Test
public void displayDependencies() {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("META-INF/spring/integration/flows/subflow5/subflow5-context.xml");
FlowUtils.displayBeansGraph(ctx.getBeanFactory());
}
}

View File

@@ -1,101 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.flow.Flow;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
*
* @author David Turanski
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/FlowClientNamespaceTest-context.xml")
public class FlowClientNamespaceTest {
@Autowired
@Qualifier("inputC1")
MessageChannel gatewayInput;
@Autowired
@Qualifier("outputC1")
PollableChannel gatewayOutput;
@Test
public void testGateway() {
Message<String> msg = new GenericMessage<String>("hello");
gatewayInput.send(msg);
Message<?> reply = gatewayOutput.receive();
assertNotNull(reply);
}
@Autowired
@Qualifier("inputC2")
MessageChannel gatewayInput2;
@Autowired
@Qualifier("outputC2")
PollableChannel gatewayOutput2;
@Test
public void testOutboundGateway() {
Message<String> msg1 = new GenericMessage<String>("hello");
Message<String> msg2 = new GenericMessage<String>("world");
Message<?> reply = null;
gatewayInput2.send(msg1);
reply = gatewayOutput2.receive();
assertNotNull(reply);
assertEquals("gateway-output", reply.getHeaders().get("flow.output.port"));
assertEquals("yeah!", reply.getHeaders().get("gateway"));
gatewayInput2.send(msg2);
reply = gatewayOutput2.receive();
assertNotNull(reply);
assertEquals("gateway-discard", reply.getHeaders().get("flow.output.port"));
assertEquals("yeah!", reply.getHeaders().get("gateway"));
gatewayInput2.send(msg1);
reply = gatewayOutput2.receive();
assertNotNull(reply);
assertEquals("gateway-output", reply.getHeaders().get("flow.output.port"));
assertEquals("yeah!", reply.getHeaders().get("gateway"));
}
@Autowired
@Qualifier("flowWithProps")
Flow flowWithProps;
@Test
public void testFlowWithInnerProps() {
assertEquals("val1",flowWithProps.getProperties().getProperty("key1"));
}
}

View File

@@ -1,65 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.Iterator;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.integration.flow.FlowConfiguration;
import org.springframework.integration.flow.PortConfiguration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
*
* @author David Turanski
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/FlowConfigNamespaceTest-context.xml")
public class FlowConfigNamespaceTest {
@Autowired
ApplicationContext applicationContext;
@Test
public void test() {
Map<String,FlowConfiguration> flowConfigurations = applicationContext.getBeansOfType(FlowConfiguration.class);
Iterator<FlowConfiguration> iterator = flowConfigurations.values().iterator();
FlowConfiguration flowConfiguration = iterator.next();
assertNotNull(flowConfiguration.getPortConfigurations());
assertEquals(2, flowConfiguration.getPortConfigurations().size());
PortConfiguration pc0 = flowConfiguration.getPortConfigurations().get(0);
assertEquals("input", pc0.getInputPortName());
assertEquals("subflow-input", pc0.getInputChannel());
assertEquals("subflow-output", pc0.getOutputChannel("output"));
assertEquals(1, pc0.getOutputPortNames().size());
flowConfiguration = iterator.next();
assertNotNull(flowConfiguration.getPortConfigurations());
assertEquals (1, flowConfiguration.getPortConfigurations().size());
}
}

View File

@@ -1,8 +1,9 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow-configuration>

View File

@@ -1,43 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author David Turanski
*
*/
public class FlowContextTest {
@Test(expected=BeanCreationException.class)
public void testChannelConflictShouldThrowException() {
try {
new ClassPathXmlApplicationContext("/FlowContextTest-context.xml");
} catch (BeanCreationException e) {
System.out.println(e.getCause().getMessage());
throw e;
}
}
@Test
public void testFlowWithJMX() {
new ClassPathXmlApplicationContext("/FlowContextWithJMXTest-context.xml");
}
}

View File

@@ -1,22 +0,0 @@
package org.springframework.integration.flow.config.xml;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.flow.Flow;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/FlowWithAutowireTest-context.xml")
public class FlowWithAutowireTest {
@Autowired
Flow flow;
@Test
public void test() {
Foo foo = flow.getFlowContext().getBean(Foo.class);
assertNotNull(foo.bar);
}
}

View File

@@ -1,8 +1,8 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow id="autowired"

View File

@@ -1,102 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessagingException;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.core.SubscribableChannel;
import org.springframework.integration.message.GenericMessage;
/**
*
* @author David Turanski
*
*/
public class FlowWithErrorTest {
@Test
public void testFlowThrowsExceptionWithGatewayErrorChannel(){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/FlowWithErrorTest-context.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC",MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel",SubscribableChannel.class);
Message<String> msg = new GenericMessage<String>("hello");
Handler handler = new Handler();
errorChannel.subscribe(handler);
inputChannel.send(msg);
assertTrue(handler.gotResponse);
}
@Test
public void testDirectCallWithErrorChannel(){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/META-INF/spring/integration/flows/subflow5/subflow5-context.xml");
MessageChannel inputChannel = applicationContext.getBean("subflow-input",MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel",SubscribableChannel.class);
errorChannel.subscribe(new MessageHandler() {
@Override
public void handleMessage(Message<?> message) throws MessagingException {
assertTrue( message.getPayload() instanceof MessagingException );
}
});
Message<String> msg = new GenericMessage<String>("hello");
assertTrue(inputChannel.send(msg));
}
@Test
public void testWithErrorChannel(){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/FlowWithErrorTest-context.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC1",MessageChannel.class);
PollableChannel output = applicationContext.getBean("outputC1",PollableChannel.class);
Message<String> msg = new GenericMessage<String>("hello");
inputChannel.send(msg);
Message<?> reply = output.receive(100);
assertNotNull(reply);
assertTrue(reply.getPayload() instanceof MessagingException);
}
private static class Handler implements MessageHandler {
public boolean gotResponse;
@SuppressWarnings("unused")
public Message<?> message;
/* (non-Javadoc)
* @see org.springframework.integration.core.MessageHandler#handleMessage(org.springframework.integration.Message)
*/
@Override
public void handleMessage(Message<?> message) throws MessagingException {
this.gotResponse = true;
this.message = message;
}
}
}

View File

@@ -7,7 +7,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<int-flow:flow id="subflow4"/>
<int-flow:flow id="subflow5"/>

View File

@@ -1,61 +0,0 @@
package org.springframework.integration.flow.config.xml;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessagingException;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.core.SubscribableChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/FlowWithOptionalResponseTest-context.xml")
public class FlowWithOptionalResponseTest {
@Autowired
@Qualifier("inputC")
MessageChannel input;
@Autowired
@Qualifier("inputCO")
MessageChannel inputForOptionalResponse;
@Autowired
@Qualifier("outputC")
SubscribableChannel output;
@Test
public void testOneWay() {
input.send(new GenericMessage<String>("hello"));
}
@Test
public void testOptionResponse() {
TestMessageHandler counter = new TestMessageHandler();
output.subscribe(counter);
for (int i=0; i< 100; i++){
inputForOptionalResponse.send(new GenericMessage<String>("hello"));
}
assertTrue(String.valueOf(counter.count), counter.count >1 && counter.count < 100);
}
static class TestMessageHandler implements MessageHandler {
int count = 0;
@Override
public void handleMessage(Message<?> message) throws MessagingException {
count++;
}
}
}

View File

@@ -7,7 +7,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- Instantiate the flow -->
<int-flow:flow id="no-response"/>

View File

@@ -1,52 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.message.GenericMessage;
/**
*
* @author David Turanski
*
*/
public class FlowWithReferencesTest {
@Test
public void testReferencedBeanConfig(){
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/FlowWithReferencesTest-context.xml");
MessageChannel input = applicationContext.getBean("inputC",MessageChannel.class);
PollableChannel output = applicationContext.getBean("outputC",PollableChannel.class);
Message<String> msg = new GenericMessage<String>("hello");
input.send(msg);
Message<?> reply = output.receive();
assertNotNull(reply);
assertEquals("it works!",reply.getHeaders().get("refbean.value"));
assertEquals("val1",reply.getHeaders().get("property.value.1"));
assertEquals("undefined",reply.getHeaders().get("property.value.2"));
}
}

View File

@@ -1,124 +0,0 @@
/*
* Copyright 2002-2011 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.flow.config.xml;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessagingException;
import org.springframework.integration.core.MessageHandler;
import org.springframework.integration.core.SubscribableChannel;
import org.springframework.integration.flow.FlowConstants;
import org.springframework.integration.flow.Transaction.StubTransactionManager;
import org.springframework.integration.message.ErrorMessage;
import org.springframework.integration.message.GenericMessage;
/**
* @author David Turanski
*
*/
public class TransactionalFlowTest {
@Test
public void testFlowDirectCommit() {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("/META-INF/spring/integration/flows/transactional-flow/flow-context.xml"
,"/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
StubTransactionManager transactionManager = applicationContext.getBean(StubTransactionManager.class);
Handler handler = new Handler();
outputChannel.subscribe(handler);
inputChannel.send(new GenericMessage<String>("hello"));
assertTrue(handler.messageReceived);
assertTrue(transactionManager.committed);
assertFalse(transactionManager.rolledback);
}
@Test
public void testFlowDirectRollback() {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("/META-INF/spring/integration/flows/transactional-flow/flow-context.xml",
"/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputChannel", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputChannel", SubscribableChannel.class);
StubTransactionManager transactionManager = applicationContext.getBean(StubTransactionManager.class);
Handler handler = new Handler();
outputChannel.subscribe(handler);
try {
inputChannel.send(new GenericMessage<String>("rollback"));
fail("should throw exception");
} catch (Exception e) {
assertFalse(handler.messageReceived);
assertTrue(transactionManager.rolledback);
assertFalse(transactionManager.committed);
}
}
@Test
public void testFlowCommit() {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("/TransactionalFlowTest-context.xml","/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
SubscribableChannel outputChannel = applicationContext.getBean("outputC", SubscribableChannel.class);
StubTransactionManager transactionManager = applicationContext.getBean(StubTransactionManager.class);
Handler handler = new Handler();
outputChannel.subscribe(handler);
inputChannel.send(new GenericMessage<String>("hello"));
assertTrue(handler.messageReceived);
assertTrue(transactionManager.committed);
assertFalse(transactionManager.rolledback);
}
@Test
public void testFlowRollbackWithGatewayErrorChannel() {
ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("/TransactionalFlowTest-context.xml","/txmanager-config.xml");
MessageChannel inputChannel = applicationContext.getBean("inputC", MessageChannel.class);
SubscribableChannel errorChannel = applicationContext.getBean("errorChannel", SubscribableChannel.class);
StubTransactionManager transactionManager = applicationContext.getBean(StubTransactionManager.class);
Handler handler = new Handler();
errorChannel.subscribe(handler);
inputChannel.send(new GenericMessage<String>("rollback"));
assertTrue(handler.messageReceived);
assertTrue(handler.message instanceof ErrorMessage);
assertEquals(FlowConstants.FLOW_HANDLER_EXCEPTION_HEADER_VALUE,
handler.message.getHeaders().get(FlowConstants.FLOW_OUTPUT_PORT_HEADER));
assertTrue(transactionManager.rolledback);
assertFalse(transactionManager.committed);
}
private static class Handler implements MessageHandler {
public boolean messageReceived;
public Message<?> message;
/* (non-Javadoc)
* @see org.springframework.integration.core.MessageHandler#handleMessage(org.springframework.integration.Message)
*/
@Override
public void handleMessage(Message<?> message) throws MessagingException {
this.messageReceived = true;
this.message = message;
}
}
}

View File

@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow id="transactional-flow"/>

View File

@@ -1,42 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<!-- Instantiate the flow (folded into its own application context) -->
<int-flow:flow id="subflow1" />
<int-flow:outbound-gateway flow="subflow1"
input-channel="inputC1" output-channel="outputC1" input-port="gateway-input" />
<int:chain input-channel="inputC2" output-channel="outputC2">
<int-flow:outbound-gateway flow="subflow1"
input-port="gateway-input" />
</int:chain>
<int:channel id="outputC1">
<int:queue />
</int:channel>
<int:channel id="outputC2">
<int:queue />
</int:channel>
<int-flow:flow id="flowWithProps" flow-id="subflow1">
<props>
<prop key="key1">val1</prop>
</props>
</int-flow:flow>
</beans>

View File

@@ -1,25 +0,0 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping>
<int-flow:input-port name="input" channel="subflow-input" />
<int-flow:output-port name="output" channel="subflow-output" />
</int-flow:port-mapping>
<int-flow:port-mapping>
<int-flow:input-port name="input2" channel="subflow-input2" />
<int-flow:output-port name="output2" channel="subflow-output2" />
</int-flow:port-mapping>
</int-flow:flow-configuration>
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="inputChannel"
output-channel="outputChannel" />
</int-flow:flow-configuration>
</beans>

View File

@@ -1,22 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Instantiate the flow -->
<int-flow:flow id="subflow" flow-id="flow-with-channel-conflict"/>
<!-- input port not required if only one -->
<int-flow:outbound-gateway flow="subflow"
input-channel="inputC"
output-channel="outputC"
/>
<int:channel id="outputC"/>
</beans>

View File

@@ -1,22 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int-jmx="http://www.springframework.org/schema/integration/jmx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jmx http://www.springframework.org/schema/integration/jmx/spring-integration-jmx.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:mbean-server/>
<int-jmx:mbean-export />
<!-- Instantiate the flow -->
<int-flow:flow id="subflow1" />
</beans>

View File

@@ -1,9 +0,0 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow id="autowired" referenced-bean-locations="classpath:autowired-referenced-beans.xml"/>
</beans>

View File

@@ -1,39 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<int-flow:flow id="subflow4"/>
<int-flow:flow id="subflow5"/>
<int-flow:outbound-gateway
flow="subflow4"
input-port="input"
input-channel="inputC"
output-channel="outputC"
error-channel="errorChannel"/>
<int-flow:outbound-gateway
flow="subflow5"
input-port="input"
input-channel="inputC1"
output-channel="outputC1"/>
<int:channel id="outputC">
<int:queue/>
</int:channel>
<int:channel id="outputC1">
<int:queue/>
</int:channel>
</beans>

View File

@@ -1,24 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<!-- Instantiate the flow -->
<int-flow:flow id="no-response"/>
<int-flow:flow id="optional-response"/>
<int-flow:outbound-gateway
flow="no-response" input-channel="inputC"/>
<int-flow:outbound-gateway
flow="optional-response" input-channel="inputCO" output-channel="outputC"/>
<int:channel id="outputC"/>
</beans>

View File

@@ -1,28 +0,0 @@
<?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:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- Instantiate the flow -->
<int-flow:flow id="subflow2" referenced-bean-locations="classpath:ref-bean-config.xml">
<props>
<prop key="key1">val1</prop>
</props>
</int-flow:flow>
<!-- input port not required if only one -->
<int-flow:outbound-gateway flow="subflow2"
input-channel="inputC"
output-channel="outputC"/>
<int:channel id="outputC">
<int:queue/>
</int:channel>
</beans>

View File

@@ -1,13 +1,13 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:annotation-config/>

View File

@@ -1,10 +1,10 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow-configuration>

View File

@@ -1,10 +1,10 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow-configuration>

View File

@@ -5,11 +5,11 @@
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="inputC" output-channel="outputC"/>

View File

@@ -1,10 +1,10 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow-configuration>

View File

@@ -4,10 +4,10 @@
xmlns:util="http://www.springframework.org/schema/util"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="flow-input"/>

View File

@@ -4,10 +4,10 @@
xmlns:util="http://www.springframework.org/schema/util"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="flow-input" output-channel="flow-output"/>

View File

@@ -1,11 +1,11 @@
<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

View File

@@ -4,10 +4,10 @@
xmlns:util="http://www.springframework.org/schema/util"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping>

View File

@@ -5,11 +5,11 @@
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Need to set ignore-unresolvable true or provide defaults for required properties -->
<context:property-placeholder/>

View File

@@ -5,11 +5,11 @@
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="subflow-input" output-channel="subflow-output"/>

View File

@@ -5,11 +5,11 @@
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping>

View File

@@ -1,16 +1,15 @@
<?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:tx="http://www.springframework.org/schema/tx"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int-script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/script http://www.springframework.org/schema/integration/script-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int-script="http://www.springframework.org/schema/integration/scripting"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration/scripting http://www.springframework.org/schema/integration/scripting/spring-integration-scripting.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<int-flow:flow-configuration>
<int-flow:port-mapping input-channel="inputChannel" output-channel="outputChannel"/>

View File

@@ -1,18 +0,0 @@
<?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:int-flow="http://www.springframework.org/schema/integration/flow"
xmlns:int="http://www.springframework.org/schema/integration"
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd
http://www.springframework.org/schema/integration/flow http://www.springframework.org/schema/integration/flow/spring-integration-flow-2.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<int-flow:flow id="transactional-flow"/>
<int-flow:outbound-gateway flow="transactional-flow"
input-channel="inputC" output-channel="outputC"
error-channel="errorChannel"/>
<int:channel id="outputC"/>
</beans>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.springframework.integration.flow.config.xml.FooFactory"/>
<bean class="org.springframework.integration.flow.config.xml.Bar"/>
</beans>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="refbean" class="org.springframework.integration.flow.config.xml.RefBean">
<property name="value" value="it works!"/>
</bean>
</beans>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="transactionManager" class="org.springframework.integration.flow.Transaction.StubTransactionManager"/>
</beans>