From c9c9a0875c7f75e73fbdaed1662b4138fae26608 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Tue, 22 Jan 2008 00:43:11 +0000 Subject: [PATCH] Extending reference manual --- .../reference/images/logo.png | Bin 0 -> 9627 bytes .../reference/src/configuration.xml | 119 +++++++++++++++++- .../reference/src/core-api.xml | 56 +++++++-- 3 files changed, 163 insertions(+), 12 deletions(-) create mode 100644 spring-integration-reference/reference/images/logo.png diff --git a/spring-integration-reference/reference/images/logo.png b/spring-integration-reference/reference/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f6d959e77f14eed6bdb750190ff83289279793 GIT binary patch literal 9627 zcmV;MC1l!(P)(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRaMAxT6*RCwC#U1xk$#n(Q!?cQzaZAn5Jgfv14BoKO&UIGeIq**9Rvj8F*5ET&V zN)y3?iqbpMq&I;8fg~h>^v0%cw%;=Ehh0)PVRsV???304FI?`<&dxk@%5%=lUp$5vg)gpX^qM(a79G2Eh^GYio;+j` z|I-IsL;|`=|24@!A-9t69l3IpCkOzH$BDyNk0oRzHQC=L`G-WMRe??e7y$r)5wJ>HC$41o-F=;S!!NdSo5IR zi68oV`26qU?_tKHlef+syn5_b%3Yma13FD`tB8bc*D9gOl_upbe5yPqqM8S|FLbvb z+616R5sv2woOls?-U#upfi+x+zq;wj_RI0t3JWrU5&$UxgaBY(%#5mUQiMZ@=US4m z%PZNJl)KQtKJ{{%jA29*fEp+-DEJzx|9HgzcHzK|6F;1Zy9frY33-44&w^gNVB$y1 zr+kcISdCBVn4DWrVpy&m0qf~Bp{4ucCJ6q|itYOE=*?3rcCWb-e-&5*2*n_hK0_r7 zjA6l~k5)|i#OwzZ%0F1X9LEI!R8H|O4Dc52A7a=)$3!B4+@icfWpQzN3Bwow!vKK5 za0jWqoml4S(o8HA)nn;+gs|r?&E>V@$-D1B3u4 zDLY3;slAV@m!I5kSmaAF-G+&4ak(phUw{1SF|1yWmq*B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h>0gXb zG&=3;>*hc-bePqLVOgtMTe|B@=nU^}TU_yE+F3z|W!gIlxgW5+(nz=<;CZCu_;L~D z?dSS#Ti;ziF4HK&@$YkTgS=Y;2cP}2YW<%LwLBR2!Ojz*V$hYl8QmfrQmN|Cwl+?p3cKrN`{bE7h zEeCYyW9=CPr{m6pRv*)KsFTc5QC6fVD{_=M4Cy=&c<%iDE4ANm=&iehBl{g+eqi#d z=_!xy{CajzOy|L!f;v>=0a-e;?!+r<+WbZQl0RXZiBQc$t&0$Nvn=qz&#^$orle@&&+{9EYb z5dx8TO24tTef()zVX0c_X75seskSAOU;GqEe8;Jucb(f~JTd^saHUoSJf!8PH$MIV zAUe3?iO=`Fxo-BKmyQftH1g+6AVCrYAilY)mzPVkXNQp@k|41Vu3bR* z--15?2$1_8{q(nwb}n1DYx$u0!!K<-+x6Kt6Gv&6P|tOM;Sym>k-(S4W&f6vhzg2` z3W_kAo3Sh2*thq`JE`}q!e6j=AmQqC_OCN}B?an?Th*JwZ&uKZ|xg=?B=PZKds=E%J*ixEfiSiDs>5s0$RA|;(>@3 zZ35(eIF3KeNCFJQuzz}da2$VQz-#ZWocY$eIiFAYxJyWsMz7s@>gR-vN8h}&%6QkS zh4M8%J8Ymc^b$cgV&YdbwR)ZPRHA&nQu*ZkMi2)IP0(@HW7$FggConfiguring Message Channels To create a Message Channel instance, use the 'channel' element: - <channel/> + <channel id="exampleChannel"/> - You can also specify the channel's capacity: <channel capacity="100"/> + You can also specify the channel's capacity: <channel id="exampleChannel" capacity="100"/> The default channel type is Point to Point. To create a Publish Subscribe channel, provide a value of true for the 'publish-subscribe' attribute of the channel element: - <channel publish-subscribe="true"/> + <channel id="exampleChannel" publish-subscribe="true"/> + + + When the MessageBus detects and registers channels, it will establish a dispatcher for + each channel. The default dispatcher settings were previously displayed in + . To customize these settings for a particular channel, add + the 'dispatcher-policy' sub-element and provide one or more of the attributes shown below: + + +]]> -
+
Configuring Message Endpoints + To create a Message Endpoint instance, use the 'endpoint' element with the 'input-channel' and 'handler-ref' + attributes: + <endpoint input-channel="exampleChannel" handler-ref="exampleHandler"/> + + + The configuration above assumes that "exampleHandler" is an actual implementation of the + MessageHandler interface as described in . + To delegate to an arbitrary method of any object, simply add the "handler-method" attribute. + <endpoint input-channel="exampleChannel" handler-ref="somePojo" handler-method="someMethod"/> + + + In either case (MessageHandler or arbitrary object/method), when the handling + method returns a non-null value, the endpoint will attempt to send the reply message to an appropriate reply + channel. To determine the reply channel, it will first check for a value in the message header's + 'replyChannelName' property. If that value is available, it will attempt to resolve the channel by performing a + lookup in the ChannelRegistry. If the message header does not contain a + 'replyChannelName' property, then it will fallback to its own 'defaultOutputChannel' property. If neither is + available, then a MessageHandlingException will be thrown. To configure the default + output channel when using the XML namespace, provide the 'default-output-channel' attribute: + <endpoint input-channel="exampleChannel" + handler-ref="somePojo" + handler-method="someMethod" + default-output-channel="replyChannel"/> + + + When the MessageBus registers the endpoint, it will activate the subscription + by assigning the endpoint to the input channel's dispatcher. The dispatcher is capable of handling multiple + endpoint subscriptions for its channel and delegates to a scheduler for managing the tasks that pull messages + from the channel and push them to the endpoints. To configure the polling period for an individual endpoint's + schedule, provide a 'schedule' sub-element with the 'period' in milliseconds: + + ]]>]]>]]> + + + Individual endpoint schedules only apply for "Point-to-Point" channels, since in that case only a single + subscriber needs to receive the message. On the other hand, when a Spring Integration channel is configured as + a "Publish-Subscribe" channel, then the dispatcher will drive all endpoint notifications according to its own + default schedule, and any 'schedule' element configured for those endpoints will be ignored. + + + One of the most important configuration options for endpoints is the concurrency policy. Each endpoint is + capable of managing a thread pool for its handler, and the values you provide for that pool's core and max + size can make a substantial difference in how the handler performs under load. These settings are available + per-endpoint since the performance characteristics of an endpoint's handler is one of the major factors to + consider (the other major factor being the expected volume on the channel to which the endpoint subscribes). + To enable concurrency for an endpoint that is configured with the XML namespace support, provide the + 'concurrency' sub-element and one or more of the properties shown below: + + ]]>]]>]]> + Recall the default concurrency policy values as listed in . + + + The default queue capacity of 0 triggers the creation of a SynchronousQueue. In many + cases, this is preferable since the direct handoff eliminates the chance of a message handling task being + "stuck" in the queue (thread pool executors will favor adding to the queue rather than increasing the pool + size). Specifically, whenever a dispatcher for a Point-to-Point channel has more than one subscribed endpoint, + a task that is rejected due to an exhausted thread pool can be handled immediately by another endpoint whose + pool has one or more threads available. On the other hand, when a particular channel/endpoint may be expecting + bursts of activity, setting a queue capacity value might be the best way to accommodate the volume. + +
+ +
+ Configuring the Message Bus + + As described in , the MessageBus plays a central role. + Nevertheless, its configuration is quite simple since it is primarily concerned with managing internal details + based on the configuration of channels and endpoints. The bus is aware of its host application context, and + therefore is also capable of auto-detecting the channels and endpoints. Typically, the + MessageBus can be configured with a single empty element: + <message-bus/> + + + The Message Bus provides default error handling for its components in the form of a configurable error channel, + and the 'message-bus' element accepts a reference with its 'error-channel' attribute: + + +]]> + + + The 'message-bus' element accepts two more optional attributes. First is the size of the dispatcher thread + pool. The dispatcher threads are responsible for polling channels and then passing the messages to handlers. + When the endpoints are concurrency-enabled as described in the previous section, the invocation of the handling + methods will happen within the handler thread pool and not the dispatcher pool. Finally, the Message Bus is + capable of automatically creating channel instances (with default settings) if an endpoint registers a + subscription by providing the name of a channel that the bus does not recognize. + ]]> + +
+ +
+ Enabling Annotation-Driven Configuration + + The next section will describe Spring Integration's support for annotation-driven configuration. To enable + those features, add this single element to the XML-based configuration: + <annotation-driven/>
diff --git a/spring-integration-reference/reference/src/core-api.xml b/spring-integration-reference/reference/src/core-api.xml index 3cc78515b9..0887bc7e46 100644 --- a/spring-integration-reference/reference/src/core-api.xml +++ b/spring-integration-reference/reference/src/core-api.xml @@ -90,7 +90,7 @@ new GenericMessage<T>(T payload); Spring Integration's MessageChannel interface is defined as follows. public interface MessageChannel { String getName(); - boolean isPublishSubscribe(); + DispatcherPolicy getDispatcherPolicy(); boolean send(Message message); boolean send(Message message, long timeout); Message receive(); @@ -138,7 +138,6 @@ new GenericMessage<T>(T payload); MessageChannels and MessageHandlers. It provides the following methods: public void registerChannel(String name, MessageChannel channel) -public void registerChannel(String name, MessageChannel channel, DispatcherPolicy dispatcherPolicy) public void registerHandler(String name, MessageHandler handler, Subscription subscription) public void registerHandler(String name, MessageHandler handler, Subscription subscription, ConcurrencyPolicy concurrencyPolicy) As those method signatures reveal, the message bus is handling several of the concerns here so that the channel @@ -149,8 +148,8 @@ public void registerHandler(String name, MessageHandler handler, Subscription su The bus creates and manages dispatchers that pull messages from a channel in order to push those messages to - handlers subscribed to that channel. The DispatcherPolicy contains metadata for - configuring those dispatchers: + handlers subscribed to that channel. Each channel has a DispatcherPolicy that contains + metadata for configuring those dispatchers: Properties of the DispatcherPolicy @@ -183,6 +182,12 @@ public void registerHandler(String name, MessageHandler handler, Subscription su 1000 (milliseconds) amount of time to wait between successive attempts to invoke handlers + + shouldFailOnRejectionLimit + true + whether to throw a MessageDeliveryException if the 'rejectionLimit' is + reached - if this is set to 'false', then such undeliverable messages would be dropped silently +
@@ -258,10 +263,45 @@ public void registerHandler(String name, MessageHandler handler, Subscription su
The ConcurrencyPolicy is an optional parameter to provide when registering a handler. - It encapsulates two properties: 'coreSize' and 'maxSize'. When the MessageBus - registers a handler, it will use these properties to configure that handler's thread pool. These pool size - parameters are configurable on a per-handler basis since handlers may have differences in performance and - may have different expectations with regard to the volume of throughput. + When the MessageBus registers a handler, it will use these properties to configure + that handler's thread pool. These parameters are configurable on a per-handler basis since handlers may have + different performance characteristics and may have different expectations with regard to the volume of + throughput. The following table lists the available properties and their default values: + + Properties of the ConcurrencyPolicy + + + + + Property Name + Default Value + Description + + + + + coreSize + 1 + the core size of the thread pool + + + maxSize + 10 + the maximum size the thread pool can reach when under demand + + + queueCapacity + 0 + capacity of the queue which defers an increase of the pool size + + + keepAliveSeconds + 60 + how long added threads (beyond core size) should remain idle before being removed from the pool + + + +