Processing messages sequentially from a List

View: New views
3 Messages — Rating Filter:   Alert me  

Processing messages sequentially from a List

by psk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have a two messages  in a ArrayList  and I want to process them sequentially  but each one has its own processing logic.
Also, there is no relation between the way the two messages gets processed. e.g. I don't have to chain these two operations.

How can I do this ?

Thanks
-Prashant

Re: Processing messages sequentially from a List

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can restrict the number of threads on the component or component instances to 1.

HTH,
Andrew

Re: Processing messages sequentially from a List

by Richard Swart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is what I'm trying to achieve..any suggestions?

 <service>
               
                <!-- Aggregator code to bundle two messages in a List -->
               
                <outbound matchAll="true">
               
                          <!-- if it's collection -->
                       
                          <filtering-router>
                                <outbound-endpoint ref="processCollection" />
                                               
                                    <payload-type-filter expectedType="java.util.List"/>
                                                                                                       
                                       
                                </filtering-router>
                               
                           <!--  if it's single message - No issue with this-->
                             <filtering-router>
                                        <outbound-endpoint ref="procesRead" />
                                       
                                          <and-filter>
                                          <payload-type-filter expectedType="MyObject"/>
                                          <expression-filter expression="type='XXX'" evaluator="jxpath" />
                                        </and-filter>  
                                </filtering-router>
                               
       
                               
                        </outbound>
                       
          </service>
                       
                        <!-- List has two messages,write and read -->
                       
                        <!-- How can I configure ProcessCollection, such that it takes first message from list and gives for writing(ProcessWrite)
                             and once that opearion is done then pull second payload and pass it to reading (ProcessRead) -->
                       
                        <service name="ProcessCollection">
                                        <inbound>
                                                <inbound-endpoint ref="processCollection" transformer-refs="myTransformer" />
                                                       
                                                </inbound>
                                                <component>
                                                        <spring-object bean="doSomething" />
                                                </component>
                      </service>
                     
                     
                     
                      <service name="ProcessRead">
                      <inbound>
                              <inbound-endpoint ref="procesRead" transformer-refs="myReadTransformer" />
                      </inbound>
                      <component>
                      <spring-object bean="doSomeReading" />
                      </component>
                      .......
                     
                      .......
                     
                      </service>
                     
                     
                      <service name="ProcessWrite">
                      <inbound>
                        <inbound-endpoint ref="procesWrite" transformer-refs="myWriteTransformer" />
                      </inbound>
                      <component>
                       <spring-object bean="doSomeWriting" />
                      </component>
                     
                      .....
                     
                      ......
                      </service>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email