From 79f05f67d37ce014efedbc85feef5a9f1bf509de Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 22 Jan 2008 16:59:24 +0000 Subject: [PATCH] Added documentation for JMS adapters --- .../reference/src/adapters.xml | 55 ++++++++++++++++++- .../reference/src/configuration.xml | 18 ++++++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/spring-integration-reference/reference/src/adapters.xml b/spring-integration-reference/reference/src/adapters.xml index 6f5a688981..f2b4c32f86 100644 --- a/spring-integration-reference/reference/src/adapters.xml +++ b/spring-integration-reference/reference/src/adapters.xml @@ -7,9 +7,60 @@ Channel Adapters are the components responsible for interacting with external systems or other components that are external to the messaging system. As the name implies, the interaction consists of adapting the external - system or component to send to and/or receive from a MessageChannel. Within + system or component to send-to and/or receive-from a MessageChannel. Within Spring Integration, there is a distinction between source adapters and target - adapters. + adapters. In the 1.0 Milestone 1 release, Spring Integration includes adapters for JMS, Files, + Streams, Spring ApplicationEvents, as well as general purpose Method-invoking adapters. + + + +
+ JMS Adapters + + Spring Integration provides two adapters for accepting JMS messages: + JmsPollingSourceAdapter and JmsMessageDrivenSourceAdapter. + The former uses Spring's JmsTemplate to receive based on a polling period. The latter + configures and delegates to an instance of Spring's DefaultMessageListenerContainer. + + + The JmsPollingSourceAdapter requires a reference to either a single + JmsTemplate instance or both ConnectionFactory and + Destination (a 'destinationName' can be provided in place of the 'destination' + reference). The JmsPollingSourceAdapter also requires a 'channel' property that should be + a reference to a MessageChannel instance. The adapter accepts additional + properties such as: period, initialDelay, maxMessagesPerTask, and sendTimeout. The following example defines a + JMS source adapter that polls every 5 seconds and then sends to the "exampleChannel": + + + + +]]> + + + In most cases, Spring Integration's message-driven JMS adapter is more appropriate since it delegates to a + MessageListener container and supports dynamically adjusting concurrent + consumers. The JmsMessageDrivenSourceAdapter requires references to a + MessageChannel, a ConnectionFactory, and a + Destination (or 'destinationName'). The following example defines a JMS + message-driven source adapter that receives from the JMS queue called "exampleQueue" and then sends to + the Spring Integration channel named "exampleChannel": + + + + +]]> + + + In both cases, Spring's MessageConverter strategy is used to convert the JMS + message into a plain Java object, and then Spring Integration's MessageMapper + strategy is used to convert from the plain object to a Message. + + + The JmsTargetAdapter is a MessageHandler implementation + that is capable of mapping Spring Integration Messages to JMS messages and then + sending to a JMS destination. It requires either a 'jmsTemplate' reference or both 'connectionFactory' and + 'destination' references. In , you will see how to configure a JMS target + adapter with Spring Integration's namespace support.
\ No newline at end of file diff --git a/spring-integration-reference/reference/src/configuration.xml b/spring-integration-reference/reference/src/configuration.xml index 98d3032437..f1bad9bb81 100644 --- a/spring-integration-reference/reference/src/configuration.xml +++ b/spring-integration-reference/reference/src/configuration.xml @@ -186,6 +186,24 @@ +
+ Configuring Channel Adapters + + The most convenient way to configure Channel Adapters is by using the namespace support. The following examples + demonstrate the namespace-based configuration of source and target adapters (Spring Integration 1.0 M1 includes + namespace support for JMS and Files): + + + + + +]]> + +
+
Enabling Annotation-Driven Configuration