diff --git a/spring-integration-reference/src/samples.xml b/spring-integration-reference/src/samples.xml index e890cfbbfe..5e8e81ef87 100644 --- a/spring-integration-reference/src/samples.xml +++ b/spring-integration-reference/src/samples.xml @@ -1,15 +1,18 @@ + Spring Integration Samples - - Starting with the current release of Spring Integration the samples are distributed as independent Maven-based projects - (http://maven.apache.org/) to minimize the setup time. - Since each project is also an Eclipse-based project, they could be imported as is using "Import existing project wizard". - If you prefer other IDE, configuration should be very trivial, since a special Maven profile was setup to download all the - required dependencies required by all samples. - Detailed instructions on how to run samples provided in README file located in the samples directory of the main distribution. - + + + Starting with the current release of Spring Integration the samples are distributed as independent + Maven-based projects (http://maven.apache.org/) to minimize the setup time. + Since each project is also an Eclipse-based project, they can be imported as is using "Import existing project wizard". + If you prefer another IDE, configuration should be very trivial, since a special Maven profile was setup to download all + of the required dependencies for all samples. Detailed instructions on how to build and run the samples are provided in + the README.txt file located in the samples directory of the main distribution. + +
The Cafe Sample @@ -31,7 +34,7 @@ The Order object may contain multiple OrderItems. Once the order is placed, a Splitter will break the composite order message into a single message per drink. Each of these is then processed by a Router that determines whether the drink is hot - or cold (checking the OrderItem object's 'isIced' property). Finally the + or cold (checking the OrderItem object's 'isIced' property). The Barista prepares each drink, but hot and cold drink preparation are handled by two distinct methods: 'prepareHotDrink' and 'prepareColdDrink'. The prepared drinks are then sent to the Waiter where they are aggregated into a Delivery object. @@ -195,16 +198,10 @@ } }]]> - - To run this demo, go to the "samples" directory within the root of the Spring Integration distribution. On - Unix/Mac you can run 'cafeDemo.sh', and on Windows you can run 'cafeDemo.bat'. Each of these will by default - create a Spring ApplicationContext from the 'cafeDemo.xml' file that is - in the "spring-integration-samples" JAR and hence on the classpath (it is the same as the XML above). However, a - copy of that file is also available within the "samples" directory, so that you can provide the file name as a - command line argument to either 'cafeDemo.sh' or 'cafeDemo.bat'. This will allow you to experiment with the - configuration and immediately run the demo with your changes. It is probably a good idea to first copy the - original file so that you can make as many changes as you want and still refer back to the original to compare. - + + To run this sample as well as 8 others, refer to the README.txt within the "samples" directory + of the main distribution as described at the beginning of this chapter. + When you run cafeDemo, you will see that the cold drinks are initially prepared more quickly than the hot drinks. Because there is an aggregator, the cold drinks are effectively limited by the rate of the hot drink preparation. @@ -233,17 +230,16 @@ then you will notice that occasionally it throttles the input by forcing the task-scheduler (the caller) to invoke the operation. - + In addition to experimenting with the poller's concurrency settings, you can also add the 'transactional' - sub-element. If you want to explore the sample in more detail, the source JAR is available in the "src" - directory: 'org.springframework.integration.samples-sources-1.0.0.jar'. - + sub-element and then refer to any PlatformTransactionManager instance within the context. +
The xml messaging sample - The xml messaging sample in org.springframework.integration.samples.xml illustrates how to use + The xml messaging sample in the org.springframework.integration.samples.xml illustrates how to use some of the provided components which deal with xml payloads. The sample uses the idea of processing an order for books represented as xml. @@ -284,7 +280,6 @@ xsl-resource="classpath:org/springframework/integration/samples/xml/bigBooksSupplierTransformer.xsl"/> ]]> -
- +
\ No newline at end of file diff --git a/spring-integration-reference/src/service-activator.xml b/spring-integration-reference/src/service-activator.xml index 40fdb04c2a..79d53f1195 100644 --- a/spring-integration-reference/src/service-activator.xml +++ b/spring-integration-reference/src/service-activator.xml @@ -34,33 +34,37 @@ "output-channel" was provided in the endpoint configuration: <service-activator input-channel="exampleChannel" output-channel="replyChannel" ref="somePojo" method="someMethod"/> - If no "output-channel" is available, it will then check the Message's RETURN_ADDRESS header + If no "output-channel" is available, it will then check the Message's REPLY_CHANNEL header value. If that value is available, it will then check its type. If it is a MessageChannel, the reply message will be sent to that channel. If it is a String, then the endpoint will attempt to resolve the channel name to a channel instance. If the channel cannot be resolved, then a ChannelResolutionException will be thrown. - The argument in the service method could be either a Message or an arbitrary type. If the later one, then it will be assumed that it is a Payload source, - which will be extracted from the message and injected into such service method. This is generally the recommended approach as it follows and promotes - a POJO model when working with Spring Integration. - Since v1.0.3 of Spring Integration, the service method does not require to have an argument at all, which means you can now implement event-style Service Activators, - where all you care about is an invocation of the service method not worrying about the contents of the message. Think of it as a NULL JMS message. An example use-case for such implementation - could be a simple counter/monitor of messages deposited on the input channel. + The argument in the service method could be either a Message or an arbitrary type. If the latter, then it will + be assumed that it is a Message payload, which will be extracted from the message and injected into such service + method. This is generally the recommended approach as it follows and promotes a POJO model when working with Spring + Integration. Arguments may also have @Header or @Headers annotations as described in + + Since v1.0.3 of Spring Integration, the service method is not required to have an argument at all, which means you + can now implement event-style Service Activators, where all you care about is an invocation of the service method, + not worrying about the contents of the message. Think of it as a NULL JMS message. An example use-case for such an + implementation could be a simple counter/monitor of messages deposited on the input channel. + - Using a "ref" attribute is generally recommended if custom Service Activator handler implementation can be reused in other <service-activator> definitions. However -if custom Service Activator handler implementation has to be scoped to a concrete definition of the <service-activator>, starting with v1.0.3, Spring Integration supports -inner bean definitions for custom Service Activator handlers within the <service-activator> element: -<service-activator> definitions. However if the custom Service Activator handler implementation + should be scoped to a single definition of the <service-activator>, you can use an inner bean definition: + - \ + ]]> - Using both "ref" attribute and inner handler definition in the same <service-activator> configuration - is not allowed, as it creates an ambiguous condition and will result in Exception being thrown + Using both the "ref" attribute and an inner handler definition in the same <service-activator> + configuration is not allowed, as it creates an ambiguous condition and will result in an Exception being thrown.